@superoffice/webapi 11.7.727 → 11.8.788

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.
Files changed (147) hide show
  1. package/LICENSE.md +15 -15
  2. package/README.md +184 -184
  3. package/__tests__/Appointment63-notz.json +1925 -1925
  4. package/__tests__/Appointment63-utctz.json +1925 -1925
  5. package/__tests__/Appointment63.json +1925 -1925
  6. package/__tests__/AppointmentTzTest.ts +115 -115
  7. package/__tests__/AxiosNockTest.ts +28 -28
  8. package/__tests__/ContactDefault.json +699 -699
  9. package/__tests__/ContactEntity.json +272 -272
  10. package/__tests__/ContactRestTest.ts +144 -144
  11. package/__tests__/ContactTest.ts +395 -395
  12. package/__tests__/ConvertersTest.ts +97 -97
  13. package/__tests__/DocumentTest.ts +101 -101
  14. package/__tests__/Person210-notz.json +1932 -1932
  15. package/__tests__/Person210-utctz.json +1932 -1932
  16. package/__tests__/Person210.json +1932 -1932
  17. package/__tests__/PersonImageData.nock +22 -22
  18. package/__tests__/PersonTest.ts +41 -41
  19. package/__tests__/PersonTzTest.ts +113 -113
  20. package/__tests__/RecurrenceInfo.json +55 -55
  21. package/__tests__/ResponseCallbackTest.ts +23 -23
  22. package/__tests__/TableRights.json +441 -441
  23. package/__tests__/WebapiTest.ts +264 -264
  24. package/__tests__/Webhook.json +16 -16
  25. package/__tests__/WebhookTest.ts +209 -209
  26. package/dist/cjs/Carriers.d.ts +367 -4
  27. package/dist/cjs/Carriers.d.ts.map +1 -1
  28. package/dist/cjs/Converters.d.ts +9 -0
  29. package/dist/cjs/Converters.d.ts.map +1 -1
  30. package/dist/cjs/Converters.js +185 -17
  31. package/dist/cjs/Converters.js.map +1 -1
  32. package/dist/cjs/DiagnosticsAgent.d.ts +38 -0
  33. package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
  34. package/dist/cjs/DiagnosticsAgent.js +91 -0
  35. package/dist/cjs/DiagnosticsAgent.js.map +1 -1
  36. package/dist/cjs/Enums.d.ts +18 -0
  37. package/dist/cjs/Enums.d.ts.map +1 -1
  38. package/dist/cjs/Enums.js +20 -1
  39. package/dist/cjs/Enums.js.map +1 -1
  40. package/dist/cjs/ListAgent.d.ts +71 -6
  41. package/dist/cjs/ListAgent.d.ts.map +1 -1
  42. package/dist/cjs/ListAgent.js +157 -0
  43. package/dist/cjs/ListAgent.js.map +1 -1
  44. package/dist/cjs/TicketAgent.d.ts +23 -0
  45. package/dist/cjs/TicketAgent.d.ts.map +1 -1
  46. package/dist/cjs/TicketAgent.js +65 -0
  47. package/dist/cjs/TicketAgent.js.map +1 -1
  48. package/dist/esm/Carriers.d.ts +367 -4
  49. package/dist/esm/Carriers.d.ts.map +1 -1
  50. package/dist/esm/Converters.d.ts +9 -0
  51. package/dist/esm/Converters.d.ts.map +1 -1
  52. package/dist/esm/Converters.js +159 -0
  53. package/dist/esm/Converters.js.map +1 -1
  54. package/dist/esm/DiagnosticsAgent.d.ts +38 -0
  55. package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
  56. package/dist/esm/DiagnosticsAgent.js +91 -0
  57. package/dist/esm/DiagnosticsAgent.js.map +1 -1
  58. package/dist/esm/Enums.d.ts +18 -0
  59. package/dist/esm/Enums.d.ts.map +1 -1
  60. package/dist/esm/Enums.js +19 -0
  61. package/dist/esm/Enums.js.map +1 -1
  62. package/dist/esm/ListAgent.d.ts +71 -6
  63. package/dist/esm/ListAgent.d.ts.map +1 -1
  64. package/dist/esm/ListAgent.js +157 -0
  65. package/dist/esm/ListAgent.js.map +1 -1
  66. package/dist/esm/TicketAgent.d.ts +23 -0
  67. package/dist/esm/TicketAgent.d.ts.map +1 -1
  68. package/dist/esm/TicketAgent.js +65 -0
  69. package/dist/esm/TicketAgent.js.map +1 -1
  70. package/examples-js/hello.js +12 -12
  71. package/examples-ts/hello.ts +8 -8
  72. package/package.json +93 -93
  73. package/scripts/postbuild.js +22 -22
  74. package/scripts/setVersion.js +44 -44
  75. package/src/AIAgent.ts +1992 -1992
  76. package/src/AppointmentAgent.ts +6263 -6263
  77. package/src/AppointmentRestApi.ts +225 -225
  78. package/src/ArchiveAgent.ts +1950 -1950
  79. package/src/AssociateAgent.ts +422 -422
  80. package/src/AxiosCacheHandler.ts +74 -74
  81. package/src/BLOBAgent.ts +2100 -2100
  82. package/src/Base64.ts +285 -285
  83. package/src/BatchAgent.ts +910 -910
  84. package/src/BulkUpdateAgent.ts +504 -504
  85. package/src/CRMScriptAgent.ts +1390 -1390
  86. package/src/Carriers.ts +52750 -52274
  87. package/src/ChatAgent.ts +1422 -1422
  88. package/src/ConfigurationAgent.ts +2228 -2228
  89. package/src/ContactAgent.ts +1756 -1756
  90. package/src/ContactRestApi.ts +237 -237
  91. package/src/Converters.ts +23271 -23090
  92. package/src/CustomerServiceAgent.ts +1799 -1799
  93. package/src/DashAgent.ts +1674 -1674
  94. package/src/DatabaseAgent.ts +120 -120
  95. package/src/DatabaseTableAgent.ts +534 -534
  96. package/src/Day_js.ts +41 -41
  97. package/src/DiagnosticsAgent.ts +1384 -1240
  98. package/src/DocumentAgent.ts +5079 -5079
  99. package/src/DocumentMigrationAgent.ts +524 -524
  100. package/src/DocumentRestApi.ts +259 -259
  101. package/src/EMailAgent.ts +5328 -5328
  102. package/src/Enums.ts +6936 -6916
  103. package/src/ErpSyncAgent.ts +2658 -2658
  104. package/src/FavouriteAgent.ts +720 -720
  105. package/src/FindAgent.ts +2330 -2330
  106. package/src/ForeignSystemAgent.ts +1710 -1710
  107. package/src/FreeTextAgent.ts +372 -372
  108. package/src/ImportAgent.ts +304 -304
  109. package/src/LicenseAgent.ts +1230 -1230
  110. package/src/ListAgent.ts +11451 -11237
  111. package/src/MDOAgent.ts +748 -748
  112. package/src/MarketingAgent.ts +890 -890
  113. package/src/MessagingAgent.ts +384 -384
  114. package/src/NavigatorAgent.ts +140 -140
  115. package/src/NumberAllocationAgent.ts +296 -296
  116. package/src/PersonAgent.ts +3287 -3287
  117. package/src/PersonRestApi.ts +241 -241
  118. package/src/PhoneListAgent.ts +458 -458
  119. package/src/PocketAgent.ts +780 -780
  120. package/src/PreferenceAgent.ts +1900 -1900
  121. package/src/PreviewsAgent.ts +116 -116
  122. package/src/ProjectAgent.ts +2391 -2391
  123. package/src/ProjectRestApi.ts +239 -239
  124. package/src/QuoteAgent.ts +5159 -5159
  125. package/src/RelationAgent.ts +220 -220
  126. package/src/ReportAgent.ts +154 -154
  127. package/src/ResourceAgent.ts +358 -358
  128. package/src/SaintAgent.ts +601 -601
  129. package/src/SaleAgent.ts +2034 -2034
  130. package/src/SaleRestApi.ts +233 -233
  131. package/src/SelectionAgent.ts +3195 -3195
  132. package/src/SentryAgent.ts +462 -462
  133. package/src/SoApiConstants.ts +8 -8
  134. package/src/TargetsAgent.ts +1104 -1104
  135. package/src/TicketAgent.ts +3708 -3638
  136. package/src/TimeZoneAgent.ts +528 -528
  137. package/src/TooltipsAgent.ts +116 -116
  138. package/src/UserAgent.ts +4856 -4856
  139. package/src/UserDefinedFieldInfoAgent.ts +1764 -1764
  140. package/src/ViewStateAgent.ts +858 -858
  141. package/src/WebApi.ts +872 -872
  142. package/src/WebApiBase.ts +565 -565
  143. package/src/WebhookAgent.ts +388 -388
  144. package/src/WorkflowAgent.ts +1338 -1338
  145. package/tsconfig.esm.json +8 -8
  146. package/tsconfig.jest.json +8 -8
  147. package/tsconfig.json +34 -34
