flatfile-csv-importer › 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
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

addListener

addListener(

event
: string | symbol,
fn
: ListenerFn,
context?
: any): this

Inherited from FlatfileImporter.addListener

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

Parameters:

NameType
event
string | symbol
fn
ListenerFn
context?
any

Returns: this


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
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:

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
msg
string

Returns: void


emit

emit(

event
: string | symbol, ...
args
: Array‹any›): boolean

Inherited from FlatfileImporter.emit

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

Calls each of the listeners registered for a given event.

Parameters:

NameType
event
string | symbol
...args
Array‹any›

Returns: boolean


eventNames

eventNames(): Array‹string | symbol›

Inherited from FlatfileImporter.eventNames

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

Return an array listing the events for which the emitter has registered listeners.

Returns: Array‹string | symbol›


getMeta

getMeta(): object

Defined in src/index.ts:184

This will fetch the data from the importer

Returns: object


listenerCount

listenerCount(

event
: string | symbol): number

Inherited from FlatfileImporter.listenerCount

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

Return the number of listeners listening to a given event.

Parameters:

NameType
event
string | symbol

Returns: number


listeners

listeners(

event
: string | symbol): Array‹ListenerFn›

Inherited from FlatfileImporter.listeners

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

Return the listeners registered for a given event.

Parameters:

NameType
event
string | symbol

Returns: Array‹ListenerFn›


load

load(): Promise‹Array‹Object››

Defined in src/index.ts:104

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

deprecated

Returns: Promise‹Array‹Object››


off

off(

event
: string | symbol,
fn?
: ListenerFn,
context?
: any,
once?
: undefined | false | true): this

Inherited from FlatfileImporter.off

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

Parameters:

NameType
event
string | symbol
fn?
ListenerFn
context?
any
once?
undefined | false | true

Returns: this


on

on(

event
: string | symbol,
fn
: ListenerFn,
context?
: any): this

Inherited from FlatfileImporter.on

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

Add a listener for a given event.

Parameters:

NameType
event
string | symbol
fn
ListenerFn
context?
any

Returns: this


once

once(

event
: string | symbol,
fn
: ListenerFn,
context?
: any): this

Inherited from FlatfileImporter.once

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

Add a one-time listener for a given event.

Parameters:

NameType
event
string | symbol
fn
ListenerFn
context?
any

Returns: this


open

open(

options
: object): void

Defined in src/index.ts:82

Call open() to activate the importer overlay dialog.

Parameters:

NameTypeDefault
options
object{}

Returns: void


registerFieldHook

registerFieldHook(

field
: string,
cb
: FieldHookCallback): void

Defined in src/index.ts:221

Set the customer information for this import

Parameters:

NameType
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:

NameType
callback
FlatfileImporter["$recordHook"]

Returns: void


registerValidatorCallback

registerValidatorCallback(

callback
: FlatfileImporter["$validatorCallback"]): void

Defined in src/index.ts:204

Set the customer information for this import

Parameters:

NameType
callback
FlatfileImporter["$validatorCallback"]

Returns: void


removeAllListeners

removeAllListeners(

event?
: string | symbol): this

Inherited from FlatfileImporter.removeAllListeners

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

Remove all listeners, or those of the specified event.

Parameters:

NameType
event?
string | symbol

Returns: this


removeListener

removeListener(

event
: string | symbol,
fn?
: ListenerFn,
context?
: any,
once?
: undefined | false | true): this

Inherited from FlatfileImporter.removeListener

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

Remove the listeners of a given event.

Parameters:

NameType
event
string | symbol
fn?
ListenerFn
context?
any
once?
undefined | false | true

Returns: this


requestCorrectionsFromUser

requestCorrectionsFromUser(

msg
: any): 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
msg
any

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
options
LoadOptionsObject{}

Returns: Promise‹FlatfileResults


setCustomer

setCustomer(

customer
: CustomerObject): void

Defined in src/index.ts:197

Set the customer information for this import

Parameters:

NameType
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:

NameType
url
string

Returns: void


Static
setVersion

setVersion(

version
: 1 | 2): void

Defined in src/index.ts:66

This allows you to opt into or out of specific versions of the Flatfile SDK

Parameters:

NameType
version
1 | 2

Returns: void