@superoffice/webapi 11.7.727 → 11.9.1204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +15 -15
- package/README.md +184 -184
- package/__tests__/Appointment63-notz.json +1925 -1925
- package/__tests__/Appointment63-utctz.json +1925 -1925
- package/__tests__/Appointment63.json +1925 -1925
- package/__tests__/AppointmentTzTest.ts +115 -115
- package/__tests__/AxiosNockTest.ts +28 -28
- package/__tests__/ContactDefault.json +699 -699
- package/__tests__/ContactEntity.json +272 -272
- package/__tests__/ContactRestTest.ts +144 -144
- package/__tests__/ContactTest.ts +395 -395
- package/__tests__/ConvertersTest.ts +97 -97
- package/__tests__/DocumentTest.ts +101 -101
- package/__tests__/Person210-notz.json +1932 -1932
- package/__tests__/Person210-utctz.json +1932 -1932
- package/__tests__/Person210.json +1932 -1932
- package/__tests__/PersonImageData.nock +22 -22
- package/__tests__/PersonTest.ts +41 -41
- package/__tests__/PersonTzTest.ts +113 -113
- package/__tests__/RecurrenceInfo.json +55 -55
- package/__tests__/ResponseCallbackTest.ts +23 -23
- package/__tests__/TableRights.json +441 -441
- package/__tests__/WebapiTest.ts +264 -264
- package/__tests__/Webhook.json +16 -16
- package/__tests__/WebhookTest.ts +209 -209
- package/dist/cjs/AIAgent.d.ts +62 -0
- package/dist/cjs/AIAgent.d.ts.map +1 -1
- package/dist/cjs/AIAgent.js +149 -0
- package/dist/cjs/AIAgent.js.map +1 -1
- package/dist/cjs/Carriers.d.ts +640 -14
- package/dist/cjs/Carriers.d.ts.map +1 -1
- package/dist/cjs/Converters.d.ts +24 -0
- package/dist/cjs/Converters.d.ts.map +1 -1
- package/dist/cjs/Converters.js +388 -17
- package/dist/cjs/Converters.js.map +1 -1
- package/dist/cjs/DiagnosticsAgent.d.ts +38 -0
- package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
- package/dist/cjs/DiagnosticsAgent.js +91 -0
- package/dist/cjs/DiagnosticsAgent.js.map +1 -1
- package/dist/cjs/Enums.d.ts +77 -1
- package/dist/cjs/Enums.d.ts.map +1 -1
- package/dist/cjs/Enums.js +83 -4
- package/dist/cjs/Enums.js.map +1 -1
- package/dist/cjs/ListAgent.d.ts +71 -6
- package/dist/cjs/ListAgent.d.ts.map +1 -1
- package/dist/cjs/ListAgent.js +157 -0
- package/dist/cjs/ListAgent.js.map +1 -1
- package/dist/cjs/MarketingAgent.d.ts +68 -0
- package/dist/cjs/MarketingAgent.d.ts.map +1 -1
- package/dist/cjs/MarketingAgent.js +157 -0
- package/dist/cjs/MarketingAgent.js.map +1 -1
- package/dist/cjs/TicketAgent.d.ts +23 -0
- package/dist/cjs/TicketAgent.d.ts.map +1 -1
- package/dist/cjs/TicketAgent.js +65 -0
- package/dist/cjs/TicketAgent.js.map +1 -1
- package/dist/esm/AIAgent.d.ts +62 -0
- package/dist/esm/AIAgent.d.ts.map +1 -1
- package/dist/esm/AIAgent.js +150 -1
- package/dist/esm/AIAgent.js.map +1 -1
- package/dist/esm/Carriers.d.ts +640 -14
- package/dist/esm/Carriers.d.ts.map +1 -1
- package/dist/esm/Converters.d.ts +24 -0
- package/dist/esm/Converters.d.ts.map +1 -1
- package/dist/esm/Converters.js +346 -0
- package/dist/esm/Converters.js.map +1 -1
- package/dist/esm/DiagnosticsAgent.d.ts +38 -0
- package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
- package/dist/esm/DiagnosticsAgent.js +91 -0
- package/dist/esm/DiagnosticsAgent.js.map +1 -1
- package/dist/esm/Enums.d.ts +77 -1
- package/dist/esm/Enums.d.ts.map +1 -1
- package/dist/esm/Enums.js +79 -0
- package/dist/esm/Enums.js.map +1 -1
- package/dist/esm/ListAgent.d.ts +71 -6
- package/dist/esm/ListAgent.d.ts.map +1 -1
- package/dist/esm/ListAgent.js +157 -0
- package/dist/esm/ListAgent.js.map +1 -1
- package/dist/esm/MarketingAgent.d.ts +68 -0
- package/dist/esm/MarketingAgent.d.ts.map +1 -1
- package/dist/esm/MarketingAgent.js +157 -0
- package/dist/esm/MarketingAgent.js.map +1 -1
- package/dist/esm/TicketAgent.d.ts +23 -0
- package/dist/esm/TicketAgent.d.ts.map +1 -1
- package/dist/esm/TicketAgent.js +65 -0
- package/dist/esm/TicketAgent.js.map +1 -1
- package/examples-js/hello.js +12 -12
- package/examples-ts/hello.ts +8 -8
- package/package.json +93 -93
- package/scripts/postbuild.js +22 -22
- package/scripts/setVersion.js +44 -44
- package/src/AIAgent.ts +2239 -1992
- package/src/AppointmentAgent.ts +6263 -6263
- package/src/AppointmentRestApi.ts +225 -225
- package/src/ArchiveAgent.ts +1950 -1950
- package/src/AssociateAgent.ts +422 -422
- package/src/AxiosCacheHandler.ts +74 -74
- package/src/BLOBAgent.ts +2100 -2100
- package/src/Base64.ts +285 -285
- package/src/BatchAgent.ts +910 -910
- package/src/BulkUpdateAgent.ts +504 -504
- package/src/CRMScriptAgent.ts +1390 -1390
- package/src/Carriers.ts +53121 -52274
- package/src/ChatAgent.ts +1422 -1422
- package/src/ConfigurationAgent.ts +2228 -2228
- package/src/ContactAgent.ts +1756 -1756
- package/src/ContactRestApi.ts +237 -237
- package/src/Converters.ts +23496 -23090
- package/src/CustomerServiceAgent.ts +1799 -1799
- package/src/DashAgent.ts +1674 -1674
- package/src/DatabaseAgent.ts +120 -120
- package/src/DatabaseTableAgent.ts +534 -534
- package/src/Day_js.ts +41 -41
- package/src/DiagnosticsAgent.ts +1384 -1240
- package/src/DocumentAgent.ts +5079 -5079
- package/src/DocumentMigrationAgent.ts +524 -524
- package/src/DocumentRestApi.ts +259 -259
- package/src/EMailAgent.ts +5328 -5328
- package/src/Enums.ts +6998 -6916
- package/src/ErpSyncAgent.ts +2658 -2658
- package/src/FavouriteAgent.ts +720 -720
- package/src/FindAgent.ts +2330 -2330
- package/src/ForeignSystemAgent.ts +1710 -1710
- package/src/FreeTextAgent.ts +372 -372
- package/src/ImportAgent.ts +304 -304
- package/src/LicenseAgent.ts +1230 -1230
- package/src/ListAgent.ts +11451 -11237
- package/src/MDOAgent.ts +748 -748
- package/src/MarketingAgent.ts +1146 -890
- package/src/MessagingAgent.ts +384 -384
- package/src/NavigatorAgent.ts +140 -140
- package/src/NumberAllocationAgent.ts +296 -296
- package/src/PersonAgent.ts +3287 -3287
- package/src/PersonRestApi.ts +241 -241
- package/src/PhoneListAgent.ts +458 -458
- package/src/PocketAgent.ts +780 -780
- package/src/PreferenceAgent.ts +1900 -1900
- package/src/PreviewsAgent.ts +116 -116
- package/src/ProjectAgent.ts +2391 -2391
- package/src/ProjectRestApi.ts +239 -239
- package/src/QuoteAgent.ts +5159 -5159
- package/src/RelationAgent.ts +220 -220
- package/src/ReportAgent.ts +154 -154
- package/src/ResourceAgent.ts +358 -358
- package/src/SaintAgent.ts +601 -601
- package/src/SaleAgent.ts +2034 -2034
- package/src/SaleRestApi.ts +233 -233
- package/src/SelectionAgent.ts +3195 -3195
- package/src/SentryAgent.ts +462 -462
- package/src/SoApiConstants.ts +8 -8
- package/src/TargetsAgent.ts +1104 -1104
- package/src/TicketAgent.ts +3708 -3638
- package/src/TimeZoneAgent.ts +528 -528
- package/src/TooltipsAgent.ts +116 -116
- package/src/UserAgent.ts +4856 -4856
- package/src/UserDefinedFieldInfoAgent.ts +1764 -1764
- package/src/ViewStateAgent.ts +858 -858
- package/src/WebApi.ts +872 -872
- package/src/WebApiBase.ts +565 -565
- package/src/WebhookAgent.ts +388 -388
- package/src/WorkflowAgent.ts +1338 -1338
- package/tsconfig.esm.json +8 -8
- package/tsconfig.jest.json +8 -8
- package/tsconfig.json +34 -34
package/src/ImportAgent.ts
CHANGED
|
@@ -1,304 +1,304 @@
|
|
|
1
|
-
// <auto-generated>
|
|
2
|
-
// SuperOffice Code Generator
|
|
3
|
-
// modelling\templates\servicestswebapi\tswebapiagents.tt
|
|
4
|
-
// </auto-generated>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/* tslint:disable */
|
|
8
|
-
//----------------------------------------------------------------------------
|
|
9
|
-
// G E N E R A T E D F I L E ! D O N O T E D I T !
|
|
10
|
-
//----------------------------------------------------------------------------
|
|
11
|
-
//
|
|
12
|
-
// File: WebApi/ImportAgent.ts
|
|
13
|
-
//
|
|
14
|
-
//----------------------------------------------------------------------------
|
|
15
|
-
// Copyright (C) SuperOffice AS
|
|
16
|
-
//----------------------------------------------------------------------------
|
|
17
|
-
|
|
18
|
-
import { AxiosRequestConfig } from 'axios';
|
|
19
|
-
import { Duration } from 'dayjs/plugin/duration';
|
|
20
|
-
import * as enums from './Enums';
|
|
21
|
-
import * as base from './WebApiBase';
|
|
22
|
-
import * as carriers from './Carriers';
|
|
23
|
-
import * as converters from './Converters';
|
|
24
|
-
import { FromBase64ToString, ToBase64 } from './Base64';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* This agent can be used to import data into the system
|
|
28
|
-
*/
|
|
29
|
-
export interface IImportAgent {
|
|
30
|
-
previewImportAsync(request: carriers.Import_PreviewImportRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine[] >;
|
|
31
|
-
previewImportAsync(importLines: carriers.ImportLine[], columnDefinition: string[], culture: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine[] >;
|
|
32
|
-
saveImportAsync(request: carriers.Import_SaveImportRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
|
|
33
|
-
saveImportAsync(importLines: carriers.ImportLine[], columnDefinition: string[], createSelection: boolean, culture: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
|
|
34
|
-
createDefaultImportLineAsync(request: carriers.Import_CreateDefaultImportLineRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine >;
|
|
35
|
-
createDefaultImportLineAsync(countColumns: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine >;
|
|
36
|
-
createErpImportDataAsync(request: carriers.Import_CreateErpImportDataRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportErpData >;
|
|
37
|
-
createErpImportDataAsync(restriction: carriers.ArchiveRestrictionInfo[], columns: string[], connectionId: number, erpActorType: enums.ErpActorType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportErpData >;
|
|
38
|
-
} // interface IImportAgent
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* This agent can be used to import data into the system
|
|
45
|
-
*/
|
|
46
|
-
export class ImportAgent extends base.WebApiBase implements IImportAgent {
|
|
47
|
-
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
48
|
-
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
49
|
-
constructor(baseUrl: string, resourceManager:any);
|
|
50
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
51
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
52
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
53
|
-
constructor(options: base.WebApiOptions);
|
|
54
|
-
|
|
55
|
-
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
56
|
-
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
57
|
-
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
58
|
-
cultureCode?: string,
|
|
59
|
-
) {
|
|
60
|
-
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
61
|
-
options.basePath = "v1/Agents/Import/";
|
|
62
|
-
super(options);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
private async _previewImportAsync(request: carriers.Import_PreviewImportRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine[] > {
|
|
68
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
69
|
-
base.WebApiBase.SetPending(options);
|
|
70
|
-
return new Promise< carriers.ImportLine[] >(async (resolve, reject) => {
|
|
71
|
-
try {
|
|
72
|
-
config.baseURL = this._options.baseUrl;
|
|
73
|
-
const response = await this._axios.post("PreviewImport", request , config);
|
|
74
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
75
|
-
const res : carriers.ImportLine[] = converters.Create_ImportLineArray_From( response.data );
|
|
76
|
-
resolve(res);
|
|
77
|
-
}
|
|
78
|
-
catch( err ) {
|
|
79
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
80
|
-
reject(err);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Preview the import
|
|
89
|
-
* @param request - ImportLines, ColumnDefinition, Culture, Context
|
|
90
|
-
* @returns An array of the the rows that can be imported, manipulated according to Import rules given
|
|
91
|
-
*/
|
|
92
|
-
public async previewImportAsync(request: carriers.Import_PreviewImportRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine[] >;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Preview the import
|
|
96
|
-
* @param importLines - The rows that will be manipulated and according to Import rules
|
|
97
|
-
* @param columnDefinition - An array of the columndefinitions, like firstname, lastname, ...
|
|
98
|
-
* @param culture - The current culture used in the import. Used to match language specific strings
|
|
99
|
-
* @param context - Optional context for the import.
|
|
100
|
-
* @returns An array of the the rows that can be imported, manipulated according to Import rules given
|
|
101
|
-
*/
|
|
102
|
-
public async previewImportAsync(importLines: carriers.ImportLine[], columnDefinition: string[], culture: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine[] >;
|
|
103
|
-
|
|
104
|
-
public async previewImportAsync(importLines:carriers.ImportLine[]|carriers.Import_PreviewImportRequest, columnDefinition?:string[]|base.WebApiRequestOptions, culture?:string, context?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine[] > {
|
|
105
|
-
let _request : carriers.Import_PreviewImportRequest = null;
|
|
106
|
-
let _options : base.WebApiRequestOptions = null;
|
|
107
|
-
const first : any = importLines;
|
|
108
|
-
if( typeof( first ) === "object" && first && ( typeof(first.importLines)!='undefined' || typeof(first.columnDefinition)!='undefined' || typeof(first.culture)!='undefined' || typeof(first.context)!='undefined' ) )
|
|
109
|
-
{
|
|
110
|
-
_request = importLines as carriers.Import_PreviewImportRequest;
|
|
111
|
-
_options = columnDefinition as base.WebApiRequestOptions;
|
|
112
|
-
}
|
|
113
|
-
else
|
|
114
|
-
{
|
|
115
|
-
_request = {
|
|
116
|
-
importLines: importLines as carriers.ImportLine[],
|
|
117
|
-
columnDefinition: columnDefinition as string[],
|
|
118
|
-
culture: culture as string,
|
|
119
|
-
context: context as string,
|
|
120
|
-
};
|
|
121
|
-
_options = webapi_options;
|
|
122
|
-
}
|
|
123
|
-
return this._previewImportAsync( _request, _options );
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
private async _saveImportAsync(request: carriers.Import_SaveImportRequest, options?:base.WebApiRequestOptions) : Promise< number[] > {
|
|
128
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
129
|
-
base.WebApiBase.SetPending(options);
|
|
130
|
-
return new Promise< number[] >(async (resolve, reject) => {
|
|
131
|
-
try {
|
|
132
|
-
config.baseURL = this._options.baseUrl;
|
|
133
|
-
const response = await this._axios.post("SaveImport", request , config);
|
|
134
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
135
|
-
const res : number[] = response.data as number[];
|
|
136
|
-
resolve(res);
|
|
137
|
-
}
|
|
138
|
-
catch( err ) {
|
|
139
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
140
|
-
reject(err);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Do the actual import
|
|
149
|
-
* @param request - ImportLines, ColumnDefinition, CreateSelection, Culture, Context
|
|
150
|
-
* @returns First part: the id of the selection created after the import, 0 if no selection is created. Second part: The number of rows actually imported
|
|
151
|
-
*/
|
|
152
|
-
public async saveImportAsync(request: carriers.Import_SaveImportRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Do the actual import
|
|
156
|
-
* @param importLines - The rows that will be imported
|
|
157
|
-
* @param columnDefinition - An array of the columndefinitions, like firstname, lastname, ...
|
|
158
|
-
* @param createSelection - true if a selection of the imported entities shall be made
|
|
159
|
-
* @param culture - The current culture used in the import. Used to match language specific strings
|
|
160
|
-
* @param context - Optional context for the import.
|
|
161
|
-
* @returns First part: the id of the selection created after the import, 0 if no selection is created. Second part: The number of rows actually imported
|
|
162
|
-
*/
|
|
163
|
-
public async saveImportAsync(importLines: carriers.ImportLine[], columnDefinition: string[], createSelection: boolean, culture: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
|
|
164
|
-
|
|
165
|
-
public async saveImportAsync(importLines:carriers.ImportLine[]|carriers.Import_SaveImportRequest, columnDefinition?:string[]|base.WebApiRequestOptions, createSelection?:boolean, culture?:string, context?:string, webapi_options?:base.WebApiRequestOptions) : Promise< number[] > {
|
|
166
|
-
let _request : carriers.Import_SaveImportRequest = null;
|
|
167
|
-
let _options : base.WebApiRequestOptions = null;
|
|
168
|
-
const first : any = importLines;
|
|
169
|
-
if( typeof( first ) === "object" && first && ( typeof(first.importLines)!='undefined' || typeof(first.columnDefinition)!='undefined' || typeof(first.createSelection)!='undefined' || typeof(first.culture)!='undefined' || typeof(first.context)!='undefined' ) )
|
|
170
|
-
{
|
|
171
|
-
_request = importLines as carriers.Import_SaveImportRequest;
|
|
172
|
-
_options = columnDefinition as base.WebApiRequestOptions;
|
|
173
|
-
}
|
|
174
|
-
else
|
|
175
|
-
{
|
|
176
|
-
_request = {
|
|
177
|
-
importLines: importLines as carriers.ImportLine[],
|
|
178
|
-
columnDefinition: columnDefinition as string[],
|
|
179
|
-
createSelection: createSelection as boolean,
|
|
180
|
-
culture: culture as string,
|
|
181
|
-
context: context as string,
|
|
182
|
-
};
|
|
183
|
-
_options = webapi_options;
|
|
184
|
-
}
|
|
185
|
-
return this._saveImportAsync( _request, _options );
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
private async _createDefaultImportLineAsync(request: carriers.Import_CreateDefaultImportLineRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine > {
|
|
190
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
191
|
-
base.WebApiBase.SetPending(options);
|
|
192
|
-
return new Promise< carriers.ImportLine >(async (resolve, reject) => {
|
|
193
|
-
try {
|
|
194
|
-
config.baseURL = this._options.baseUrl;
|
|
195
|
-
const response = await this._axios.post("CreateDefaultImportLine", request , config);
|
|
196
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
197
|
-
const res : carriers.ImportLine = converters.Create_ImportLine_From( response.data );
|
|
198
|
-
resolve(res);
|
|
199
|
-
}
|
|
200
|
-
catch( err ) {
|
|
201
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
202
|
-
reject(err);
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Create a new empty import row with x count of values
|
|
211
|
-
* @param request - CountColumns
|
|
212
|
-
* @returns A new ImportLine
|
|
213
|
-
*/
|
|
214
|
-
public async createDefaultImportLineAsync(request: carriers.Import_CreateDefaultImportLineRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine >;
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Create a new empty import row with x count of values
|
|
218
|
-
* @param countColumns - The count of values that will can be filled out
|
|
219
|
-
* @returns A new ImportLine
|
|
220
|
-
*/
|
|
221
|
-
public async createDefaultImportLineAsync(countColumns: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine >;
|
|
222
|
-
|
|
223
|
-
public async createDefaultImportLineAsync(countColumns:number|carriers.Import_CreateDefaultImportLineRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine > {
|
|
224
|
-
let _request : carriers.Import_CreateDefaultImportLineRequest = null;
|
|
225
|
-
let _options : base.WebApiRequestOptions = null;
|
|
226
|
-
const first : any = countColumns;
|
|
227
|
-
if( typeof( first ) === "object" && first && ( typeof(first.countColumns)!='undefined' ) )
|
|
228
|
-
{
|
|
229
|
-
_request = countColumns as carriers.Import_CreateDefaultImportLineRequest;
|
|
230
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
231
|
-
}
|
|
232
|
-
else
|
|
233
|
-
{
|
|
234
|
-
_request = {
|
|
235
|
-
countColumns: countColumns as number,
|
|
236
|
-
};
|
|
237
|
-
_options = webapi_options;
|
|
238
|
-
}
|
|
239
|
-
return this._createDefaultImportLineAsync( _request, _options );
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
private async _createErpImportDataAsync(request: carriers.Import_CreateErpImportDataRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ImportErpData > {
|
|
244
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
245
|
-
base.WebApiBase.SetPending(options);
|
|
246
|
-
return new Promise< carriers.ImportErpData >(async (resolve, reject) => {
|
|
247
|
-
try {
|
|
248
|
-
config.baseURL = this._options.baseUrl;
|
|
249
|
-
const response = await this._axios.post("CreateErpImportData", request , config);
|
|
250
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
251
|
-
const res : carriers.ImportErpData = converters.Create_ImportErpData_From( response.data );
|
|
252
|
-
resolve(res);
|
|
253
|
-
}
|
|
254
|
-
catch( err ) {
|
|
255
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
256
|
-
reject(err);
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Populates the ImportLines and columnDefs basedfrom erp system
|
|
265
|
-
* @param request - Restriction, Columns, ConnectionId, ErpActorType
|
|
266
|
-
* @returns The ImportLines and ColumnDefs
|
|
267
|
-
*/
|
|
268
|
-
public async createErpImportDataAsync(request: carriers.Import_CreateErpImportDataRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportErpData >;
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Populates the ImportLines and columnDefs basedfrom erp system
|
|
272
|
-
* @param restriction - Archive restrictions.
|
|
273
|
-
* @param columns - Columns.
|
|
274
|
-
* @param connectionId - Connection id for Erp system
|
|
275
|
-
* @param erpActorType - Erp Actor type
|
|
276
|
-
* @returns The ImportLines and ColumnDefs
|
|
277
|
-
*/
|
|
278
|
-
public async createErpImportDataAsync(restriction: carriers.ArchiveRestrictionInfo[], columns: string[], connectionId: number, erpActorType: enums.ErpActorType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportErpData >;
|
|
279
|
-
|
|
280
|
-
public async createErpImportDataAsync(restriction:carriers.ArchiveRestrictionInfo[]|carriers.Import_CreateErpImportDataRequest, columns?:string[]|base.WebApiRequestOptions, connectionId?:number, erpActorType?:enums.ErpActorType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportErpData > {
|
|
281
|
-
let _request : carriers.Import_CreateErpImportDataRequest = null;
|
|
282
|
-
let _options : base.WebApiRequestOptions = null;
|
|
283
|
-
const first : any = restriction;
|
|
284
|
-
if( typeof( first ) === "object" && first && ( typeof(first.restriction)!='undefined' || typeof(first.columns)!='undefined' || typeof(first.connectionId)!='undefined' || typeof(first.erpActorType)!='undefined' ) )
|
|
285
|
-
{
|
|
286
|
-
_request = restriction as carriers.Import_CreateErpImportDataRequest;
|
|
287
|
-
_options = columns as base.WebApiRequestOptions;
|
|
288
|
-
}
|
|
289
|
-
else
|
|
290
|
-
{
|
|
291
|
-
_request = {
|
|
292
|
-
restriction: restriction as carriers.ArchiveRestrictionInfo[],
|
|
293
|
-
columns: columns as string[],
|
|
294
|
-
connectionId: connectionId as number,
|
|
295
|
-
erpActorType: erpActorType as enums.ErpActorType,
|
|
296
|
-
};
|
|
297
|
-
_options = webapi_options;
|
|
298
|
-
}
|
|
299
|
-
return this._createErpImportDataAsync( _request, _options );
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
} // class v1ImportAgentController
|
|
303
|
-
|
|
304
|
-
|
|
1
|
+
// <auto-generated>
|
|
2
|
+
// SuperOffice Code Generator
|
|
3
|
+
// modelling\templates\servicestswebapi\tswebapiagents.tt
|
|
4
|
+
// </auto-generated>
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/* tslint:disable */
|
|
8
|
+
//----------------------------------------------------------------------------
|
|
9
|
+
// G E N E R A T E D F I L E ! D O N O T E D I T !
|
|
10
|
+
//----------------------------------------------------------------------------
|
|
11
|
+
//
|
|
12
|
+
// File: WebApi/ImportAgent.ts
|
|
13
|
+
//
|
|
14
|
+
//----------------------------------------------------------------------------
|
|
15
|
+
// Copyright (C) SuperOffice AS
|
|
16
|
+
//----------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
import { AxiosRequestConfig } from 'axios';
|
|
19
|
+
import { Duration } from 'dayjs/plugin/duration';
|
|
20
|
+
import * as enums from './Enums';
|
|
21
|
+
import * as base from './WebApiBase';
|
|
22
|
+
import * as carriers from './Carriers';
|
|
23
|
+
import * as converters from './Converters';
|
|
24
|
+
import { FromBase64ToString, ToBase64 } from './Base64';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* This agent can be used to import data into the system
|
|
28
|
+
*/
|
|
29
|
+
export interface IImportAgent {
|
|
30
|
+
previewImportAsync(request: carriers.Import_PreviewImportRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine[] >;
|
|
31
|
+
previewImportAsync(importLines: carriers.ImportLine[], columnDefinition: string[], culture: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine[] >;
|
|
32
|
+
saveImportAsync(request: carriers.Import_SaveImportRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
|
|
33
|
+
saveImportAsync(importLines: carriers.ImportLine[], columnDefinition: string[], createSelection: boolean, culture: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
|
|
34
|
+
createDefaultImportLineAsync(request: carriers.Import_CreateDefaultImportLineRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine >;
|
|
35
|
+
createDefaultImportLineAsync(countColumns: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine >;
|
|
36
|
+
createErpImportDataAsync(request: carriers.Import_CreateErpImportDataRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportErpData >;
|
|
37
|
+
createErpImportDataAsync(restriction: carriers.ArchiveRestrictionInfo[], columns: string[], connectionId: number, erpActorType: enums.ErpActorType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportErpData >;
|
|
38
|
+
} // interface IImportAgent
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* This agent can be used to import data into the system
|
|
45
|
+
*/
|
|
46
|
+
export class ImportAgent extends base.WebApiBase implements IImportAgent {
|
|
47
|
+
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
48
|
+
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
49
|
+
constructor(baseUrl: string, resourceManager:any);
|
|
50
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
51
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
52
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
53
|
+
constructor(options: base.WebApiOptions);
|
|
54
|
+
|
|
55
|
+
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
56
|
+
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
57
|
+
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
58
|
+
cultureCode?: string,
|
|
59
|
+
) {
|
|
60
|
+
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
61
|
+
options.basePath = "v1/Agents/Import/";
|
|
62
|
+
super(options);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
private async _previewImportAsync(request: carriers.Import_PreviewImportRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine[] > {
|
|
68
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
69
|
+
base.WebApiBase.SetPending(options);
|
|
70
|
+
return new Promise< carriers.ImportLine[] >(async (resolve, reject) => {
|
|
71
|
+
try {
|
|
72
|
+
config.baseURL = this._options.baseUrl;
|
|
73
|
+
const response = await this._axios.post("PreviewImport", request , config);
|
|
74
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
75
|
+
const res : carriers.ImportLine[] = converters.Create_ImportLineArray_From( response.data );
|
|
76
|
+
resolve(res);
|
|
77
|
+
}
|
|
78
|
+
catch( err ) {
|
|
79
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
80
|
+
reject(err);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Preview the import
|
|
89
|
+
* @param request - ImportLines, ColumnDefinition, Culture, Context
|
|
90
|
+
* @returns An array of the the rows that can be imported, manipulated according to Import rules given
|
|
91
|
+
*/
|
|
92
|
+
public async previewImportAsync(request: carriers.Import_PreviewImportRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine[] >;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Preview the import
|
|
96
|
+
* @param importLines - The rows that will be manipulated and according to Import rules
|
|
97
|
+
* @param columnDefinition - An array of the columndefinitions, like firstname, lastname, ...
|
|
98
|
+
* @param culture - The current culture used in the import. Used to match language specific strings
|
|
99
|
+
* @param context - Optional context for the import.
|
|
100
|
+
* @returns An array of the the rows that can be imported, manipulated according to Import rules given
|
|
101
|
+
*/
|
|
102
|
+
public async previewImportAsync(importLines: carriers.ImportLine[], columnDefinition: string[], culture: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine[] >;
|
|
103
|
+
|
|
104
|
+
public async previewImportAsync(importLines:carriers.ImportLine[]|carriers.Import_PreviewImportRequest, columnDefinition?:string[]|base.WebApiRequestOptions, culture?:string, context?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine[] > {
|
|
105
|
+
let _request : carriers.Import_PreviewImportRequest = null;
|
|
106
|
+
let _options : base.WebApiRequestOptions = null;
|
|
107
|
+
const first : any = importLines;
|
|
108
|
+
if( typeof( first ) === "object" && first && ( typeof(first.importLines)!='undefined' || typeof(first.columnDefinition)!='undefined' || typeof(first.culture)!='undefined' || typeof(first.context)!='undefined' ) )
|
|
109
|
+
{
|
|
110
|
+
_request = importLines as carriers.Import_PreviewImportRequest;
|
|
111
|
+
_options = columnDefinition as base.WebApiRequestOptions;
|
|
112
|
+
}
|
|
113
|
+
else
|
|
114
|
+
{
|
|
115
|
+
_request = {
|
|
116
|
+
importLines: importLines as carriers.ImportLine[],
|
|
117
|
+
columnDefinition: columnDefinition as string[],
|
|
118
|
+
culture: culture as string,
|
|
119
|
+
context: context as string,
|
|
120
|
+
};
|
|
121
|
+
_options = webapi_options;
|
|
122
|
+
}
|
|
123
|
+
return this._previewImportAsync( _request, _options );
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
private async _saveImportAsync(request: carriers.Import_SaveImportRequest, options?:base.WebApiRequestOptions) : Promise< number[] > {
|
|
128
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
129
|
+
base.WebApiBase.SetPending(options);
|
|
130
|
+
return new Promise< number[] >(async (resolve, reject) => {
|
|
131
|
+
try {
|
|
132
|
+
config.baseURL = this._options.baseUrl;
|
|
133
|
+
const response = await this._axios.post("SaveImport", request , config);
|
|
134
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
135
|
+
const res : number[] = response.data as number[];
|
|
136
|
+
resolve(res);
|
|
137
|
+
}
|
|
138
|
+
catch( err ) {
|
|
139
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
140
|
+
reject(err);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Do the actual import
|
|
149
|
+
* @param request - ImportLines, ColumnDefinition, CreateSelection, Culture, Context
|
|
150
|
+
* @returns First part: the id of the selection created after the import, 0 if no selection is created. Second part: The number of rows actually imported
|
|
151
|
+
*/
|
|
152
|
+
public async saveImportAsync(request: carriers.Import_SaveImportRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Do the actual import
|
|
156
|
+
* @param importLines - The rows that will be imported
|
|
157
|
+
* @param columnDefinition - An array of the columndefinitions, like firstname, lastname, ...
|
|
158
|
+
* @param createSelection - true if a selection of the imported entities shall be made
|
|
159
|
+
* @param culture - The current culture used in the import. Used to match language specific strings
|
|
160
|
+
* @param context - Optional context for the import.
|
|
161
|
+
* @returns First part: the id of the selection created after the import, 0 if no selection is created. Second part: The number of rows actually imported
|
|
162
|
+
*/
|
|
163
|
+
public async saveImportAsync(importLines: carriers.ImportLine[], columnDefinition: string[], createSelection: boolean, culture: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
|
|
164
|
+
|
|
165
|
+
public async saveImportAsync(importLines:carriers.ImportLine[]|carriers.Import_SaveImportRequest, columnDefinition?:string[]|base.WebApiRequestOptions, createSelection?:boolean, culture?:string, context?:string, webapi_options?:base.WebApiRequestOptions) : Promise< number[] > {
|
|
166
|
+
let _request : carriers.Import_SaveImportRequest = null;
|
|
167
|
+
let _options : base.WebApiRequestOptions = null;
|
|
168
|
+
const first : any = importLines;
|
|
169
|
+
if( typeof( first ) === "object" && first && ( typeof(first.importLines)!='undefined' || typeof(first.columnDefinition)!='undefined' || typeof(first.createSelection)!='undefined' || typeof(first.culture)!='undefined' || typeof(first.context)!='undefined' ) )
|
|
170
|
+
{
|
|
171
|
+
_request = importLines as carriers.Import_SaveImportRequest;
|
|
172
|
+
_options = columnDefinition as base.WebApiRequestOptions;
|
|
173
|
+
}
|
|
174
|
+
else
|
|
175
|
+
{
|
|
176
|
+
_request = {
|
|
177
|
+
importLines: importLines as carriers.ImportLine[],
|
|
178
|
+
columnDefinition: columnDefinition as string[],
|
|
179
|
+
createSelection: createSelection as boolean,
|
|
180
|
+
culture: culture as string,
|
|
181
|
+
context: context as string,
|
|
182
|
+
};
|
|
183
|
+
_options = webapi_options;
|
|
184
|
+
}
|
|
185
|
+
return this._saveImportAsync( _request, _options );
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
private async _createDefaultImportLineAsync(request: carriers.Import_CreateDefaultImportLineRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine > {
|
|
190
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
191
|
+
base.WebApiBase.SetPending(options);
|
|
192
|
+
return new Promise< carriers.ImportLine >(async (resolve, reject) => {
|
|
193
|
+
try {
|
|
194
|
+
config.baseURL = this._options.baseUrl;
|
|
195
|
+
const response = await this._axios.post("CreateDefaultImportLine", request , config);
|
|
196
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
197
|
+
const res : carriers.ImportLine = converters.Create_ImportLine_From( response.data );
|
|
198
|
+
resolve(res);
|
|
199
|
+
}
|
|
200
|
+
catch( err ) {
|
|
201
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
202
|
+
reject(err);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Create a new empty import row with x count of values
|
|
211
|
+
* @param request - CountColumns
|
|
212
|
+
* @returns A new ImportLine
|
|
213
|
+
*/
|
|
214
|
+
public async createDefaultImportLineAsync(request: carriers.Import_CreateDefaultImportLineRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine >;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Create a new empty import row with x count of values
|
|
218
|
+
* @param countColumns - The count of values that will can be filled out
|
|
219
|
+
* @returns A new ImportLine
|
|
220
|
+
*/
|
|
221
|
+
public async createDefaultImportLineAsync(countColumns: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine >;
|
|
222
|
+
|
|
223
|
+
public async createDefaultImportLineAsync(countColumns:number|carriers.Import_CreateDefaultImportLineRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportLine > {
|
|
224
|
+
let _request : carriers.Import_CreateDefaultImportLineRequest = null;
|
|
225
|
+
let _options : base.WebApiRequestOptions = null;
|
|
226
|
+
const first : any = countColumns;
|
|
227
|
+
if( typeof( first ) === "object" && first && ( typeof(first.countColumns)!='undefined' ) )
|
|
228
|
+
{
|
|
229
|
+
_request = countColumns as carriers.Import_CreateDefaultImportLineRequest;
|
|
230
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
231
|
+
}
|
|
232
|
+
else
|
|
233
|
+
{
|
|
234
|
+
_request = {
|
|
235
|
+
countColumns: countColumns as number,
|
|
236
|
+
};
|
|
237
|
+
_options = webapi_options;
|
|
238
|
+
}
|
|
239
|
+
return this._createDefaultImportLineAsync( _request, _options );
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
private async _createErpImportDataAsync(request: carriers.Import_CreateErpImportDataRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ImportErpData > {
|
|
244
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
245
|
+
base.WebApiBase.SetPending(options);
|
|
246
|
+
return new Promise< carriers.ImportErpData >(async (resolve, reject) => {
|
|
247
|
+
try {
|
|
248
|
+
config.baseURL = this._options.baseUrl;
|
|
249
|
+
const response = await this._axios.post("CreateErpImportData", request , config);
|
|
250
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
251
|
+
const res : carriers.ImportErpData = converters.Create_ImportErpData_From( response.data );
|
|
252
|
+
resolve(res);
|
|
253
|
+
}
|
|
254
|
+
catch( err ) {
|
|
255
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
256
|
+
reject(err);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Populates the ImportLines and columnDefs basedfrom erp system
|
|
265
|
+
* @param request - Restriction, Columns, ConnectionId, ErpActorType
|
|
266
|
+
* @returns The ImportLines and ColumnDefs
|
|
267
|
+
*/
|
|
268
|
+
public async createErpImportDataAsync(request: carriers.Import_CreateErpImportDataRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportErpData >;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Populates the ImportLines and columnDefs basedfrom erp system
|
|
272
|
+
* @param restriction - Archive restrictions.
|
|
273
|
+
* @param columns - Columns.
|
|
274
|
+
* @param connectionId - Connection id for Erp system
|
|
275
|
+
* @param erpActorType - Erp Actor type
|
|
276
|
+
* @returns The ImportLines and ColumnDefs
|
|
277
|
+
*/
|
|
278
|
+
public async createErpImportDataAsync(restriction: carriers.ArchiveRestrictionInfo[], columns: string[], connectionId: number, erpActorType: enums.ErpActorType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportErpData >;
|
|
279
|
+
|
|
280
|
+
public async createErpImportDataAsync(restriction:carriers.ArchiveRestrictionInfo[]|carriers.Import_CreateErpImportDataRequest, columns?:string[]|base.WebApiRequestOptions, connectionId?:number, erpActorType?:enums.ErpActorType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ImportErpData > {
|
|
281
|
+
let _request : carriers.Import_CreateErpImportDataRequest = null;
|
|
282
|
+
let _options : base.WebApiRequestOptions = null;
|
|
283
|
+
const first : any = restriction;
|
|
284
|
+
if( typeof( first ) === "object" && first && ( typeof(first.restriction)!='undefined' || typeof(first.columns)!='undefined' || typeof(first.connectionId)!='undefined' || typeof(first.erpActorType)!='undefined' ) )
|
|
285
|
+
{
|
|
286
|
+
_request = restriction as carriers.Import_CreateErpImportDataRequest;
|
|
287
|
+
_options = columns as base.WebApiRequestOptions;
|
|
288
|
+
}
|
|
289
|
+
else
|
|
290
|
+
{
|
|
291
|
+
_request = {
|
|
292
|
+
restriction: restriction as carriers.ArchiveRestrictionInfo[],
|
|
293
|
+
columns: columns as string[],
|
|
294
|
+
connectionId: connectionId as number,
|
|
295
|
+
erpActorType: erpActorType as enums.ErpActorType,
|
|
296
|
+
};
|
|
297
|
+
_options = webapi_options;
|
|
298
|
+
}
|
|
299
|
+
return this._createErpImportDataAsync( _request, _options );
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
} // class v1ImportAgentController
|
|
303
|
+
|
|
304
|
+
|