IDataSourceFilesService
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Service to manage files of data sources that keep their data in files, for example CSV data sources.
export interface IDataSourceFilesService
Remarks
A file goes to a data source in three steps: upload it to the staging area, analyze it, and import it.
Methods
Method | Description |
|---|---|
(ALPHA) Analyzes CSV files in the staging area. | |
(ALPHA) Analyzes SPSS (.sav) files in the staging area. | |
(ALPHA) Deletes files of a data source. | |
(ALPHA) Returns the options that the backend used to import CSV files into a data source. | |
(ALPHA) Returns files of a data source. | |
(ALPHA) Imports CSV files from the staging area into a data source. | |
(ALPHA) Imports SPSS (.sav) files from the staging area into a data source. | |
(ALPHA) Uploads a file to the staging area. |
Method details
IDataSourceFilesService.analyzeCsv()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Analyzes CSV files in the staging area.
analyzeCsv(requests: ICsvAnalysisRequest[]): Promise<ICsvAnalysis[]>;
Parameters
Parameter | Type | Description |
|---|---|---|
requests | files to analyze |
Returns
Promise<ICsvAnalysis[]>
IDataSourceFilesService.analyzeSav()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Analyzes SPSS (.sav) files in the staging area.
analyzeSav(requests: ISavAnalysisRequest[]): Promise<ISavAnalysis[]>;
Parameters
Parameter | Type | Description |
|---|---|---|
requests | files to analyze |
Returns
Promise<ISavAnalysis[]>
IDataSourceFilesService.deleteFiles()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Deletes files of a data source.
deleteFiles(dataSourceId: string, fileNames: string[]): Promise<void>;
Parameters
Parameter | Type | Description |
|---|---|---|
dataSourceId | string | identifier of the data source |
fileNames | string[] | names of the files to delete |
Returns
Promise<void>
IDataSourceFilesService.getCsvManifests()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Returns the options that the backend used to import CSV files into a data source.
getCsvManifests(dataSourceId: string, fileNames: string[]): Promise<ICsvFileManifest[]>;
Parameters
Parameter | Type | Description |
|---|---|---|
dataSourceId | string | identifier of the data source |
fileNames | string[] | names of the files |
Returns
Promise<ICsvFileManifest[]>
IDataSourceFilesService.getFiles()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Returns files of a data source.
getFiles(dataSourceId: string): Promise<IDataSourceFile[]>;
Parameters
Parameter | Type | Description |
|---|---|---|
dataSourceId | string | identifier of the data source |
Returns
Promise<IDataSourceFile[]>
IDataSourceFilesService.importCsv()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Imports CSV files from the staging area into a data source.
importCsv(dataSourceId: string, tables: ICsvImportTable[]): Promise<ICsvImportResult[]>;
Parameters
Parameter | Type | Description |
|---|---|---|
dataSourceId | string | identifier of the data source |
tables | tables to create or update from the files |
Returns
Promise<ICsvImportResult[]>
IDataSourceFilesService.importSav()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Imports SPSS (.sav) files from the staging area into a data source.
importSav(dataSourceId: string, tables: ISavImportTable[]): Promise<ISavImportResult[]>;
Parameters
Parameter | Type | Description |
|---|---|---|
dataSourceId | string | identifier of the data source |
tables | tables to create or update from the files |
Returns
Promise<ISavImportResult[]>
IDataSourceFilesService.upload()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Uploads a file to the staging area.
upload(file: File): Promise<string>;
Parameters
Parameter | Type | Description |
|---|---|---|
file | File | file to upload |
Returns
Promise<string>
location of the uploaded file, to use in the analysis and the import