Zum Hauptinhalt springen

MasterDataService

Type Parameters​

TMapping​

TMapping extends MasterDataServiceMapping

Implements​

Constructors​

Constructor​

new MasterDataService<TMapping>(): MasterDataService<TMapping>

Returns​

MasterDataService<TMapping>

Methods​

authorize()​

authorize(token): this

Authorize Client by given token provided by One Unity.

Parameters​

token​

string

Given token provided by One Unity

Returns​

this

Returns the client instance for chaining.

Implementation of​

IDataRaiService.authorize


useRepository()​

useRepository(repository): this

Parameters​

repository​

MasterDataServiceRepository

Returns​

this


withData()​

withData(data): this

Provide data that should be uploaded (/save).

If your schema is not identical to the masterdata repository scheme, you should provide a mapping.

.withData([{
YOUR_DB_KEY_NAME_A: "my id",
YOUR_DB_KEY_NAME_B: "my name",
}])
.withMapping({
id: "YOUR_DB_KEY_NAME_A",
name: "YOUR_DB_KEY_NAME_B",
})

Parameters​

data​

MasterDataServiceData

Your data that should be uploaded.

Returns​

this

Returns the client instance for chaining.


deleteData()​

deleteData(): this

Returns​

this


overrideData()​

overrideData(): this

Returns​

this


withMapping()​

withMapping(mapping): this

Provide a mapping between your rows and datarai table scheme.

The key is the DataRai specific name. The value is the key of your data-object when calling withData(), comming from your data source.

.withData([{
YOUR_DB_KEY_NAME_A: "my id",
YOUR_DB_KEY_NAME_B: "my name",
}]).withMapping({
id: "YOUR_DB_KEY_NAME_A",
name: "YOUR_DB_KEY_NAME_B",
})

or

.provideRecipients([{
YOUR_DB_KEY_NAME_A: "my id",
YOUR_DB_KEY_NAME_B: "my name",
}]).withMapping({
id: "YOUR_DB_KEY_NAME_A",
name: "YOUR_DB_KEY_NAME_B",
})

Parameters​

mapping​

TMapping

Returns​

this

Returns the client instance for chaining.


preventProvideToTargetSystem()​

preventProvideToTargetSystem(): this

This prevent the call of /provide after data was sent.

Returns​

this

Returns the client instance for chaining.


execute()​

execute(options): boolean

Parameters​

options​

TExecuteOptions

Returns​

boolean

Implementation of​

IDataRaiService.execute