FlatfileImporter

@flatfile/adapter › FlatfileImporter

Hierarchy

  • EventEmitter

    FlatfileImporter

Index

Constructors

Properties

Methods

Constructors

constructor

+ new FlatfileImporter(apiKey: string, options: object, customer?: CustomerObject): FlatfileImporter

Defined in src/index.ts:36

Parameters:

NameType
apiKeystring
optionsobject
customer?CustomerObject

Returns: FlatfileImporter

Properties

\$ready

\$ready: Promise‹any›

Defined in src/index.ts:23

Promise that resolves when the handshake is completed between Flatfile.io and the adapter


Static Promise

Promise: PromiseConstructor = Promise

Defined in src/index.ts:17


Static prefixed

prefixed: string | boolean

Inherited from FlatfileImporter.prefixed

Defined in node_modules/eventemitter3/index.d.ts:10

Methods

addVirtualFields

addVirtualFields(field: IField, options?: {order?: number, hideFields?: string[]})

Defined in node_modules/eventemitter3/index.d.ts:37

Parameters:

NameType
fieldIField
options?{order?, hideFields?}

close

close(): void

Defined in src/index.ts:229

Call close() from the parent window in order to hide the importer. You can do this after handling the import callback so your users don't have to click the confirmation button

Returns: void


displayError

displayError(msg: string): void

Defined in src/index.ts:153

This will display a dialog inside of the importer with an error icon and the message you pass. The user will be able to acknowledge the error and be returned to the import data spreadsheet to ideally fix any issues or attempt submitting again.

deprecated

Parameters:

NameType
msgstring

Returns: void


displayLoader

displayLoader(msg?: undefined | string): void

Defined in src/index.ts:141

This will display a progress indicator inside the importer if you anticipate that handling the output of the importer may take some time.

Parameters:

NameType
msg?undefined | string

Returns: void


displaySuccess

displaySuccess(msg: string): void

Defined in src/index.ts:175

This will display a dialog inside of the importer with a success icon and the message you pass.

Parameters:

NameType
msgstring

Returns: void


registerFieldHook

registerFieldHook(field: string, cb: FieldHookCallback): void

Defined in src/index.ts:221

Set the customer information for this import

Parameters:

NameType
fieldstring
cbFieldHookCallback

Returns: void


registerRecordHook

registerRecordHook(callback: FlatfileImporter["$recordHook"]): void

Defined in src/index.ts:214

Set the customer information for this import

Parameters:

NameType
callbackFlatfileImporter["$recordHook"]

Returns: void


registerStepHook

registerStepHook(step: string, callback: stepHookCallback): void

Defined in src/index.ts:214


requestCorrectionsFromUser

requestCorrectionsFromUser(msg: any, corrections?: IDataHookResponse[]): Promise‹FlatfileResults

Defined in src/index.ts:164

This will display a dialog inside of the importer with an error icon and the message you pass. The user will be able to acknowledge the error and be returned to the import data spreadsheet to ideally fix any issues or attempt submitting again.

Parameters:

NameType
msgany

Returns: Promise‹FlatfileResults


requestDataFromUser

requestDataFromUser(options: LoadOptionsObject): Promise‹FlatfileResults

Defined in src/index.ts:132

Use requestDataFromUser() when you want a promise returned. This is necessary if you want to use async/await for an es6 implementation

Parameters:

NameTypeDefault
optionsLoadOptionsObject{}

Returns: Promise‹FlatfileResults


setCustomer

setCustomer(customer: CustomerObject): void

Defined in src/index.ts:197

Set the customer information for this import

Parameters:

NameType
customerCustomerObject

Returns: void


Static setMountUrl

setMountUrl(url: string): void

Defined in src/index.ts:59

This will by default always be https://www.flatfile.io/importer/:key unless you are an enterprise customer that is self-hosting the application. In which case, this will be the URL of your enterprise installd Flatfile importer index page

Parameters:

NameType
urlstring

Returns: void