FlatfileImporter
Hierarchy
EventEmitter
↳ FlatfileImporter
Index
Constructors
Properties
Methods
- addVirtualFields
- close
- displayError
- displayLoader
- displaySuccess
- registerFieldHook
- registerRecordHook
- registerStepHook
- requestCorrectionsFromUser
- requestDataFromUser
- setCustomer
- setMountUrl
Constructors
constructor
+ new FlatfileImporter(apiKey
: string, options
: object, customer?
:
Defined in src/index.ts:36
Parameters:
Name | Type |
---|---|
apiKey | string |
options | object |
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:
Name | Type |
---|---|
field | IField |
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:
Name | Type |
---|---|
msg | string |
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:
Name | Type |
---|---|
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:
Name | Type |
---|---|
msg | string |
Returns: void
registerFieldHook
▸ registerFieldHook(field
: string, cb
:
Defined in src/index.ts:221
Set the customer information for this import
Parameters:
Name | Type |
---|---|
field | string |
cb | FieldHookCallback |
Returns: void
registerRecordHook
▸ registerRecordHook(callback
: FlatfileImporter["$recordHook"]): void
Defined in src/index.ts:214
Set the customer information for this import
Parameters:
Name | Type |
---|---|
callback | FlatfileImporter["$recordHook"] |
Returns: void
registerStepHook
▸ registerStepHook(step
: string, callback
: stepHookCallback): void
Defined in src/index.ts:214
requestCorrectionsFromUser
▸ requestCorrectionsFromUser(msg
: any, corrections?: IDataHookResponse[]): Promise‹
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:
Name | Type |
---|---|
msg | any |
Returns: Promise‹
requestDataFromUser
▸ requestDataFromUser(options
:
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:
Name | Type | Default |
---|---|---|
options | LoadOptionsObject | {} |
Returns: Promise‹
setCustomer
▸ setCustomer(customer
:
Defined in src/index.ts:197
Set the customer information for this import
Parameters:
Name | Type |
---|---|
customer | CustomerObject |
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:
Name | Type |
---|---|
url | string |
Returns: void