mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
Make importParsedFileAsNewTable a public method of ActiveDoc
This commit is contained in:
parent
fef5b76092
commit
58c3b596bb
@ -80,7 +80,7 @@ import {guessColInfo} from 'app/common/ValueGuesser';
|
|||||||
import {parseUserAction} from 'app/common/ValueParser';
|
import {parseUserAction} from 'app/common/ValueParser';
|
||||||
import {TEMPLATES_ORG_DOMAIN} from 'app/gen-server/ApiServer';
|
import {TEMPLATES_ORG_DOMAIN} from 'app/gen-server/ApiServer';
|
||||||
import {Document} from 'app/gen-server/entity/Document';
|
import {Document} from 'app/gen-server/entity/Document';
|
||||||
import {ParseOptions} from 'app/plugin/FileParserAPI';
|
import {ParseFileResult, ParseOptions} from 'app/plugin/FileParserAPI';
|
||||||
import {AccessTokenOptions, AccessTokenResult, GristDocAPI} from 'app/plugin/GristAPI';
|
import {AccessTokenOptions, AccessTokenResult, GristDocAPI} from 'app/plugin/GristAPI';
|
||||||
import {compileAclFormula} from 'app/server/lib/ACLFormula';
|
import {compileAclFormula} from 'app/server/lib/ACLFormula';
|
||||||
import {AssistanceSchemaPromptV1Context} from 'app/server/lib/Assistance';
|
import {AssistanceSchemaPromptV1Context} from 'app/server/lib/Assistance';
|
||||||
@ -113,7 +113,7 @@ import tmp from 'tmp';
|
|||||||
|
|
||||||
import {ActionHistory} from './ActionHistory';
|
import {ActionHistory} from './ActionHistory';
|
||||||
import {ActionHistoryImpl} from './ActionHistoryImpl';
|
import {ActionHistoryImpl} from './ActionHistoryImpl';
|
||||||
import {ActiveDocImport} from './ActiveDocImport';
|
import {ActiveDocImport, FileImportOptions} from './ActiveDocImport';
|
||||||
import {DocClients} from './DocClients';
|
import {DocClients} from './DocClients';
|
||||||
import {DocPluginManager} from './DocPluginManager';
|
import {DocPluginManager} from './DocPluginManager';
|
||||||
import {
|
import {
|
||||||
@ -773,6 +773,17 @@ export class ActiveDoc extends EventEmitter {
|
|||||||
await this._activeDocImport.oneStepImport(docSession, uploadInfo);
|
await this._activeDocImport.oneStepImport(docSession, uploadInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Import data resulting from parsing a file into a new table.
|
||||||
|
* In normal circumstances this is only used internally.
|
||||||
|
* It's exposed publicly for use by grist-static which doesn't use the plugin system.
|
||||||
|
*/
|
||||||
|
public async importParsedFileAsNewTable(
|
||||||
|
docSession: OptDocSession, optionsAndData: ParseFileResult, importOptions: FileImportOptions
|
||||||
|
): Promise<ImportResult> {
|
||||||
|
return this._activeDocImport.importParsedFileAsNewTable(docSession, optionsAndData, importOptions);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function saves attachments from a given upload and creates an entry for them in the database.
|
* This function saves attachments from a given upload and creates an entry for them in the database.
|
||||||
* It returns the list of rowIds for the rows created in the _grist_Attachments table.
|
* It returns the list of rowIds for the rows created in the _grist_Attachments table.
|
||||||
|
@ -44,7 +44,7 @@ interface ReferenceDescription {
|
|||||||
refTableId: string;
|
refTableId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FileImportOptions {
|
export interface FileImportOptions {
|
||||||
// Suggested name of the import file. It is sometimes used as a suggested table name, e.g. for csv imports.
|
// Suggested name of the import file. It is sometimes used as a suggested table name, e.g. for csv imports.
|
||||||
originalFilename: string;
|
originalFilename: string;
|
||||||
// Containing parseOptions as serialized JSON to pass to the import plugin.
|
// Containing parseOptions as serialized JSON to pass to the import plugin.
|
||||||
|
Loading…
Reference in New Issue
Block a user