@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.
- 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/Carriers.d.ts +367 -4
- package/dist/cjs/Carriers.d.ts.map +1 -1
- package/dist/cjs/Converters.d.ts +9 -0
- package/dist/cjs/Converters.d.ts.map +1 -1
- package/dist/cjs/Converters.js +185 -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 +18 -0
- package/dist/cjs/Enums.d.ts.map +1 -1
- package/dist/cjs/Enums.js +20 -1
- 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/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/Carriers.d.ts +367 -4
- package/dist/esm/Carriers.d.ts.map +1 -1
- package/dist/esm/Converters.d.ts +9 -0
- package/dist/esm/Converters.d.ts.map +1 -1
- package/dist/esm/Converters.js +159 -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 +18 -0
- package/dist/esm/Enums.d.ts.map +1 -1
- package/dist/esm/Enums.js +19 -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/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 +1992 -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 +52750 -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 +23271 -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 +6936 -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 +890 -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/BulkUpdateAgent.ts
CHANGED
|
@@ -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
|
+
|