@@ -1,504 +1,504 @@
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/BulkUpdateAgent.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
- * Agent used for bulk update methods
28
- */
29
- export interface IBulkUpdateAgent {
30
- getAvailableFieldsAsync(request: carriers.BulkUpdate_GetAvailableFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
31
- getAvailableFieldsAsync(tablename: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
32
- getStoredFieldsAsync(request: carriers.BulkUpdate_GetStoredFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
33
- getStoredFieldsAsync(tablename: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
34
- executeBySelectionIdAsync(request: carriers.BulkUpdate_ExecuteBySelectionIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
35
- executeBySelectionIdAsync(fieldValueInfos: carriers.FieldValueInfo[], tableName: string, context: string, selectionId: number, isShadow: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
36
- executeByEntityIdsAsync(request: carriers.BulkUpdate_ExecuteByEntityIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
37
- executeByEntityIdsAsync(fieldValueInfos: carriers.FieldValueInfo[], tableName: string, context: string, ids: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
38
- getJobResultsFromStorageAsJsonAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
39
- removeStoredFieldsAsync(request: carriers.BulkUpdate_RemoveStoredFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
40
- removeStoredFieldsAsync(tableName: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
41
- removeStoredFieldsAndGetDefaultFieldsAsync(request: carriers.BulkUpdate_RemoveStoredFieldsAndGetDefaultFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
42
- removeStoredFieldsAndGetDefaultFieldsAsync(tableName: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
43
- getJobResultAsJsonFromBinaryObjectIdAsync(request: carriers.BulkUpdate_GetJobResultAsJsonFromBinaryObjectIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
44
- getJobResultAsJsonFromBinaryObjectIdAsync(tableName: string, binaryObjectId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
45
- } // interface IBulkUpdateAgent
46
-
47
-
48
-
49
-
50
- /**
51
- * Agent used for bulk update methods
52
- */
53
- export class BulkUpdateAgent extends base.WebApiBase implements IBulkUpdateAgent {
54
- constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
55
- constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
56
- constructor(baseUrl: string, resourceManager:any);
57
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
58
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
59
- constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
60
- constructor(options: base.WebApiOptions);
61
-
62
- constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
63
- langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
64
- langOrResourceOrRM?:string|base.ResourceParsing|any,
65
- cultureCode?: string,
66
- ) {
67
- const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
68
- options.basePath = "v1/Agents/BulkUpdate/";
69
- super(options);
70
- }
71
-
72
-
73
-
74
- private async _getAvailableFieldsAsync(request: carriers.BulkUpdate_GetAvailableFieldsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] > {
75
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
76
- base.WebApiBase.SetPending(options);
77
- return new Promise< carriers.FieldValueInfo[] >(async (resolve, reject) => {
78
- try {
79
- config.baseURL = this._options.baseUrl;
80
- const response = await this._axios.post("GetAvailableFields", request , config);
81
- base.WebApiBase.SetCompleted(options, response);
82
- const res : carriers.FieldValueInfo[] = converters.Create_FieldValueInfoArray_From( response.data );
83
- resolve(res);
84
- }
85
- catch( err ) {
86
- base.WebApiBase.HandleError(options, config, err);
87
- reject(err);
88
- }
89
- });
90
- }
91
-
92
-
93
-
94
- /**
95
- * Get all available fields for a given tablename/entity
96
- * @param request - Tablename
97
- * @returns Returns array of the available fields for the given entity
98
- */
99
- public async getAvailableFieldsAsync(request: carriers.BulkUpdate_GetAvailableFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
100
-
101
- /**
102
- * Get all available fields for a given tablename/entity
103
- * @param tablename - The name of the wanted tablename
104
- * @returns Returns array of the available fields for the given entity
105
- */
106
- public async getAvailableFieldsAsync(tablename: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
107
-
108
- public async getAvailableFieldsAsync(tablename:string|carriers.BulkUpdate_GetAvailableFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] > {
109
- let _request : carriers.BulkUpdate_GetAvailableFieldsRequest = null;
110
- let _options : base.WebApiRequestOptions = null;
111
- const first : any = tablename;
112
- if( typeof( first ) === "object" && first && ( typeof(first.tablename)!='undefined' ) )
113
- {
114
- _request = tablename as carriers.BulkUpdate_GetAvailableFieldsRequest;
115
- _options = webapi_options as base.WebApiRequestOptions;
116
- }
117
- else
118
- {
119
- _request = {
120
- tablename: tablename as string,
121
- };
122
- _options = webapi_options;
123
- }
124
- return this._getAvailableFieldsAsync( _request, _options );
125
- }
126
-
127
-
128
- private async _getStoredFieldsAsync(request: carriers.BulkUpdate_GetStoredFieldsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] > {
129
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
130
- base.WebApiBase.SetPending(options);
131
- return new Promise< carriers.FieldValueInfo[] >(async (resolve, reject) => {
132
- try {
133
- config.baseURL = this._options.baseUrl;
134
- const response = await this._axios.post("GetStoredFields", request , config);
135
- base.WebApiBase.SetCompleted(options, response);
136
- const res : carriers.FieldValueInfo[] = converters.Create_FieldValueInfoArray_From( response.data );
137
- resolve(res);
138
- }
139
- catch( err ) {
140
- base.WebApiBase.HandleError(options, config, err);
141
- reject(err);
142
- }
143
- });
144
- }
145
-
146
-
147
-
148
- /**
149
- * Get all stored fields for a given tablename/entity and context
150
- * @param request - Tablename, Context
151
- * @returns Returns array of the stored or default fields for the given entity
152
- */
153
- public async getStoredFieldsAsync(request: carriers.BulkUpdate_GetStoredFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
154
-
155
- /**
156
- * Get all stored fields for a given tablename/entity and context
157
- * @param tablename - The name of the wanted tablename
158
- * @param context - Where is the function called for
159
- * @returns Returns array of the stored or default fields for the given entity
160
- */
161
- public async getStoredFieldsAsync(tablename: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
162
-
163
- public async getStoredFieldsAsync(tablename:string|carriers.BulkUpdate_GetStoredFieldsRequest, context?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] > {
164
- let _request : carriers.BulkUpdate_GetStoredFieldsRequest = null;
165
- let _options : base.WebApiRequestOptions = null;
166
- const first : any = tablename;
167
- if( typeof( first ) === "object" && first && ( typeof(first.tablename)!='undefined' || typeof(first.context)!='undefined' ) )
168
- {
169
- _request = tablename as carriers.BulkUpdate_GetStoredFieldsRequest;
170
- _options = context as base.WebApiRequestOptions;
171
- }
172
- else
173
- {
174
- _request = {
175
- tablename: tablename as string,
176
- context: context as string,
177
- };
178
- _options = webapi_options;
179
- }
180
- return this._getStoredFieldsAsync( _request, _options );
181
- }
182
-
183
-
184
- private async _executeBySelectionIdAsync(request: carriers.BulkUpdate_ExecuteBySelectionIdRequest, options?:base.WebApiRequestOptions) : Promise< number > {
185
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
186
- base.WebApiBase.SetPending(options);
187
- return new Promise< number >(async (resolve, reject) => {
188
- try {
189
- config.baseURL = this._options.baseUrl;
190
- const response = await this._axios.post("ExecuteBySelectionId", request , config);
191
- base.WebApiBase.SetCompleted(options, response);
192
- const res : number = response.data as number;
193
- resolve(res);
194
- }
195
- catch( err ) {
196
- base.WebApiBase.HandleError(options, config, err);
197
- reject(err);
198
- }
199
- });
200
- }
201
-
202
-
203
-
204
- /**
205
- * Do the batchupdate on this selection
206
- * @param request - FieldValueInfos, TableName, Context, SelectionId, IsShadow
207
- * @returns Return batchtaskinfoid
208
- */
209
- public async executeBySelectionIdAsync(request: carriers.BulkUpdate_ExecuteBySelectionIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
210
-
211
- /**
212
- * Do the batchupdate on this selection
213
- * @param fieldValueInfos - The name of the wanted tablename
214
- * @param tableName - The name of the table to bulk update
215
- * @param context - Where is the function called for
216
- * @param selectionId - The id of the selection
217
- * @param isShadow - Use the shadow selection
218
- * @returns Return batchtaskinfoid
219
- */
220
- public async executeBySelectionIdAsync(fieldValueInfos: carriers.FieldValueInfo[], tableName: string, context: string, selectionId: number, isShadow: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
221
-
222
- public async executeBySelectionIdAsync(fieldValueInfos:carriers.FieldValueInfo[]|carriers.BulkUpdate_ExecuteBySelectionIdRequest, tableName?:string|base.WebApiRequestOptions, context?:string, selectionId?:number, isShadow?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
223
- let _request : carriers.BulkUpdate_ExecuteBySelectionIdRequest = null;
224
- let _options : base.WebApiRequestOptions = null;
225
- const first : any = fieldValueInfos;
226
- if( typeof( first ) === "object" && first && ( typeof(first.fieldValueInfos)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.context)!='undefined' || typeof(first.selectionId)!='undefined' || typeof(first.isShadow)!='undefined' ) )
227
- {
228
- _request = fieldValueInfos as carriers.BulkUpdate_ExecuteBySelectionIdRequest;
229
- _options = tableName as base.WebApiRequestOptions;
230
- }
231
- else
232
- {
233
- _request = {
234
- fieldValueInfos: fieldValueInfos as carriers.FieldValueInfo[],
235
- tableName: tableName as string,
236
- context: context as string,
237
- selectionId: selectionId as number,
238
- isShadow: isShadow as boolean,
239
- };
240
- _options = webapi_options;
241
- }
242
- return this._executeBySelectionIdAsync( _request, _options );
243
- }
244
-
245
-
246
- private async _executeByEntityIdsAsync(request: carriers.BulkUpdate_ExecuteByEntityIdsRequest, options?:base.WebApiRequestOptions) : Promise< number > {
247
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
248
- base.WebApiBase.SetPending(options);
249
- return new Promise< number >(async (resolve, reject) => {
250
- try {
251
- config.baseURL = this._options.baseUrl;
252
- const response = await this._axios.post("ExecuteByEntityIds", request , config);
253
- base.WebApiBase.SetCompleted(options, response);
254
- const res : number = response.data as number;
255
- resolve(res);
256
- }
257
- catch( err ) {
258
- base.WebApiBase.HandleError(options, config, err);
259
- reject(err);
260
- }
261
- });
262
- }
263
-
264
-
265
-
266
- /**
267
- * Do the batchupdate on selected
268
- * @param request - FieldValueInfos, TableName, Context, Ids
269
- * @returns Return batchtaskinfoid
270
- */
271
- public async executeByEntityIdsAsync(request: carriers.BulkUpdate_ExecuteByEntityIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
272
-
273
- /**
274
- * Do the batchupdate on selected
275
- * @param fieldValueInfos - The name of the wanted tablename
276
- * @param tableName - The name of the table to bulk update
277
- * @param context - Where is the function called from
278
- * @param ids - Comma separated string of the ids of the entities to update
279
- * @returns Return batchtaskinfoid
280
- */
281
- public async executeByEntityIdsAsync(fieldValueInfos: carriers.FieldValueInfo[], tableName: string, context: string, ids: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
282
-
283
- public async executeByEntityIdsAsync(fieldValueInfos:carriers.FieldValueInfo[]|carriers.BulkUpdate_ExecuteByEntityIdsRequest, tableName?:string|base.WebApiRequestOptions, context?:string, ids?:string, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
284
- let _request : carriers.BulkUpdate_ExecuteByEntityIdsRequest = null;
285
- let _options : base.WebApiRequestOptions = null;
286
- const first : any = fieldValueInfos;
287
- if( typeof( first ) === "object" && first && ( typeof(first.fieldValueInfos)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.context)!='undefined' || typeof(first.ids)!='undefined' ) )
288
- {
289
- _request = fieldValueInfos as carriers.BulkUpdate_ExecuteByEntityIdsRequest;
290
- _options = tableName as base.WebApiRequestOptions;
291
- }
292
- else
293
- {
294
- _request = {
295
- fieldValueInfos: fieldValueInfos as carriers.FieldValueInfo[],
296
- tableName: tableName as string,
297
- context: context as string,
298
- ids: ids as string,
299
- };
300
- _options = webapi_options;
301
- }
302
- return this._executeByEntityIdsAsync( _request, _options );
303
- }
304
-
305
-
306
- private async _getJobResultsFromStorageAsJsonAsync( options?:base.WebApiRequestOptions) : Promise< string[] > {
307
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
308
- base.WebApiBase.SetPending(options);
309
- return new Promise< string[] >(async (resolve, reject) => {
310
- try {
311
- config.baseURL = this._options.baseUrl;
312
- const response = await this._axios.post("GetJobResultsFromStorageAsJson", undefined , config);
313
- base.WebApiBase.SetCompleted(options, response);
314
- const res : string[] = response.data as string[];
315
- resolve(res);
316
- }
317
- catch( err ) {
318
- base.WebApiBase.HandleError(options, config, err);
319
- reject(err);
320
- }
321
- });
322
- }
323
-
324
-
325
- /**
326
- * Get result of the batchupdate job
327
- * @returns Result of job as json
328
- */
329
- public async getJobResultsFromStorageAsJsonAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >
330
- {
331
- return this._getJobResultsFromStorageAsJsonAsync(webapi_options);
332
- }
333
-
334
-
335
- private async _removeStoredFieldsAsync(request: carriers.BulkUpdate_RemoveStoredFieldsRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
336
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
337
- base.WebApiBase.SetPending(options);
338
- return new Promise< boolean >(async (resolve, reject) => {
339
- try {
340
- config.baseURL = this._options.baseUrl;
341
- const response = await this._axios.post("RemoveStoredFields", request , config);
342
- base.WebApiBase.SetCompleted(options, response);
343
- const res : boolean = response.data as boolean;
344
- resolve(res);
345
- }
346
- catch( err ) {
347
- base.WebApiBase.HandleError(options, config, err);
348
- reject(err);
349
- }
350
- });
351
- }
352
-
353
-
354
-
355
- /**
356
- * Remove the stored settings of the bulk update for this table from this context
357
- * @param request - TableName, Context
358
- * @returns
359
- */
360
- public async removeStoredFieldsAsync(request: carriers.BulkUpdate_RemoveStoredFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
361
-
362
- /**
363
- * Remove the stored settings of the bulk update for this table from this context
364
- * @param tableName - The name of the table to remove stored settings from
365
- * @param context - Where is the function called from that we will remove the settings from
366
- * @returns
367
- */
368
- public async removeStoredFieldsAsync(tableName: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
369
-
370
- public async removeStoredFieldsAsync(tableName:string|carriers.BulkUpdate_RemoveStoredFieldsRequest, context?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
371
- let _request : carriers.BulkUpdate_RemoveStoredFieldsRequest = null;
372
- let _options : base.WebApiRequestOptions = null;
373
- const first : any = tableName;
374
- if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' || typeof(first.context)!='undefined' ) )
375
- {
376
- _request = tableName as carriers.BulkUpdate_RemoveStoredFieldsRequest;
377
- _options = context as base.WebApiRequestOptions;
378
- }
379
- else
380
- {
381
- _request = {
382
- tableName: tableName as string,
383
- context: context as string,
384
- };
385
- _options = webapi_options;
386
- }
387
- return this._removeStoredFieldsAsync( _request, _options );
388
- }
389
-
390
-
391
- private async _removeStoredFieldsAndGetDefaultFieldsAsync(request: carriers.BulkUpdate_RemoveStoredFieldsAndGetDefaultFieldsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] > {
392
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
393
- base.WebApiBase.SetPending(options);
394
- return new Promise< carriers.FieldValueInfo[] >(async (resolve, reject) => {
395
- try {
396
- config.baseURL = this._options.baseUrl;
397
- const response = await this._axios.post("RemoveStoredFieldsAndGetDefaultFields", request , config);
398
- base.WebApiBase.SetCompleted(options, response);
399
- const res : carriers.FieldValueInfo[] = converters.Create_FieldValueInfoArray_From( response.data );
400
- resolve(res);
401
- }
402
- catch( err ) {
403
- base.WebApiBase.HandleError(options, config, err);
404
- reject(err);
405
- }
406
- });
407
- }
408
-
409
-
410
-
411
- /**
412
- * Remove the stored settings of the bulk update for this table from this context, to get the default settings instead
413
- * @param request - TableName, Context
414
- * @returns Returns array of the available fields for the given tablename
415
- */
416
- public async removeStoredFieldsAndGetDefaultFieldsAsync(request: carriers.BulkUpdate_RemoveStoredFieldsAndGetDefaultFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
417
-
418
- /**
419
- * Remove the stored settings of the bulk update for this table from this context, to get the default settings instead
420
- * @param tableName - The name of the table to remove stored settings from
421
- * @param context - Where is the function called from that we will remove the settings from
422
- * @returns Returns array of the available fields for the given tablename
423
- */
424
- public async removeStoredFieldsAndGetDefaultFieldsAsync(tableName: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
425
-
426
- public async removeStoredFieldsAndGetDefaultFieldsAsync(tableName:string|carriers.BulkUpdate_RemoveStoredFieldsAndGetDefaultFieldsRequest, context?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] > {
427
- let _request : carriers.BulkUpdate_RemoveStoredFieldsAndGetDefaultFieldsRequest = null;
428
- let _options : base.WebApiRequestOptions = null;
429
- const first : any = tableName;
430
- if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' || typeof(first.context)!='undefined' ) )
431
- {
432
- _request = tableName as carriers.BulkUpdate_RemoveStoredFieldsAndGetDefaultFieldsRequest;
433
- _options = context as base.WebApiRequestOptions;
434
- }
435
- else
436
- {
437
- _request = {
438
- tableName: tableName as string,
439
- context: context as string,
440
- };
441
- _options = webapi_options;
442
- }
443
- return this._removeStoredFieldsAndGetDefaultFieldsAsync( _request, _options );
444
- }
445
-
446
-
447
- private async _getJobResultAsJsonFromBinaryObjectIdAsync(request: carriers.BulkUpdate_GetJobResultAsJsonFromBinaryObjectIdRequest, options?:base.WebApiRequestOptions) : Promise< string > {
448
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
449
- base.WebApiBase.SetPending(options);
450
- return new Promise< string >(async (resolve, reject) => {
451
- try {
452
- config.baseURL = this._options.baseUrl;
453
- const response = await this._axios.post("GetJobResultAsJsonFromBinaryObjectId", request , config);
454
- base.WebApiBase.SetCompleted(options, response);
455
- const res : string = response.data as string;
456
- resolve(res);
457
- }
458
- catch( err ) {
459
- base.WebApiBase.HandleError(options, config, err);
460
- reject(err);
461
- }
462
- });
463
- }
464
-
465
-
466
-
467
- /**
468
- * Get result of the batchupdate job
469
- * @param request - TableName, BinaryObjectId
470
- * @returns Result of job as json
471
- */
472
- public async getJobResultAsJsonFromBinaryObjectIdAsync(request: carriers.BulkUpdate_GetJobResultAsJsonFromBinaryObjectIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
473
-
474
- /**
475
- * Get result of the batchupdate job
476
- * @param tableName - The name of the table that was updated to show the log from
477
- * @param binaryObjectId - Which binaryobject id has stored the job result
478
- * @returns Result of job as json
479
- */
480
- public async getJobResultAsJsonFromBinaryObjectIdAsync(tableName: string, binaryObjectId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
481
-
482
- public async getJobResultAsJsonFromBinaryObjectIdAsync(tableName:string|carriers.BulkUpdate_GetJobResultAsJsonFromBinaryObjectIdRequest, binaryObjectId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
483
- let _request : carriers.BulkUpdate_GetJobResultAsJsonFromBinaryObjectIdRequest = null;
484
- let _options : base.WebApiRequestOptions = null;
485
- const first : any = tableName;
486
- if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' || typeof(first.binaryObjectId)!='undefined' ) )
487
- {
488
- _request = tableName as carriers.BulkUpdate_GetJobResultAsJsonFromBinaryObjectIdRequest;
489
- _options = binaryObjectId as base.WebApiRequestOptions;
490
- }
491
- else
492
- {
493
- _request = {
494
- tableName: tableName as string,
495
- binaryObjectId: binaryObjectId as number,
496
- };
497
- _options = webapi_options;
498
- }
499
- return this._getJobResultAsJsonFromBinaryObjectIdAsync( _request, _options );
500
- }
501
-
502
- } // class v1BulkUpdateAgentController
503
-
504
-
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/BulkUpdateAgent.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
+ * Agent used for bulk update methods
28
+ */
29
+ export interface IBulkUpdateAgent {
30
+ getAvailableFieldsAsync(request: carriers.BulkUpdate_GetAvailableFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
31
+ getAvailableFieldsAsync(tablename: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
32
+ getStoredFieldsAsync(request: carriers.BulkUpdate_GetStoredFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
33
+ getStoredFieldsAsync(tablename: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
34
+ executeBySelectionIdAsync(request: carriers.BulkUpdate_ExecuteBySelectionIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
35
+ executeBySelectionIdAsync(fieldValueInfos: carriers.FieldValueInfo[], tableName: string, context: string, selectionId: number, isShadow: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
36
+ executeByEntityIdsAsync(request: carriers.BulkUpdate_ExecuteByEntityIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
37
+ executeByEntityIdsAsync(fieldValueInfos: carriers.FieldValueInfo[], tableName: string, context: string, ids: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
38
+ getJobResultsFromStorageAsJsonAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
39
+ removeStoredFieldsAsync(request: carriers.BulkUpdate_RemoveStoredFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
40
+ removeStoredFieldsAsync(tableName: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
41
+ removeStoredFieldsAndGetDefaultFieldsAsync(request: carriers.BulkUpdate_RemoveStoredFieldsAndGetDefaultFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
42
+ removeStoredFieldsAndGetDefaultFieldsAsync(tableName: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
43
+ getJobResultAsJsonFromBinaryObjectIdAsync(request: carriers.BulkUpdate_GetJobResultAsJsonFromBinaryObjectIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
44
+ getJobResultAsJsonFromBinaryObjectIdAsync(tableName: string, binaryObjectId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
45
+ } // interface IBulkUpdateAgent
46
+
47
+
48
+
49
+
50
+ /**
51
+ * Agent used for bulk update methods
52
+ */
53
+ export class BulkUpdateAgent extends base.WebApiBase implements IBulkUpdateAgent {
54
+ constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
55
+ constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
56
+ constructor(baseUrl: string, resourceManager:any);
57
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
58
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
59
+ constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
60
+ constructor(options: base.WebApiOptions);
61
+
62
+ constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
63
+ langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
64
+ langOrResourceOrRM?:string|base.ResourceParsing|any,
65
+ cultureCode?: string,
66
+ ) {
67
+ const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
68
+ options.basePath = "v1/Agents/BulkUpdate/";
69
+ super(options);
70
+ }
71
+
72
+
73
+
74
+ private async _getAvailableFieldsAsync(request: carriers.BulkUpdate_GetAvailableFieldsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] > {
75
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
76
+ base.WebApiBase.SetPending(options);
77
+ return new Promise< carriers.FieldValueInfo[] >(async (resolve, reject) => {
78
+ try {
79
+ config.baseURL = this._options.baseUrl;
80
+ const response = await this._axios.post("GetAvailableFields", request , config);
81
+ base.WebApiBase.SetCompleted(options, response);
82
+ const res : carriers.FieldValueInfo[] = converters.Create_FieldValueInfoArray_From( response.data );
83
+ resolve(res);
84
+ }
85
+ catch( err ) {
86
+ base.WebApiBase.HandleError(options, config, err);
87
+ reject(err);
88
+ }
89
+ });
90
+ }
91
+
92
+
93
+
94
+ /**
95
+ * Get all available fields for a given tablename/entity
96
+ * @param request - Tablename
97
+ * @returns Returns array of the available fields for the given entity
98
+ */
99
+ public async getAvailableFieldsAsync(request: carriers.BulkUpdate_GetAvailableFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
100
+
101
+ /**
102
+ * Get all available fields for a given tablename/entity
103
+ * @param tablename - The name of the wanted tablename
104
+ * @returns Returns array of the available fields for the given entity
105
+ */
106
+ public async getAvailableFieldsAsync(tablename: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
107
+
108
+ public async getAvailableFieldsAsync(tablename:string|carriers.BulkUpdate_GetAvailableFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] > {
109
+ let _request : carriers.BulkUpdate_GetAvailableFieldsRequest = null;
110
+ let _options : base.WebApiRequestOptions = null;
111
+ const first : any = tablename;
112
+ if( typeof( first ) === "object" && first && ( typeof(first.tablename)!='undefined' ) )
113
+ {
114
+ _request = tablename as carriers.BulkUpdate_GetAvailableFieldsRequest;
115
+ _options = webapi_options as base.WebApiRequestOptions;
116
+ }
117
+ else
118
+ {
119
+ _request = {
120
+ tablename: tablename as string,
121
+ };
122
+ _options = webapi_options;
123
+ }
124
+ return this._getAvailableFieldsAsync( _request, _options );
125
+ }
126
+
127
+
128
+ private async _getStoredFieldsAsync(request: carriers.BulkUpdate_GetStoredFieldsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] > {
129
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
130
+ base.WebApiBase.SetPending(options);
131
+ return new Promise< carriers.FieldValueInfo[] >(async (resolve, reject) => {
132
+ try {
133
+ config.baseURL = this._options.baseUrl;
134
+ const response = await this._axios.post("GetStoredFields", request , config);
135
+ base.WebApiBase.SetCompleted(options, response);
136
+ const res : carriers.FieldValueInfo[] = converters.Create_FieldValueInfoArray_From( response.data );
137
+ resolve(res);
138
+ }
139
+ catch( err ) {
140
+ base.WebApiBase.HandleError(options, config, err);
141
+ reject(err);
142
+ }
143
+ });
144
+ }
145
+
146
+
147
+
148
+ /**
149
+ * Get all stored fields for a given tablename/entity and context
150
+ * @param request - Tablename, Context
151
+ * @returns Returns array of the stored or default fields for the given entity
152
+ */
153
+ public async getStoredFieldsAsync(request: carriers.BulkUpdate_GetStoredFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
154
+
155
+ /**
156
+ * Get all stored fields for a given tablename/entity and context
157
+ * @param tablename - The name of the wanted tablename
158
+ * @param context - Where is the function called for
159
+ * @returns Returns array of the stored or default fields for the given entity
160
+ */
161
+ public async getStoredFieldsAsync(tablename: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
162
+
163
+ public async getStoredFieldsAsync(tablename:string|carriers.BulkUpdate_GetStoredFieldsRequest, context?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] > {
164
+ let _request : carriers.BulkUpdate_GetStoredFieldsRequest = null;
165
+ let _options : base.WebApiRequestOptions = null;
166
+ const first : any = tablename;
167
+ if( typeof( first ) === "object" && first && ( typeof(first.tablename)!='undefined' || typeof(first.context)!='undefined' ) )
168
+ {
169
+ _request = tablename as carriers.BulkUpdate_GetStoredFieldsRequest;
170
+ _options = context as base.WebApiRequestOptions;
171
+ }
172
+ else
173
+ {
174
+ _request = {
175
+ tablename: tablename as string,
176
+ context: context as string,
177
+ };
178
+ _options = webapi_options;
179
+ }
180
+ return this._getStoredFieldsAsync( _request, _options );
181
+ }
182
+
183
+
184
+ private async _executeBySelectionIdAsync(request: carriers.BulkUpdate_ExecuteBySelectionIdRequest, options?:base.WebApiRequestOptions) : Promise< number > {
185
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
186
+ base.WebApiBase.SetPending(options);
187
+ return new Promise< number >(async (resolve, reject) => {
188
+ try {
189
+ config.baseURL = this._options.baseUrl;
190
+ const response = await this._axios.post("ExecuteBySelectionId", request , config);
191
+ base.WebApiBase.SetCompleted(options, response);
192
+ const res : number = response.data as number;
193
+ resolve(res);
194
+ }
195
+ catch( err ) {
196
+ base.WebApiBase.HandleError(options, config, err);
197
+ reject(err);
198
+ }
199
+ });
200
+ }
201
+
202
+
203
+
204
+ /**
205
+ * Do the batchupdate on this selection
206
+ * @param request - FieldValueInfos, TableName, Context, SelectionId, IsShadow
207
+ * @returns Return batchtaskinfoid
208
+ */
209
+ public async executeBySelectionIdAsync(request: carriers.BulkUpdate_ExecuteBySelectionIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
210
+
211
+ /**
212
+ * Do the batchupdate on this selection
213
+ * @param fieldValueInfos - The name of the wanted tablename
214
+ * @param tableName - The name of the table to bulk update
215
+ * @param context - Where is the function called for
216
+ * @param selectionId - The id of the selection
217
+ * @param isShadow - Use the shadow selection
218
+ * @returns Return batchtaskinfoid
219
+ */
220
+ public async executeBySelectionIdAsync(fieldValueInfos: carriers.FieldValueInfo[], tableName: string, context: string, selectionId: number, isShadow: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
221
+
222
+ public async executeBySelectionIdAsync(fieldValueInfos:carriers.FieldValueInfo[]|carriers.BulkUpdate_ExecuteBySelectionIdRequest, tableName?:string|base.WebApiRequestOptions, context?:string, selectionId?:number, isShadow?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
223
+ let _request : carriers.BulkUpdate_ExecuteBySelectionIdRequest = null;
224
+ let _options : base.WebApiRequestOptions = null;
225
+ const first : any = fieldValueInfos;
226
+ if( typeof( first ) === "object" && first && ( typeof(first.fieldValueInfos)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.context)!='undefined' || typeof(first.selectionId)!='undefined' || typeof(first.isShadow)!='undefined' ) )
227
+ {
228
+ _request = fieldValueInfos as carriers.BulkUpdate_ExecuteBySelectionIdRequest;
229
+ _options = tableName as base.WebApiRequestOptions;
230
+ }
231
+ else
232
+ {
233
+ _request = {
234
+ fieldValueInfos: fieldValueInfos as carriers.FieldValueInfo[],
235
+ tableName: tableName as string,
236
+ context: context as string,
237
+ selectionId: selectionId as number,
238
+ isShadow: isShadow as boolean,
239
+ };
240
+ _options = webapi_options;
241
+ }
242
+ return this._executeBySelectionIdAsync( _request, _options );
243
+ }
244
+
245
+
246
+ private async _executeByEntityIdsAsync(request: carriers.BulkUpdate_ExecuteByEntityIdsRequest, options?:base.WebApiRequestOptions) : Promise< number > {
247
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
248
+ base.WebApiBase.SetPending(options);
249
+ return new Promise< number >(async (resolve, reject) => {
250
+ try {
251
+ config.baseURL = this._options.baseUrl;
252
+ const response = await this._axios.post("ExecuteByEntityIds", request , config);
253
+ base.WebApiBase.SetCompleted(options, response);
254
+ const res : number = response.data as number;
255
+ resolve(res);
256
+ }
257
+ catch( err ) {
258
+ base.WebApiBase.HandleError(options, config, err);
259
+ reject(err);
260
+ }
261
+ });
262
+ }
263
+
264
+
265
+
266
+ /**
267
+ * Do the batchupdate on selected
268
+ * @param request - FieldValueInfos, TableName, Context, Ids
269
+ * @returns Return batchtaskinfoid
270
+ */
271
+ public async executeByEntityIdsAsync(request: carriers.BulkUpdate_ExecuteByEntityIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
272
+
273
+ /**
274
+ * Do the batchupdate on selected
275
+ * @param fieldValueInfos - The name of the wanted tablename
276
+ * @param tableName - The name of the table to bulk update
277
+ * @param context - Where is the function called from
278
+ * @param ids - Comma separated string of the ids of the entities to update
279
+ * @returns Return batchtaskinfoid
280
+ */
281
+ public async executeByEntityIdsAsync(fieldValueInfos: carriers.FieldValueInfo[], tableName: string, context: string, ids: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
282
+
283
+ public async executeByEntityIdsAsync(fieldValueInfos:carriers.FieldValueInfo[]|carriers.BulkUpdate_ExecuteByEntityIdsRequest, tableName?:string|base.WebApiRequestOptions, context?:string, ids?:string, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
284
+ let _request : carriers.BulkUpdate_ExecuteByEntityIdsRequest = null;
285
+ let _options : base.WebApiRequestOptions = null;
286
+ const first : any = fieldValueInfos;
287
+ if( typeof( first ) === "object" && first && ( typeof(first.fieldValueInfos)!='undefined' || typeof(first.tableName)!='undefined' || typeof(first.context)!='undefined' || typeof(first.ids)!='undefined' ) )
288
+ {
289
+ _request = fieldValueInfos as carriers.BulkUpdate_ExecuteByEntityIdsRequest;
290
+ _options = tableName as base.WebApiRequestOptions;
291
+ }
292
+ else
293
+ {
294
+ _request = {
295
+ fieldValueInfos: fieldValueInfos as carriers.FieldValueInfo[],
296
+ tableName: tableName as string,
297
+ context: context as string,
298
+ ids: ids as string,
299
+ };
300
+ _options = webapi_options;
301
+ }
302
+ return this._executeByEntityIdsAsync( _request, _options );
303
+ }
304
+
305
+
306
+ private async _getJobResultsFromStorageAsJsonAsync( options?:base.WebApiRequestOptions) : Promise< string[] > {
307
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
308
+ base.WebApiBase.SetPending(options);
309
+ return new Promise< string[] >(async (resolve, reject) => {
310
+ try {
311
+ config.baseURL = this._options.baseUrl;
312
+ const response = await this._axios.post("GetJobResultsFromStorageAsJson", undefined , config);
313
+ base.WebApiBase.SetCompleted(options, response);
314
+ const res : string[] = response.data as string[];
315
+ resolve(res);
316
+ }
317
+ catch( err ) {
318
+ base.WebApiBase.HandleError(options, config, err);
319
+ reject(err);
320
+ }
321
+ });
322
+ }
323
+
324
+
325
+ /**
326
+ * Get result of the batchupdate job
327
+ * @returns Result of job as json
328
+ */
329
+ public async getJobResultsFromStorageAsJsonAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >
330
+ {
331
+ return this._getJobResultsFromStorageAsJsonAsync(webapi_options);
332
+ }
333
+
334
+
335
+ private async _removeStoredFieldsAsync(request: carriers.BulkUpdate_RemoveStoredFieldsRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
336
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
337
+ base.WebApiBase.SetPending(options);
338
+ return new Promise< boolean >(async (resolve, reject) => {
339
+ try {
340
+ config.baseURL = this._options.baseUrl;
341
+ const response = await this._axios.post("RemoveStoredFields", request , config);
342
+ base.WebApiBase.SetCompleted(options, response);
343
+ const res : boolean = response.data as boolean;
344
+ resolve(res);
345
+ }
346
+ catch( err ) {
347
+ base.WebApiBase.HandleError(options, config, err);
348
+ reject(err);
349
+ }
350
+ });
351
+ }
352
+
353
+
354
+
355
+ /**
356
+ * Remove the stored settings of the bulk update for this table from this context
357
+ * @param request - TableName, Context
358
+ * @returns
359
+ */
360
+ public async removeStoredFieldsAsync(request: carriers.BulkUpdate_RemoveStoredFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
361
+
362
+ /**
363
+ * Remove the stored settings of the bulk update for this table from this context
364
+ * @param tableName - The name of the table to remove stored settings from
365
+ * @param context - Where is the function called from that we will remove the settings from
366
+ * @returns
367
+ */
368
+ public async removeStoredFieldsAsync(tableName: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
369
+
370
+ public async removeStoredFieldsAsync(tableName:string|carriers.BulkUpdate_RemoveStoredFieldsRequest, context?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
371
+ let _request : carriers.BulkUpdate_RemoveStoredFieldsRequest = null;
372
+ let _options : base.WebApiRequestOptions = null;
373
+ const first : any = tableName;
374
+ if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' || typeof(first.context)!='undefined' ) )
375
+ {
376
+ _request = tableName as carriers.BulkUpdate_RemoveStoredFieldsRequest;
377
+ _options = context as base.WebApiRequestOptions;
378
+ }
379
+ else
380
+ {
381
+ _request = {
382
+ tableName: tableName as string,
383
+ context: context as string,
384
+ };
385
+ _options = webapi_options;
386
+ }
387
+ return this._removeStoredFieldsAsync( _request, _options );
388
+ }
389
+
390
+
391
+ private async _removeStoredFieldsAndGetDefaultFieldsAsync(request: carriers.BulkUpdate_RemoveStoredFieldsAndGetDefaultFieldsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] > {
392
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
393
+ base.WebApiBase.SetPending(options);
394
+ return new Promise< carriers.FieldValueInfo[] >(async (resolve, reject) => {
395
+ try {
396
+ config.baseURL = this._options.baseUrl;
397
+ const response = await this._axios.post("RemoveStoredFieldsAndGetDefaultFields", request , config);
398
+ base.WebApiBase.SetCompleted(options, response);
399
+ const res : carriers.FieldValueInfo[] = converters.Create_FieldValueInfoArray_From( response.data );
400
+ resolve(res);
401
+ }
402
+ catch( err ) {
403
+ base.WebApiBase.HandleError(options, config, err);
404
+ reject(err);
405
+ }
406
+ });
407
+ }
408
+
409
+
410
+
411
+ /**
412
+ * Remove the stored settings of the bulk update for this table from this context, to get the default settings instead
413
+ * @param request - TableName, Context
414
+ * @returns Returns array of the available fields for the given tablename
415
+ */
416
+ public async removeStoredFieldsAndGetDefaultFieldsAsync(request: carriers.BulkUpdate_RemoveStoredFieldsAndGetDefaultFieldsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
417
+
418
+ /**
419
+ * Remove the stored settings of the bulk update for this table from this context, to get the default settings instead
420
+ * @param tableName - The name of the table to remove stored settings from
421
+ * @param context - Where is the function called from that we will remove the settings from
422
+ * @returns Returns array of the available fields for the given tablename
423
+ */
424
+ public async removeStoredFieldsAndGetDefaultFieldsAsync(tableName: string, context: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] >;
425
+
426
+ public async removeStoredFieldsAndGetDefaultFieldsAsync(tableName:string|carriers.BulkUpdate_RemoveStoredFieldsAndGetDefaultFieldsRequest, context?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FieldValueInfo[] > {
427
+ let _request : carriers.BulkUpdate_RemoveStoredFieldsAndGetDefaultFieldsRequest = null;
428
+ let _options : base.WebApiRequestOptions = null;
429
+ const first : any = tableName;
430
+ if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' || typeof(first.context)!='undefined' ) )
431
+ {
432
+ _request = tableName as carriers.BulkUpdate_RemoveStoredFieldsAndGetDefaultFieldsRequest;
433
+ _options = context as base.WebApiRequestOptions;
434
+ }
435
+ else
436
+ {
437
+ _request = {
438
+ tableName: tableName as string,
439
+ context: context as string,
440
+ };
441
+ _options = webapi_options;
442
+ }
443
+ return this._removeStoredFieldsAndGetDefaultFieldsAsync( _request, _options );
444
+ }
445
+
446
+
447
+ private async _getJobResultAsJsonFromBinaryObjectIdAsync(request: carriers.BulkUpdate_GetJobResultAsJsonFromBinaryObjectIdRequest, options?:base.WebApiRequestOptions) : Promise< string > {
448
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
449
+ base.WebApiBase.SetPending(options);
450
+ return new Promise< string >(async (resolve, reject) => {
451
+ try {
452
+ config.baseURL = this._options.baseUrl;
453
+ const response = await this._axios.post("GetJobResultAsJsonFromBinaryObjectId", request , config);
454
+ base.WebApiBase.SetCompleted(options, response);
455
+ const res : string = response.data as string;
456
+ resolve(res);
457
+ }
458
+ catch( err ) {
459
+ base.WebApiBase.HandleError(options, config, err);
460
+ reject(err);
461
+ }
462
+ });
463
+ }
464
+
465
+
466
+
467
+ /**
468
+ * Get result of the batchupdate job
469
+ * @param request - TableName, BinaryObjectId
470
+ * @returns Result of job as json
471
+ */
472
+ public async getJobResultAsJsonFromBinaryObjectIdAsync(request: carriers.BulkUpdate_GetJobResultAsJsonFromBinaryObjectIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
473
+
474
+ /**
475
+ * Get result of the batchupdate job
476
+ * @param tableName - The name of the table that was updated to show the log from
477
+ * @param binaryObjectId - Which binaryobject id has stored the job result
478
+ * @returns Result of job as json
479
+ */
480
+ public async getJobResultAsJsonFromBinaryObjectIdAsync(tableName: string, binaryObjectId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
481
+
482
+ public async getJobResultAsJsonFromBinaryObjectIdAsync(tableName:string|carriers.BulkUpdate_GetJobResultAsJsonFromBinaryObjectIdRequest, binaryObjectId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
483
+ let _request : carriers.BulkUpdate_GetJobResultAsJsonFromBinaryObjectIdRequest = null;
484
+ let _options : base.WebApiRequestOptions = null;
485
+ const first : any = tableName;
486
+ if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' || typeof(first.binaryObjectId)!='undefined' ) )
487
+ {
488
+ _request = tableName as carriers.BulkUpdate_GetJobResultAsJsonFromBinaryObjectIdRequest;
489
+ _options = binaryObjectId as base.WebApiRequestOptions;
490
+ }
491
+ else
492
+ {
493
+ _request = {
494
+ tableName: tableName as string,
495
+ binaryObjectId: binaryObjectId as number,
496
+ };
497
+ _options = webapi_options;
498
+ }
499
+ return this._getJobResultAsJsonFromBinaryObjectIdAsync( _request, _options );
500
+ }
501
+
502
+ } // class v1BulkUpdateAgentController
503
+
504
+