@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
package/src/MDOAgent.ts CHANGED
@@ -1,748 +1,748 @@
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/MDOAgent.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
- * MDO Lists, reading, searching, and item lookup.
28
- */
29
- export interface IMDOAgent {
30
- getListAsync(request: carriers.MDO_GetListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
31
- getListAsync(name: string, forceFlatList: boolean, additionalInfo: string, onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
32
- getListWithHistoryAsync(request: carriers.MDO_GetListWithHistoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
33
- getListWithHistoryAsync(name: string, forceFlatList: boolean, additionalInfo: string, historyItems: number[], onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
34
- getListWithRestrictionAsync(request: carriers.MDO_GetListWithRestrictionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
35
- getListWithRestrictionAsync(name: string, additionalInfo: string, searchValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
36
- getSimpleListAsync(request: carriers.MDO_GetSimpleListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
37
- getSimpleListAsync(name: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
38
- getListItemAsync(request: carriers.MDO_GetListItemRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem >;
39
- getListItemAsync(listName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem >;
40
- getListNamesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
41
- getListIdByListNameAsync(request: carriers.MDO_GetListIdByListNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
42
- getListIdByListNameAsync(name: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
43
- getSelectableSimpleListAsync(request: carriers.MDO_GetSelectableSimpleListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
44
- getSelectableSimpleListAsync(name: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
45
- getSelectableListWithRestrictionAsync(request: carriers.MDO_GetSelectableListWithRestrictionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
46
- getSelectableListWithRestrictionAsync(name: string, additionalInfo: string, searchValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
47
- getSelectableListWithHistoryAsync(request: carriers.MDO_GetSelectableListWithHistoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
48
- getSelectableListWithHistoryAsync(name: string, forceFlatList: boolean, additionalInfo: string, historyItems: number[], onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
49
- getSelectableListAsync(request: carriers.MDO_GetSelectableListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
50
- getSelectableListAsync(name: string, forceFlatList: boolean, additionalInfo: string, onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
51
- setSelectedAsync(request: carriers.MDO_SetSelectedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
52
- setSelectedAsync(name: string, additionalInfo: string, selectableMDOList: carriers.SelectableMDOListItem[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
53
- } // interface IMDOAgent
54
-
55
-
56
-
57
-
58
- /**
59
- * MDO Lists, reading, searching, and item lookup.
60
- */
61
- export class MDOAgent extends base.WebApiBase implements IMDOAgent {
62
- constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
63
- constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
64
- constructor(baseUrl: string, resourceManager:any);
65
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
66
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
67
- constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
68
- constructor(options: base.WebApiOptions);
69
-
70
- constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
71
- langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
72
- langOrResourceOrRM?:string|base.ResourceParsing|any,
73
- cultureCode?: string,
74
- ) {
75
- const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
76
- options.basePath = "v1/Agents/MDO/";
77
- super(options);
78
- }
79
-
80
-
81
-
82
- private async _getListAsync(request: carriers.MDO_GetListRequest, options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
83
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
84
- base.WebApiBase.SetPending(options);
85
- return new Promise< carriers.MDOListItem[] >(async (resolve, reject) => {
86
- try {
87
- config.baseURL = this._options.baseUrl;
88
- const response = await this._axios.post("GetList", request , config);
89
- base.WebApiBase.SetCompleted(options, response);
90
- const res : carriers.MDOListItem[] = converters.Create_MDOListItemArray_From( response.data );
91
- resolve(res);
92
- }
93
- catch( err ) {
94
- base.WebApiBase.HandleError(options, config, err);
95
- reject(err);
96
- }
97
- });
98
- }
99
-
100
-
101
-
102
- /**
103
- * Method to get a MDO list.
104
- * @param request - Name, ForceFlatList, AdditionalInfo, OnlyHistory
105
- * @returns Array of MDOListItem
106
- */
107
- public async getListAsync(request: carriers.MDO_GetListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
108
-
109
- /**
110
- * Method to get a MDO list.
111
- * @param name - Conceptual name of the MDO list-
112
- * @param forceFlatList - Force the list to be flat
113
- * @param additionalInfo - Additional info to the MDO provider
114
- * @param onlyHistory - If true, return only history items
115
- * @returns Array of MDOListItem
116
- */
117
- public async getListAsync(name: string, forceFlatList: boolean, additionalInfo: string, onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
118
-
119
- public async getListAsync(name:string|carriers.MDO_GetListRequest, forceFlatList?:boolean|base.WebApiRequestOptions, additionalInfo?:string, onlyHistory?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
120
- let _request : carriers.MDO_GetListRequest = null;
121
- let _options : base.WebApiRequestOptions = null;
122
- const first : any = name;
123
- if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.forceFlatList)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.onlyHistory)!='undefined' ) )
124
- {
125
- _request = name as carriers.MDO_GetListRequest;
126
- _options = forceFlatList as base.WebApiRequestOptions;
127
- }
128
- else
129
- {
130
- _request = {
131
- name: name as string,
132
- forceFlatList: forceFlatList as boolean,
133
- additionalInfo: additionalInfo as string,
134
- onlyHistory: onlyHistory as boolean,
135
- };
136
- _options = webapi_options;
137
- }
138
- return this._getListAsync( _request, _options );
139
- }
140
-
141
-
142
- private async _getListWithHistoryAsync(request: carriers.MDO_GetListWithHistoryRequest, options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
143
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
144
- base.WebApiBase.SetPending(options);
145
- return new Promise< carriers.MDOListItem[] >(async (resolve, reject) => {
146
- try {
147
- config.baseURL = this._options.baseUrl;
148
- const response = await this._axios.post("GetListWithHistory", request , config);
149
- base.WebApiBase.SetCompleted(options, response);
150
- const res : carriers.MDOListItem[] = converters.Create_MDOListItemArray_From( response.data );
151
- resolve(res);
152
- }
153
- catch( err ) {
154
- base.WebApiBase.HandleError(options, config, err);
155
- reject(err);
156
- }
157
- });
158
- }
159
-
160
-
161
-
162
- /**
163
- * Method to get a MDO list with own history list.
164
- * @param request - Name, ForceFlatList, AdditionalInfo, HistoryItems, OnlyHistory
165
- * @returns Array of MDOListItem
166
- */
167
- public async getListWithHistoryAsync(request: carriers.MDO_GetListWithHistoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
168
-
169
- /**
170
- * Method to get a MDO list with own history list.
171
- * @param name - Conceptual name of the MDO list-
172
- * @param forceFlatList - Force the list to be flat
173
- * @param additionalInfo - Additional info to the MDO provider
174
- * @param historyItems - An array of ids, used to get the history list
175
- * @param onlyHistory - If true, return only history items
176
- * @returns Array of MDOListItem
177
- */
178
- public async getListWithHistoryAsync(name: string, forceFlatList: boolean, additionalInfo: string, historyItems: number[], onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
179
-
180
- public async getListWithHistoryAsync(name:string|carriers.MDO_GetListWithHistoryRequest, forceFlatList?:boolean|base.WebApiRequestOptions, additionalInfo?:string, historyItems?:number[], onlyHistory?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
181
- let _request : carriers.MDO_GetListWithHistoryRequest = null;
182
- let _options : base.WebApiRequestOptions = null;
183
- const first : any = name;
184
- if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.forceFlatList)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.historyItems)!='undefined' || typeof(first.onlyHistory)!='undefined' ) )
185
- {
186
- _request = name as carriers.MDO_GetListWithHistoryRequest;
187
- _options = forceFlatList as base.WebApiRequestOptions;
188
- }
189
- else
190
- {
191
- _request = {
192
- name: name as string,
193
- forceFlatList: forceFlatList as boolean,
194
- additionalInfo: additionalInfo as string,
195
- historyItems: historyItems as number[],
196
- onlyHistory: onlyHistory as boolean,
197
- };
198
- _options = webapi_options;
199
- }
200
- return this._getListWithHistoryAsync( _request, _options );
201
- }
202
-
203
-
204
- private async _getListWithRestrictionAsync(request: carriers.MDO_GetListWithRestrictionRequest, options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
205
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
206
- base.WebApiBase.SetPending(options);
207
- return new Promise< carriers.MDOListItem[] >(async (resolve, reject) => {
208
- try {
209
- config.baseURL = this._options.baseUrl;
210
- const response = await this._axios.post("GetListWithRestriction", request , config);
211
- base.WebApiBase.SetCompleted(options, response);
212
- const res : carriers.MDOListItem[] = converters.Create_MDOListItemArray_From( response.data );
213
- resolve(res);
214
- }
215
- catch( err ) {
216
- base.WebApiBase.HandleError(options, config, err);
217
- reject(err);
218
- }
219
- });
220
- }
221
-
222
-
223
-
224
- /**
225
- * Method to get a MDO list with restrictions.
226
- * @param request - Name, AdditionalInfo, SearchValue
227
- * @returns Array of MDOListItem
228
- */
229
- public async getListWithRestrictionAsync(request: carriers.MDO_GetListWithRestrictionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
230
-
231
- /**
232
- * Method to get a MDO list with restrictions.
233
- * @param name - Conceptual name of the MDO list-
234
- * @param additionalInfo - Additional info to the MDO provider
235
- * @param searchValue - the value used to restrict the list
236
- * @returns Array of MDOListItem
237
- */
238
- public async getListWithRestrictionAsync(name: string, additionalInfo: string, searchValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
239
-
240
- public async getListWithRestrictionAsync(name:string|carriers.MDO_GetListWithRestrictionRequest, additionalInfo?:string|base.WebApiRequestOptions, searchValue?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
241
- let _request : carriers.MDO_GetListWithRestrictionRequest = null;
242
- let _options : base.WebApiRequestOptions = null;
243
- const first : any = name;
244
- if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.searchValue)!='undefined' ) )
245
- {
246
- _request = name as carriers.MDO_GetListWithRestrictionRequest;
247
- _options = additionalInfo as base.WebApiRequestOptions;
248
- }
249
- else
250
- {
251
- _request = {
252
- name: name as string,
253
- additionalInfo: additionalInfo as string,
254
- searchValue: searchValue as string,
255
- };
256
- _options = webapi_options;
257
- }
258
- return this._getListWithRestrictionAsync( _request, _options );
259
- }
260
-
261
-
262
- private async _getSimpleListAsync(request: carriers.MDO_GetSimpleListRequest, options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
263
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
264
- base.WebApiBase.SetPending(options);
265
- return new Promise< carriers.MDOListItem[] >(async (resolve, reject) => {
266
- try {
267
- config.baseURL = this._options.baseUrl;
268
- const response = await this._axios.post("GetSimpleList", request , config);
269
- base.WebApiBase.SetCompleted(options, response);
270
- const res : carriers.MDOListItem[] = converters.Create_MDOListItemArray_From( response.data );
271
- resolve(res);
272
- }
273
- catch( err ) {
274
- base.WebApiBase.HandleError(options, config, err);
275
- reject(err);
276
- }
277
- });
278
- }
279
-
280
-
281
-
282
- /**
283
- * Method returns a simple flat MDO List.
284
- * @param request - Name
285
- * @returns Array of MDOListItem
286
- */
287
- public async getSimpleListAsync(request: carriers.MDO_GetSimpleListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
288
-
289
- /**
290
- * Method returns a simple flat MDO List.
291
- * @param name - Conceptual name of the MDO list.
292
- * @returns Array of MDOListItem
293
- */
294
- public async getSimpleListAsync(name: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
295
-
296
- public async getSimpleListAsync(name:string|carriers.MDO_GetSimpleListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
297
- let _request : carriers.MDO_GetSimpleListRequest = null;
298
- let _options : base.WebApiRequestOptions = null;
299
- const first : any = name;
300
- if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' ) )
301
- {
302
- _request = name as carriers.MDO_GetSimpleListRequest;
303
- _options = webapi_options as base.WebApiRequestOptions;
304
- }
305
- else
306
- {
307
- _request = {
308
- name: name as string,
309
- };
310
- _options = webapi_options;
311
- }
312
- return this._getSimpleListAsync( _request, _options );
313
- }
314
-
315
-
316
- private async _getListItemAsync(request: carriers.MDO_GetListItemRequest, options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem > {
317
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
318
- base.WebApiBase.SetPending(options);
319
- return new Promise< carriers.MDOListItem >(async (resolve, reject) => {
320
- try {
321
- config.baseURL = this._options.baseUrl;
322
- const response = await this._axios.post("GetListItem", request , config);
323
- base.WebApiBase.SetCompleted(options, response);
324
- const res : carriers.MDOListItem = converters.Create_MDOListItem_From( response.data );
325
- resolve(res);
326
- }
327
- catch( err ) {
328
- base.WebApiBase.HandleError(options, config, err);
329
- reject(err);
330
- }
331
- });
332
- }
333
-
334
-
335
-
336
- /**
337
- * Returns a single list item
338
- * @param request - ListName, Id
339
- * @returns Single MDO list item
340
- */
341
- public async getListItemAsync(request: carriers.MDO_GetListItemRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem >;
342
-
343
- /**
344
- * Returns a single list item
345
- * @param listName - Conceptual name of the MDO list
346
- * @param id - Id of list item
347
- * @returns Single MDO list item
348
- */
349
- public async getListItemAsync(listName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem >;
350
-
351
- public async getListItemAsync(listName:string|carriers.MDO_GetListItemRequest, id?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem > {
352
- let _request : carriers.MDO_GetListItemRequest = null;
353
- let _options : base.WebApiRequestOptions = null;
354
- const first : any = listName;
355
- if( typeof( first ) === "object" && first && ( typeof(first.listName)!='undefined' || typeof(first.id)!='undefined' ) )
356
- {
357
- _request = listName as carriers.MDO_GetListItemRequest;
358
- _options = id as base.WebApiRequestOptions;
359
- }
360
- else
361
- {
362
- _request = {
363
- listName: listName as string,
364
- id: id as number,
365
- };
366
- _options = webapi_options;
367
- }
368
- return this._getListItemAsync( _request, _options );
369
- }
370
-
371
-
372
- private async _getListNamesAsync( options?:base.WebApiRequestOptions) : Promise< string[] > {
373
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
374
- base.WebApiBase.SetPending(options);
375
- return new Promise< string[] >(async (resolve, reject) => {
376
- try {
377
- config.baseURL = this._options.baseUrl;
378
- const response = await this._axios.post("GetListNames", undefined , config);
379
- base.WebApiBase.SetCompleted(options, response);
380
- const res : string[] = response.data as string[];
381
- resolve(res);
382
- }
383
- catch( err ) {
384
- base.WebApiBase.HandleError(options, config, err);
385
- reject(err);
386
- }
387
- });
388
- }
389
-
390
-
391
- /**
392
- * Returns a list of all MDO List names. These names can also be used with the Archive agent as ProviderNames.
393
- * @returns Array of list names.
394
- */
395
- public async getListNamesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >
396
- {
397
- return this._getListNamesAsync(webapi_options);
398
- }
399
-
400
-
401
- private async _getListIdByListNameAsync(request: carriers.MDO_GetListIdByListNameRequest, options?:base.WebApiRequestOptions) : Promise< number > {
402
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
403
- base.WebApiBase.SetPending(options);
404
- return new Promise< number >(async (resolve, reject) => {
405
- try {
406
- config.baseURL = this._options.baseUrl;
407
- const response = await this._axios.post("GetListIdByListName", request , config);
408
- base.WebApiBase.SetCompleted(options, response);
409
- const res : number = response.data as number;
410
- resolve(res);
411
- }
412
- catch( err ) {
413
- base.WebApiBase.HandleError(options, config, err);
414
- reject(err);
415
- }
416
- });
417
- }
418
-
419
-
420
-
421
- /**
422
- * Retrieve the UdListDefinition id of a list, by its name. Not all lists have such an ID, but those that are based on tables do (the list name is then the same as the table name)
423
- * @param request - Name
424
- * @returns List id in the UdListDefinition table
425
- */
426
- public async getListIdByListNameAsync(request: carriers.MDO_GetListIdByListNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
427
-
428
- /**
429
- * Retrieve the UdListDefinition id of a list, by its name. Not all lists have such an ID, but those that are based on tables do (the list name is then the same as the table name)
430
- * @param name - The list name, same as the table name for lists that are backed by tables
431
- * @returns List id in the UdListDefinition table
432
- */
433
- public async getListIdByListNameAsync(name: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
434
-
435
- public async getListIdByListNameAsync(name:string|carriers.MDO_GetListIdByListNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
436
- let _request : carriers.MDO_GetListIdByListNameRequest = null;
437
- let _options : base.WebApiRequestOptions = null;
438
- const first : any = name;
439
- if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' ) )
440
- {
441
- _request = name as carriers.MDO_GetListIdByListNameRequest;
442
- _options = webapi_options as base.WebApiRequestOptions;
443
- }
444
- else
445
- {
446
- _request = {
447
- name: name as string,
448
- };
449
- _options = webapi_options;
450
- }
451
- return this._getListIdByListNameAsync( _request, _options );
452
- }
453
-
454
-
455
- private async _getSelectableSimpleListAsync(request: carriers.MDO_GetSelectableSimpleListRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
456
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
457
- base.WebApiBase.SetPending(options);
458
- return new Promise< carriers.SelectableMDOListItem[] >(async (resolve, reject) => {
459
- try {
460
- config.baseURL = this._options.baseUrl;
461
- const response = await this._axios.post("GetSelectableSimpleList", request , config);
462
- base.WebApiBase.SetCompleted(options, response);
463
- const res : carriers.SelectableMDOListItem[] = converters.Create_SelectableMDOListItemArray_From( response.data );
464
- resolve(res);
465
- }
466
- catch( err ) {
467
- base.WebApiBase.HandleError(options, config, err);
468
- reject(err);
469
- }
470
- });
471
- }
472
-
473
-
474
-
475
- /**
476
- * Method returns a flat Selectable MDO List.
477
- * @param request - Name
478
- * @returns Array of SelectableMDOListItem
479
- */
480
- public async getSelectableSimpleListAsync(request: carriers.MDO_GetSelectableSimpleListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
481
-
482
- /**
483
- * Method returns a flat Selectable MDO List.
484
- * @param name - Conceptual name of the MDO list
485
- * @returns Array of SelectableMDOListItem
486
- */
487
- public async getSelectableSimpleListAsync(name: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
488
-
489
- public async getSelectableSimpleListAsync(name:string|carriers.MDO_GetSelectableSimpleListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
490
- let _request : carriers.MDO_GetSelectableSimpleListRequest = null;
491
- let _options : base.WebApiRequestOptions = null;
492
- const first : any = name;
493
- if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' ) )
494
- {
495
- _request = name as carriers.MDO_GetSelectableSimpleListRequest;
496
- _options = webapi_options as base.WebApiRequestOptions;
497
- }
498
- else
499
- {
500
- _request = {
501
- name: name as string,
502
- };
503
- _options = webapi_options;
504
- }
505
- return this._getSelectableSimpleListAsync( _request, _options );
506
- }
507
-
508
-
509
- private async _getSelectableListWithRestrictionAsync(request: carriers.MDO_GetSelectableListWithRestrictionRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
510
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
511
- base.WebApiBase.SetPending(options);
512
- return new Promise< carriers.SelectableMDOListItem[] >(async (resolve, reject) => {
513
- try {
514
- config.baseURL = this._options.baseUrl;
515
- const response = await this._axios.post("GetSelectableListWithRestriction", request , config);
516
- base.WebApiBase.SetCompleted(options, response);
517
- const res : carriers.SelectableMDOListItem[] = converters.Create_SelectableMDOListItemArray_From( response.data );
518
- resolve(res);
519
- }
520
- catch( err ) {
521
- base.WebApiBase.HandleError(options, config, err);
522
- reject(err);
523
- }
524
- });
525
- }
526
-
527
-
528
-
529
- /**
530
- * Method to get a Selectable MDO list with restrictions.
531
- * @param request - Name, AdditionalInfo, SearchValue
532
- * @returns Array of SelectableMDOListItem
533
- */
534
- public async getSelectableListWithRestrictionAsync(request: carriers.MDO_GetSelectableListWithRestrictionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
535
-
536
- /**
537
- * Method to get a Selectable MDO list with restrictions.
538
- * @param name - Conceptual name of the MDO list
539
- * @param additionalInfo - Additional info to the MDO provider
540
- * @param searchValue - the value used to restrict the list
541
- * @returns Array of SelectableMDOListItem
542
- */
543
- public async getSelectableListWithRestrictionAsync(name: string, additionalInfo: string, searchValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
544
-
545
- public async getSelectableListWithRestrictionAsync(name:string|carriers.MDO_GetSelectableListWithRestrictionRequest, additionalInfo?:string|base.WebApiRequestOptions, searchValue?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
546
- let _request : carriers.MDO_GetSelectableListWithRestrictionRequest = null;
547
- let _options : base.WebApiRequestOptions = null;
548
- const first : any = name;
549
- if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.searchValue)!='undefined' ) )
550
- {
551
- _request = name as carriers.MDO_GetSelectableListWithRestrictionRequest;
552
- _options = additionalInfo as base.WebApiRequestOptions;
553
- }
554
- else
555
- {
556
- _request = {
557
- name: name as string,
558
- additionalInfo: additionalInfo as string,
559
- searchValue: searchValue as string,
560
- };
561
- _options = webapi_options;
562
- }
563
- return this._getSelectableListWithRestrictionAsync( _request, _options );
564
- }
565
-
566
-
567
- private async _getSelectableListWithHistoryAsync(request: carriers.MDO_GetSelectableListWithHistoryRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
568
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
569
- base.WebApiBase.SetPending(options);
570
- return new Promise< carriers.SelectableMDOListItem[] >(async (resolve, reject) => {
571
- try {
572
- config.baseURL = this._options.baseUrl;
573
- const response = await this._axios.post("GetSelectableListWithHistory", request , config);
574
- base.WebApiBase.SetCompleted(options, response);
575
- const res : carriers.SelectableMDOListItem[] = converters.Create_SelectableMDOListItemArray_From( response.data );
576
- resolve(res);
577
- }
578
- catch( err ) {
579
- base.WebApiBase.HandleError(options, config, err);
580
- reject(err);
581
- }
582
- });
583
- }
584
-
585
-
586
-
587
- /**
588
- * Method to get a Selectable MDO list with own history list.
589
- * @param request - Name, ForceFlatList, AdditionalInfo, HistoryItems, OnlyHistory
590
- * @returns Array of SelectableMDOListItem
591
- */
592
- public async getSelectableListWithHistoryAsync(request: carriers.MDO_GetSelectableListWithHistoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
593
-
594
- /**
595
- * Method to get a Selectable MDO list with own history list.
596
- * @param name - Conceptual name of the MDO list.
597
- * @param forceFlatList - Force the list to be flat
598
- * @param additionalInfo - Additional info to the MDO provider
599
- * @param historyItems - An array of ids, used to get the history list
600
- * @param onlyHistory - If true, return only history items
601
- * @returns Array of SelectableMDOListItem
602
- */
603
- public async getSelectableListWithHistoryAsync(name: string, forceFlatList: boolean, additionalInfo: string, historyItems: number[], onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
604
-
605
- public async getSelectableListWithHistoryAsync(name:string|carriers.MDO_GetSelectableListWithHistoryRequest, forceFlatList?:boolean|base.WebApiRequestOptions, additionalInfo?:string, historyItems?:number[], onlyHistory?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
606
- let _request : carriers.MDO_GetSelectableListWithHistoryRequest = null;
607
- let _options : base.WebApiRequestOptions = null;
608
- const first : any = name;
609
- if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.forceFlatList)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.historyItems)!='undefined' || typeof(first.onlyHistory)!='undefined' ) )
610
- {
611
- _request = name as carriers.MDO_GetSelectableListWithHistoryRequest;
612
- _options = forceFlatList as base.WebApiRequestOptions;
613
- }
614
- else
615
- {
616
- _request = {
617
- name: name as string,
618
- forceFlatList: forceFlatList as boolean,
619
- additionalInfo: additionalInfo as string,
620
- historyItems: historyItems as number[],
621
- onlyHistory: onlyHistory as boolean,
622
- };
623
- _options = webapi_options;
624
- }
625
- return this._getSelectableListWithHistoryAsync( _request, _options );
626
- }
627
-
628
-
629
- private async _getSelectableListAsync(request: carriers.MDO_GetSelectableListRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
630
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
631
- base.WebApiBase.SetPending(options);
632
- return new Promise< carriers.SelectableMDOListItem[] >(async (resolve, reject) => {
633
- try {
634
- config.baseURL = this._options.baseUrl;
635
- const response = await this._axios.post("GetSelectableList", request , config);
636
- base.WebApiBase.SetCompleted(options, response);
637
- const res : carriers.SelectableMDOListItem[] = converters.Create_SelectableMDOListItemArray_From( response.data );
638
- resolve(res);
639
- }
640
- catch( err ) {
641
- base.WebApiBase.HandleError(options, config, err);
642
- reject(err);
643
- }
644
- });
645
- }
646
-
647
-
648
-
649
- /**
650
- * Method to get a Selectable MDO list.
651
- * @param request - Name, ForceFlatList, AdditionalInfo, OnlyHistory
652
- * @returns Array of SelectableMDOListItem
653
- */
654
- public async getSelectableListAsync(request: carriers.MDO_GetSelectableListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
655
-
656
- /**
657
- * Method to get a Selectable MDO list.
658
- * @param name - Conceptual name of the MDO list.
659
- * @param forceFlatList - Force the list to be flat
660
- * @param additionalInfo - Additional info to the MDO provider
661
- * @param onlyHistory - If true, return only history items
662
- * @returns Array of SelectableMDOListItem
663
- */
664
- public async getSelectableListAsync(name: string, forceFlatList: boolean, additionalInfo: string, onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
665
-
666
- public async getSelectableListAsync(name:string|carriers.MDO_GetSelectableListRequest, forceFlatList?:boolean|base.WebApiRequestOptions, additionalInfo?:string, onlyHistory?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
667
- let _request : carriers.MDO_GetSelectableListRequest = null;
668
- let _options : base.WebApiRequestOptions = null;
669
- const first : any = name;
670
- if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.forceFlatList)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.onlyHistory)!='undefined' ) )
671
- {
672
- _request = name as carriers.MDO_GetSelectableListRequest;
673
- _options = forceFlatList as base.WebApiRequestOptions;
674
- }
675
- else
676
- {
677
- _request = {
678
- name: name as string,
679
- forceFlatList: forceFlatList as boolean,
680
- additionalInfo: additionalInfo as string,
681
- onlyHistory: onlyHistory as boolean,
682
- };
683
- _options = webapi_options;
684
- }
685
- return this._getSelectableListAsync( _request, _options );
686
- }
687
-
688
-
689
- private async _setSelectedAsync(request: carriers.MDO_SetSelectedRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
690
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
691
- base.WebApiBase.SetPending(options);
692
- return new Promise< carriers.SelectableMDOListItem[] >(async (resolve, reject) => {
693
- try {
694
- config.baseURL = this._options.baseUrl;
695
- const response = await this._axios.post("SetSelected", request , config);
696
- base.WebApiBase.SetCompleted(options, response);
697
- const res : carriers.SelectableMDOListItem[] = converters.Create_SelectableMDOListItemArray_From( response.data );
698
- resolve(res);
699
- }
700
- catch( err ) {
701
- base.WebApiBase.HandleError(options, config, err);
702
- reject(err);
703
- }
704
- });
705
- }
706
-
707
-
708
-
709
- /**
710
- * Saves the selected values as selected by their given list representation.
711
- * @param request - Name, AdditionalInfo, SelectableMDOList
712
- * @returns Array of updated SelectableMDOListItems
713
- */
714
- public async setSelectedAsync(request: carriers.MDO_SetSelectedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
715
-
716
- /**
717
- * Saves the selected values as selected by their given list representation.
718
- * @param name - Conceptual name of the MDO list
719
- * @param additionalInfo - Additional info to the MDO provider
720
- * @param selectableMDOList - Items to be updated
721
- * @returns Array of updated SelectableMDOListItems
722
- */
723
- public async setSelectedAsync(name: string, additionalInfo: string, selectableMDOList: carriers.SelectableMDOListItem[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
724
-
725
- public async setSelectedAsync(name:string|carriers.MDO_SetSelectedRequest, additionalInfo?:string|base.WebApiRequestOptions, selectableMDOList?:carriers.SelectableMDOListItem[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
726
- let _request : carriers.MDO_SetSelectedRequest = null;
727
- let _options : base.WebApiRequestOptions = null;
728
- const first : any = name;
729
- if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.selectableMDOList)!='undefined' ) )
730
- {
731
- _request = name as carriers.MDO_SetSelectedRequest;
732
- _options = additionalInfo as base.WebApiRequestOptions;
733
- }
734
- else
735
- {
736
- _request = {
737
- name: name as string,
738
- additionalInfo: additionalInfo as string,
739
- selectableMDOList: selectableMDOList as carriers.SelectableMDOListItem[],
740
- };
741
- _options = webapi_options;
742
- }
743
- return this._setSelectedAsync( _request, _options );
744
- }
745
-
746
- } // class v1MDOAgentController
747
-
748
-
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/MDOAgent.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
+ * MDO Lists, reading, searching, and item lookup.
28
+ */
29
+ export interface IMDOAgent {
30
+ getListAsync(request: carriers.MDO_GetListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
31
+ getListAsync(name: string, forceFlatList: boolean, additionalInfo: string, onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
32
+ getListWithHistoryAsync(request: carriers.MDO_GetListWithHistoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
33
+ getListWithHistoryAsync(name: string, forceFlatList: boolean, additionalInfo: string, historyItems: number[], onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
34
+ getListWithRestrictionAsync(request: carriers.MDO_GetListWithRestrictionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
35
+ getListWithRestrictionAsync(name: string, additionalInfo: string, searchValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
36
+ getSimpleListAsync(request: carriers.MDO_GetSimpleListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
37
+ getSimpleListAsync(name: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
38
+ getListItemAsync(request: carriers.MDO_GetListItemRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem >;
39
+ getListItemAsync(listName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem >;
40
+ getListNamesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
41
+ getListIdByListNameAsync(request: carriers.MDO_GetListIdByListNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
42
+ getListIdByListNameAsync(name: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
43
+ getSelectableSimpleListAsync(request: carriers.MDO_GetSelectableSimpleListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
44
+ getSelectableSimpleListAsync(name: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
45
+ getSelectableListWithRestrictionAsync(request: carriers.MDO_GetSelectableListWithRestrictionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
46
+ getSelectableListWithRestrictionAsync(name: string, additionalInfo: string, searchValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
47
+ getSelectableListWithHistoryAsync(request: carriers.MDO_GetSelectableListWithHistoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
48
+ getSelectableListWithHistoryAsync(name: string, forceFlatList: boolean, additionalInfo: string, historyItems: number[], onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
49
+ getSelectableListAsync(request: carriers.MDO_GetSelectableListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
50
+ getSelectableListAsync(name: string, forceFlatList: boolean, additionalInfo: string, onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
51
+ setSelectedAsync(request: carriers.MDO_SetSelectedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
52
+ setSelectedAsync(name: string, additionalInfo: string, selectableMDOList: carriers.SelectableMDOListItem[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
53
+ } // interface IMDOAgent
54
+
55
+
56
+
57
+
58
+ /**
59
+ * MDO Lists, reading, searching, and item lookup.
60
+ */
61
+ export class MDOAgent extends base.WebApiBase implements IMDOAgent {
62
+ constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
63
+ constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
64
+ constructor(baseUrl: string, resourceManager:any);
65
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
66
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
67
+ constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
68
+ constructor(options: base.WebApiOptions);
69
+
70
+ constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
71
+ langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
72
+ langOrResourceOrRM?:string|base.ResourceParsing|any,
73
+ cultureCode?: string,
74
+ ) {
75
+ const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
76
+ options.basePath = "v1/Agents/MDO/";
77
+ super(options);
78
+ }
79
+
80
+
81
+
82
+ private async _getListAsync(request: carriers.MDO_GetListRequest, options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
83
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
84
+ base.WebApiBase.SetPending(options);
85
+ return new Promise< carriers.MDOListItem[] >(async (resolve, reject) => {
86
+ try {
87
+ config.baseURL = this._options.baseUrl;
88
+ const response = await this._axios.post("GetList", request , config);
89
+ base.WebApiBase.SetCompleted(options, response);
90
+ const res : carriers.MDOListItem[] = converters.Create_MDOListItemArray_From( response.data );
91
+ resolve(res);
92
+ }
93
+ catch( err ) {
94
+ base.WebApiBase.HandleError(options, config, err);
95
+ reject(err);
96
+ }
97
+ });
98
+ }
99
+
100
+
101
+
102
+ /**
103
+ * Method to get a MDO list.
104
+ * @param request - Name, ForceFlatList, AdditionalInfo, OnlyHistory
105
+ * @returns Array of MDOListItem
106
+ */
107
+ public async getListAsync(request: carriers.MDO_GetListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
108
+
109
+ /**
110
+ * Method to get a MDO list.
111
+ * @param name - Conceptual name of the MDO list-
112
+ * @param forceFlatList - Force the list to be flat
113
+ * @param additionalInfo - Additional info to the MDO provider
114
+ * @param onlyHistory - If true, return only history items
115
+ * @returns Array of MDOListItem
116
+ */
117
+ public async getListAsync(name: string, forceFlatList: boolean, additionalInfo: string, onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
118
+
119
+ public async getListAsync(name:string|carriers.MDO_GetListRequest, forceFlatList?:boolean|base.WebApiRequestOptions, additionalInfo?:string, onlyHistory?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
120
+ let _request : carriers.MDO_GetListRequest = null;
121
+ let _options : base.WebApiRequestOptions = null;
122
+ const first : any = name;
123
+ if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.forceFlatList)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.onlyHistory)!='undefined' ) )
124
+ {
125
+ _request = name as carriers.MDO_GetListRequest;
126
+ _options = forceFlatList as base.WebApiRequestOptions;
127
+ }
128
+ else
129
+ {
130
+ _request = {
131
+ name: name as string,
132
+ forceFlatList: forceFlatList as boolean,
133
+ additionalInfo: additionalInfo as string,
134
+ onlyHistory: onlyHistory as boolean,
135
+ };
136
+ _options = webapi_options;
137
+ }
138
+ return this._getListAsync( _request, _options );
139
+ }
140
+
141
+
142
+ private async _getListWithHistoryAsync(request: carriers.MDO_GetListWithHistoryRequest, options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
143
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
144
+ base.WebApiBase.SetPending(options);
145
+ return new Promise< carriers.MDOListItem[] >(async (resolve, reject) => {
146
+ try {
147
+ config.baseURL = this._options.baseUrl;
148
+ const response = await this._axios.post("GetListWithHistory", request , config);
149
+ base.WebApiBase.SetCompleted(options, response);
150
+ const res : carriers.MDOListItem[] = converters.Create_MDOListItemArray_From( response.data );
151
+ resolve(res);
152
+ }
153
+ catch( err ) {
154
+ base.WebApiBase.HandleError(options, config, err);
155
+ reject(err);
156
+ }
157
+ });
158
+ }
159
+
160
+
161
+
162
+ /**
163
+ * Method to get a MDO list with own history list.
164
+ * @param request - Name, ForceFlatList, AdditionalInfo, HistoryItems, OnlyHistory
165
+ * @returns Array of MDOListItem
166
+ */
167
+ public async getListWithHistoryAsync(request: carriers.MDO_GetListWithHistoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
168
+
169
+ /**
170
+ * Method to get a MDO list with own history list.
171
+ * @param name - Conceptual name of the MDO list-
172
+ * @param forceFlatList - Force the list to be flat
173
+ * @param additionalInfo - Additional info to the MDO provider
174
+ * @param historyItems - An array of ids, used to get the history list
175
+ * @param onlyHistory - If true, return only history items
176
+ * @returns Array of MDOListItem
177
+ */
178
+ public async getListWithHistoryAsync(name: string, forceFlatList: boolean, additionalInfo: string, historyItems: number[], onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
179
+
180
+ public async getListWithHistoryAsync(name:string|carriers.MDO_GetListWithHistoryRequest, forceFlatList?:boolean|base.WebApiRequestOptions, additionalInfo?:string, historyItems?:number[], onlyHistory?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
181
+ let _request : carriers.MDO_GetListWithHistoryRequest = null;
182
+ let _options : base.WebApiRequestOptions = null;
183
+ const first : any = name;
184
+ if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.forceFlatList)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.historyItems)!='undefined' || typeof(first.onlyHistory)!='undefined' ) )
185
+ {
186
+ _request = name as carriers.MDO_GetListWithHistoryRequest;
187
+ _options = forceFlatList as base.WebApiRequestOptions;
188
+ }
189
+ else
190
+ {
191
+ _request = {
192
+ name: name as string,
193
+ forceFlatList: forceFlatList as boolean,
194
+ additionalInfo: additionalInfo as string,
195
+ historyItems: historyItems as number[],
196
+ onlyHistory: onlyHistory as boolean,
197
+ };
198
+ _options = webapi_options;
199
+ }
200
+ return this._getListWithHistoryAsync( _request, _options );
201
+ }
202
+
203
+
204
+ private async _getListWithRestrictionAsync(request: carriers.MDO_GetListWithRestrictionRequest, options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
205
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
206
+ base.WebApiBase.SetPending(options);
207
+ return new Promise< carriers.MDOListItem[] >(async (resolve, reject) => {
208
+ try {
209
+ config.baseURL = this._options.baseUrl;
210
+ const response = await this._axios.post("GetListWithRestriction", request , config);
211
+ base.WebApiBase.SetCompleted(options, response);
212
+ const res : carriers.MDOListItem[] = converters.Create_MDOListItemArray_From( response.data );
213
+ resolve(res);
214
+ }
215
+ catch( err ) {
216
+ base.WebApiBase.HandleError(options, config, err);
217
+ reject(err);
218
+ }
219
+ });
220
+ }
221
+
222
+
223
+
224
+ /**
225
+ * Method to get a MDO list with restrictions.
226
+ * @param request - Name, AdditionalInfo, SearchValue
227
+ * @returns Array of MDOListItem
228
+ */
229
+ public async getListWithRestrictionAsync(request: carriers.MDO_GetListWithRestrictionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
230
+
231
+ /**
232
+ * Method to get a MDO list with restrictions.
233
+ * @param name - Conceptual name of the MDO list-
234
+ * @param additionalInfo - Additional info to the MDO provider
235
+ * @param searchValue - the value used to restrict the list
236
+ * @returns Array of MDOListItem
237
+ */
238
+ public async getListWithRestrictionAsync(name: string, additionalInfo: string, searchValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
239
+
240
+ public async getListWithRestrictionAsync(name:string|carriers.MDO_GetListWithRestrictionRequest, additionalInfo?:string|base.WebApiRequestOptions, searchValue?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
241
+ let _request : carriers.MDO_GetListWithRestrictionRequest = null;
242
+ let _options : base.WebApiRequestOptions = null;
243
+ const first : any = name;
244
+ if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.searchValue)!='undefined' ) )
245
+ {
246
+ _request = name as carriers.MDO_GetListWithRestrictionRequest;
247
+ _options = additionalInfo as base.WebApiRequestOptions;
248
+ }
249
+ else
250
+ {
251
+ _request = {
252
+ name: name as string,
253
+ additionalInfo: additionalInfo as string,
254
+ searchValue: searchValue as string,
255
+ };
256
+ _options = webapi_options;
257
+ }
258
+ return this._getListWithRestrictionAsync( _request, _options );
259
+ }
260
+
261
+
262
+ private async _getSimpleListAsync(request: carriers.MDO_GetSimpleListRequest, options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
263
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
264
+ base.WebApiBase.SetPending(options);
265
+ return new Promise< carriers.MDOListItem[] >(async (resolve, reject) => {
266
+ try {
267
+ config.baseURL = this._options.baseUrl;
268
+ const response = await this._axios.post("GetSimpleList", request , config);
269
+ base.WebApiBase.SetCompleted(options, response);
270
+ const res : carriers.MDOListItem[] = converters.Create_MDOListItemArray_From( response.data );
271
+ resolve(res);
272
+ }
273
+ catch( err ) {
274
+ base.WebApiBase.HandleError(options, config, err);
275
+ reject(err);
276
+ }
277
+ });
278
+ }
279
+
280
+
281
+
282
+ /**
283
+ * Method returns a simple flat MDO List.
284
+ * @param request - Name
285
+ * @returns Array of MDOListItem
286
+ */
287
+ public async getSimpleListAsync(request: carriers.MDO_GetSimpleListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
288
+
289
+ /**
290
+ * Method returns a simple flat MDO List.
291
+ * @param name - Conceptual name of the MDO list.
292
+ * @returns Array of MDOListItem
293
+ */
294
+ public async getSimpleListAsync(name: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] >;
295
+
296
+ public async getSimpleListAsync(name:string|carriers.MDO_GetSimpleListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem[] > {
297
+ let _request : carriers.MDO_GetSimpleListRequest = null;
298
+ let _options : base.WebApiRequestOptions = null;
299
+ const first : any = name;
300
+ if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' ) )
301
+ {
302
+ _request = name as carriers.MDO_GetSimpleListRequest;
303
+ _options = webapi_options as base.WebApiRequestOptions;
304
+ }
305
+ else
306
+ {
307
+ _request = {
308
+ name: name as string,
309
+ };
310
+ _options = webapi_options;
311
+ }
312
+ return this._getSimpleListAsync( _request, _options );
313
+ }
314
+
315
+
316
+ private async _getListItemAsync(request: carriers.MDO_GetListItemRequest, options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem > {
317
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
318
+ base.WebApiBase.SetPending(options);
319
+ return new Promise< carriers.MDOListItem >(async (resolve, reject) => {
320
+ try {
321
+ config.baseURL = this._options.baseUrl;
322
+ const response = await this._axios.post("GetListItem", request , config);
323
+ base.WebApiBase.SetCompleted(options, response);
324
+ const res : carriers.MDOListItem = converters.Create_MDOListItem_From( response.data );
325
+ resolve(res);
326
+ }
327
+ catch( err ) {
328
+ base.WebApiBase.HandleError(options, config, err);
329
+ reject(err);
330
+ }
331
+ });
332
+ }
333
+
334
+
335
+
336
+ /**
337
+ * Returns a single list item
338
+ * @param request - ListName, Id
339
+ * @returns Single MDO list item
340
+ */
341
+ public async getListItemAsync(request: carriers.MDO_GetListItemRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem >;
342
+
343
+ /**
344
+ * Returns a single list item
345
+ * @param listName - Conceptual name of the MDO list
346
+ * @param id - Id of list item
347
+ * @returns Single MDO list item
348
+ */
349
+ public async getListItemAsync(listName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem >;
350
+
351
+ public async getListItemAsync(listName:string|carriers.MDO_GetListItemRequest, id?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.MDOListItem > {
352
+ let _request : carriers.MDO_GetListItemRequest = null;
353
+ let _options : base.WebApiRequestOptions = null;
354
+ const first : any = listName;
355
+ if( typeof( first ) === "object" && first && ( typeof(first.listName)!='undefined' || typeof(first.id)!='undefined' ) )
356
+ {
357
+ _request = listName as carriers.MDO_GetListItemRequest;
358
+ _options = id as base.WebApiRequestOptions;
359
+ }
360
+ else
361
+ {
362
+ _request = {
363
+ listName: listName as string,
364
+ id: id as number,
365
+ };
366
+ _options = webapi_options;
367
+ }
368
+ return this._getListItemAsync( _request, _options );
369
+ }
370
+
371
+
372
+ private async _getListNamesAsync( options?:base.WebApiRequestOptions) : Promise< string[] > {
373
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
374
+ base.WebApiBase.SetPending(options);
375
+ return new Promise< string[] >(async (resolve, reject) => {
376
+ try {
377
+ config.baseURL = this._options.baseUrl;
378
+ const response = await this._axios.post("GetListNames", undefined , config);
379
+ base.WebApiBase.SetCompleted(options, response);
380
+ const res : string[] = response.data as string[];
381
+ resolve(res);
382
+ }
383
+ catch( err ) {
384
+ base.WebApiBase.HandleError(options, config, err);
385
+ reject(err);
386
+ }
387
+ });
388
+ }
389
+
390
+
391
+ /**
392
+ * Returns a list of all MDO List names. These names can also be used with the Archive agent as ProviderNames.
393
+ * @returns Array of list names.
394
+ */
395
+ public async getListNamesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >
396
+ {
397
+ return this._getListNamesAsync(webapi_options);
398
+ }
399
+
400
+
401
+ private async _getListIdByListNameAsync(request: carriers.MDO_GetListIdByListNameRequest, options?:base.WebApiRequestOptions) : Promise< number > {
402
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
403
+ base.WebApiBase.SetPending(options);
404
+ return new Promise< number >(async (resolve, reject) => {
405
+ try {
406
+ config.baseURL = this._options.baseUrl;
407
+ const response = await this._axios.post("GetListIdByListName", request , config);
408
+ base.WebApiBase.SetCompleted(options, response);
409
+ const res : number = response.data as number;
410
+ resolve(res);
411
+ }
412
+ catch( err ) {
413
+ base.WebApiBase.HandleError(options, config, err);
414
+ reject(err);
415
+ }
416
+ });
417
+ }
418
+
419
+
420
+
421
+ /**
422
+ * Retrieve the UdListDefinition id of a list, by its name. Not all lists have such an ID, but those that are based on tables do (the list name is then the same as the table name)
423
+ * @param request - Name
424
+ * @returns List id in the UdListDefinition table
425
+ */
426
+ public async getListIdByListNameAsync(request: carriers.MDO_GetListIdByListNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
427
+
428
+ /**
429
+ * Retrieve the UdListDefinition id of a list, by its name. Not all lists have such an ID, but those that are based on tables do (the list name is then the same as the table name)
430
+ * @param name - The list name, same as the table name for lists that are backed by tables
431
+ * @returns List id in the UdListDefinition table
432
+ */
433
+ public async getListIdByListNameAsync(name: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
434
+
435
+ public async getListIdByListNameAsync(name:string|carriers.MDO_GetListIdByListNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
436
+ let _request : carriers.MDO_GetListIdByListNameRequest = null;
437
+ let _options : base.WebApiRequestOptions = null;
438
+ const first : any = name;
439
+ if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' ) )
440
+ {
441
+ _request = name as carriers.MDO_GetListIdByListNameRequest;
442
+ _options = webapi_options as base.WebApiRequestOptions;
443
+ }
444
+ else
445
+ {
446
+ _request = {
447
+ name: name as string,
448
+ };
449
+ _options = webapi_options;
450
+ }
451
+ return this._getListIdByListNameAsync( _request, _options );
452
+ }
453
+
454
+
455
+ private async _getSelectableSimpleListAsync(request: carriers.MDO_GetSelectableSimpleListRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
456
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
457
+ base.WebApiBase.SetPending(options);
458
+ return new Promise< carriers.SelectableMDOListItem[] >(async (resolve, reject) => {
459
+ try {
460
+ config.baseURL = this._options.baseUrl;
461
+ const response = await this._axios.post("GetSelectableSimpleList", request , config);
462
+ base.WebApiBase.SetCompleted(options, response);
463
+ const res : carriers.SelectableMDOListItem[] = converters.Create_SelectableMDOListItemArray_From( response.data );
464
+ resolve(res);
465
+ }
466
+ catch( err ) {
467
+ base.WebApiBase.HandleError(options, config, err);
468
+ reject(err);
469
+ }
470
+ });
471
+ }
472
+
473
+
474
+
475
+ /**
476
+ * Method returns a flat Selectable MDO List.
477
+ * @param request - Name
478
+ * @returns Array of SelectableMDOListItem
479
+ */
480
+ public async getSelectableSimpleListAsync(request: carriers.MDO_GetSelectableSimpleListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
481
+
482
+ /**
483
+ * Method returns a flat Selectable MDO List.
484
+ * @param name - Conceptual name of the MDO list
485
+ * @returns Array of SelectableMDOListItem
486
+ */
487
+ public async getSelectableSimpleListAsync(name: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
488
+
489
+ public async getSelectableSimpleListAsync(name:string|carriers.MDO_GetSelectableSimpleListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
490
+ let _request : carriers.MDO_GetSelectableSimpleListRequest = null;
491
+ let _options : base.WebApiRequestOptions = null;
492
+ const first : any = name;
493
+ if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' ) )
494
+ {
495
+ _request = name as carriers.MDO_GetSelectableSimpleListRequest;
496
+ _options = webapi_options as base.WebApiRequestOptions;
497
+ }
498
+ else
499
+ {
500
+ _request = {
501
+ name: name as string,
502
+ };
503
+ _options = webapi_options;
504
+ }
505
+ return this._getSelectableSimpleListAsync( _request, _options );
506
+ }
507
+
508
+
509
+ private async _getSelectableListWithRestrictionAsync(request: carriers.MDO_GetSelectableListWithRestrictionRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
510
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
511
+ base.WebApiBase.SetPending(options);
512
+ return new Promise< carriers.SelectableMDOListItem[] >(async (resolve, reject) => {
513
+ try {
514
+ config.baseURL = this._options.baseUrl;
515
+ const response = await this._axios.post("GetSelectableListWithRestriction", request , config);
516
+ base.WebApiBase.SetCompleted(options, response);
517
+ const res : carriers.SelectableMDOListItem[] = converters.Create_SelectableMDOListItemArray_From( response.data );
518
+ resolve(res);
519
+ }
520
+ catch( err ) {
521
+ base.WebApiBase.HandleError(options, config, err);
522
+ reject(err);
523
+ }
524
+ });
525
+ }
526
+
527
+
528
+
529
+ /**
530
+ * Method to get a Selectable MDO list with restrictions.
531
+ * @param request - Name, AdditionalInfo, SearchValue
532
+ * @returns Array of SelectableMDOListItem
533
+ */
534
+ public async getSelectableListWithRestrictionAsync(request: carriers.MDO_GetSelectableListWithRestrictionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
535
+
536
+ /**
537
+ * Method to get a Selectable MDO list with restrictions.
538
+ * @param name - Conceptual name of the MDO list
539
+ * @param additionalInfo - Additional info to the MDO provider
540
+ * @param searchValue - the value used to restrict the list
541
+ * @returns Array of SelectableMDOListItem
542
+ */
543
+ public async getSelectableListWithRestrictionAsync(name: string, additionalInfo: string, searchValue: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
544
+
545
+ public async getSelectableListWithRestrictionAsync(name:string|carriers.MDO_GetSelectableListWithRestrictionRequest, additionalInfo?:string|base.WebApiRequestOptions, searchValue?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
546
+ let _request : carriers.MDO_GetSelectableListWithRestrictionRequest = null;
547
+ let _options : base.WebApiRequestOptions = null;
548
+ const first : any = name;
549
+ if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.searchValue)!='undefined' ) )
550
+ {
551
+ _request = name as carriers.MDO_GetSelectableListWithRestrictionRequest;
552
+ _options = additionalInfo as base.WebApiRequestOptions;
553
+ }
554
+ else
555
+ {
556
+ _request = {
557
+ name: name as string,
558
+ additionalInfo: additionalInfo as string,
559
+ searchValue: searchValue as string,
560
+ };
561
+ _options = webapi_options;
562
+ }
563
+ return this._getSelectableListWithRestrictionAsync( _request, _options );
564
+ }
565
+
566
+
567
+ private async _getSelectableListWithHistoryAsync(request: carriers.MDO_GetSelectableListWithHistoryRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
568
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
569
+ base.WebApiBase.SetPending(options);
570
+ return new Promise< carriers.SelectableMDOListItem[] >(async (resolve, reject) => {
571
+ try {
572
+ config.baseURL = this._options.baseUrl;
573
+ const response = await this._axios.post("GetSelectableListWithHistory", request , config);
574
+ base.WebApiBase.SetCompleted(options, response);
575
+ const res : carriers.SelectableMDOListItem[] = converters.Create_SelectableMDOListItemArray_From( response.data );
576
+ resolve(res);
577
+ }
578
+ catch( err ) {
579
+ base.WebApiBase.HandleError(options, config, err);
580
+ reject(err);
581
+ }
582
+ });
583
+ }
584
+
585
+
586
+
587
+ /**
588
+ * Method to get a Selectable MDO list with own history list.
589
+ * @param request - Name, ForceFlatList, AdditionalInfo, HistoryItems, OnlyHistory
590
+ * @returns Array of SelectableMDOListItem
591
+ */
592
+ public async getSelectableListWithHistoryAsync(request: carriers.MDO_GetSelectableListWithHistoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
593
+
594
+ /**
595
+ * Method to get a Selectable MDO list with own history list.
596
+ * @param name - Conceptual name of the MDO list.
597
+ * @param forceFlatList - Force the list to be flat
598
+ * @param additionalInfo - Additional info to the MDO provider
599
+ * @param historyItems - An array of ids, used to get the history list
600
+ * @param onlyHistory - If true, return only history items
601
+ * @returns Array of SelectableMDOListItem
602
+ */
603
+ public async getSelectableListWithHistoryAsync(name: string, forceFlatList: boolean, additionalInfo: string, historyItems: number[], onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
604
+
605
+ public async getSelectableListWithHistoryAsync(name:string|carriers.MDO_GetSelectableListWithHistoryRequest, forceFlatList?:boolean|base.WebApiRequestOptions, additionalInfo?:string, historyItems?:number[], onlyHistory?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
606
+ let _request : carriers.MDO_GetSelectableListWithHistoryRequest = null;
607
+ let _options : base.WebApiRequestOptions = null;
608
+ const first : any = name;
609
+ if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.forceFlatList)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.historyItems)!='undefined' || typeof(first.onlyHistory)!='undefined' ) )
610
+ {
611
+ _request = name as carriers.MDO_GetSelectableListWithHistoryRequest;
612
+ _options = forceFlatList as base.WebApiRequestOptions;
613
+ }
614
+ else
615
+ {
616
+ _request = {
617
+ name: name as string,
618
+ forceFlatList: forceFlatList as boolean,
619
+ additionalInfo: additionalInfo as string,
620
+ historyItems: historyItems as number[],
621
+ onlyHistory: onlyHistory as boolean,
622
+ };
623
+ _options = webapi_options;
624
+ }
625
+ return this._getSelectableListWithHistoryAsync( _request, _options );
626
+ }
627
+
628
+
629
+ private async _getSelectableListAsync(request: carriers.MDO_GetSelectableListRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
630
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
631
+ base.WebApiBase.SetPending(options);
632
+ return new Promise< carriers.SelectableMDOListItem[] >(async (resolve, reject) => {
633
+ try {
634
+ config.baseURL = this._options.baseUrl;
635
+ const response = await this._axios.post("GetSelectableList", request , config);
636
+ base.WebApiBase.SetCompleted(options, response);
637
+ const res : carriers.SelectableMDOListItem[] = converters.Create_SelectableMDOListItemArray_From( response.data );
638
+ resolve(res);
639
+ }
640
+ catch( err ) {
641
+ base.WebApiBase.HandleError(options, config, err);
642
+ reject(err);
643
+ }
644
+ });
645
+ }
646
+
647
+
648
+
649
+ /**
650
+ * Method to get a Selectable MDO list.
651
+ * @param request - Name, ForceFlatList, AdditionalInfo, OnlyHistory
652
+ * @returns Array of SelectableMDOListItem
653
+ */
654
+ public async getSelectableListAsync(request: carriers.MDO_GetSelectableListRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
655
+
656
+ /**
657
+ * Method to get a Selectable MDO list.
658
+ * @param name - Conceptual name of the MDO list.
659
+ * @param forceFlatList - Force the list to be flat
660
+ * @param additionalInfo - Additional info to the MDO provider
661
+ * @param onlyHistory - If true, return only history items
662
+ * @returns Array of SelectableMDOListItem
663
+ */
664
+ public async getSelectableListAsync(name: string, forceFlatList: boolean, additionalInfo: string, onlyHistory: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
665
+
666
+ public async getSelectableListAsync(name:string|carriers.MDO_GetSelectableListRequest, forceFlatList?:boolean|base.WebApiRequestOptions, additionalInfo?:string, onlyHistory?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
667
+ let _request : carriers.MDO_GetSelectableListRequest = null;
668
+ let _options : base.WebApiRequestOptions = null;
669
+ const first : any = name;
670
+ if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.forceFlatList)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.onlyHistory)!='undefined' ) )
671
+ {
672
+ _request = name as carriers.MDO_GetSelectableListRequest;
673
+ _options = forceFlatList as base.WebApiRequestOptions;
674
+ }
675
+ else
676
+ {
677
+ _request = {
678
+ name: name as string,
679
+ forceFlatList: forceFlatList as boolean,
680
+ additionalInfo: additionalInfo as string,
681
+ onlyHistory: onlyHistory as boolean,
682
+ };
683
+ _options = webapi_options;
684
+ }
685
+ return this._getSelectableListAsync( _request, _options );
686
+ }
687
+
688
+
689
+ private async _setSelectedAsync(request: carriers.MDO_SetSelectedRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
690
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
691
+ base.WebApiBase.SetPending(options);
692
+ return new Promise< carriers.SelectableMDOListItem[] >(async (resolve, reject) => {
693
+ try {
694
+ config.baseURL = this._options.baseUrl;
695
+ const response = await this._axios.post("SetSelected", request , config);
696
+ base.WebApiBase.SetCompleted(options, response);
697
+ const res : carriers.SelectableMDOListItem[] = converters.Create_SelectableMDOListItemArray_From( response.data );
698
+ resolve(res);
699
+ }
700
+ catch( err ) {
701
+ base.WebApiBase.HandleError(options, config, err);
702
+ reject(err);
703
+ }
704
+ });
705
+ }
706
+
707
+
708
+
709
+ /**
710
+ * Saves the selected values as selected by their given list representation.
711
+ * @param request - Name, AdditionalInfo, SelectableMDOList
712
+ * @returns Array of updated SelectableMDOListItems
713
+ */
714
+ public async setSelectedAsync(request: carriers.MDO_SetSelectedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
715
+
716
+ /**
717
+ * Saves the selected values as selected by their given list representation.
718
+ * @param name - Conceptual name of the MDO list
719
+ * @param additionalInfo - Additional info to the MDO provider
720
+ * @param selectableMDOList - Items to be updated
721
+ * @returns Array of updated SelectableMDOListItems
722
+ */
723
+ public async setSelectedAsync(name: string, additionalInfo: string, selectableMDOList: carriers.SelectableMDOListItem[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
724
+
725
+ public async setSelectedAsync(name:string|carriers.MDO_SetSelectedRequest, additionalInfo?:string|base.WebApiRequestOptions, selectableMDOList?:carriers.SelectableMDOListItem[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
726
+ let _request : carriers.MDO_SetSelectedRequest = null;
727
+ let _options : base.WebApiRequestOptions = null;
728
+ const first : any = name;
729
+ if( typeof( first ) === "object" && first && ( typeof(first.name)!='undefined' || typeof(first.additionalInfo)!='undefined' || typeof(first.selectableMDOList)!='undefined' ) )
730
+ {
731
+ _request = name as carriers.MDO_SetSelectedRequest;
732
+ _options = additionalInfo as base.WebApiRequestOptions;
733
+ }
734
+ else
735
+ {
736
+ _request = {
737
+ name: name as string,
738
+ additionalInfo: additionalInfo as string,
739
+ selectableMDOList: selectableMDOList as carriers.SelectableMDOListItem[],
740
+ };
741
+ _options = webapi_options;
742
+ }
743
+ return this._setSelectedAsync( _request, _options );
744
+ }
745
+
746
+ } // class v1MDOAgentController
747
+
748
+