@superoffice/webapi 11.7.727 → 11.8.788

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/LICENSE.md +15 -15
  2. package/README.md +184 -184
  3. package/__tests__/Appointment63-notz.json +1925 -1925
  4. package/__tests__/Appointment63-utctz.json +1925 -1925
  5. package/__tests__/Appointment63.json +1925 -1925
  6. package/__tests__/AppointmentTzTest.ts +115 -115
  7. package/__tests__/AxiosNockTest.ts +28 -28
  8. package/__tests__/ContactDefault.json +699 -699
  9. package/__tests__/ContactEntity.json +272 -272
  10. package/__tests__/ContactRestTest.ts +144 -144
  11. package/__tests__/ContactTest.ts +395 -395
  12. package/__tests__/ConvertersTest.ts +97 -97
  13. package/__tests__/DocumentTest.ts +101 -101
  14. package/__tests__/Person210-notz.json +1932 -1932
  15. package/__tests__/Person210-utctz.json +1932 -1932
  16. package/__tests__/Person210.json +1932 -1932
  17. package/__tests__/PersonImageData.nock +22 -22
  18. package/__tests__/PersonTest.ts +41 -41
  19. package/__tests__/PersonTzTest.ts +113 -113
  20. package/__tests__/RecurrenceInfo.json +55 -55
  21. package/__tests__/ResponseCallbackTest.ts +23 -23
  22. package/__tests__/TableRights.json +441 -441
  23. package/__tests__/WebapiTest.ts +264 -264
  24. package/__tests__/Webhook.json +16 -16
  25. package/__tests__/WebhookTest.ts +209 -209
  26. package/dist/cjs/Carriers.d.ts +367 -4
  27. package/dist/cjs/Carriers.d.ts.map +1 -1
  28. package/dist/cjs/Converters.d.ts +9 -0
  29. package/dist/cjs/Converters.d.ts.map +1 -1
  30. package/dist/cjs/Converters.js +185 -17
  31. package/dist/cjs/Converters.js.map +1 -1
  32. package/dist/cjs/DiagnosticsAgent.d.ts +38 -0
  33. package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
  34. package/dist/cjs/DiagnosticsAgent.js +91 -0
  35. package/dist/cjs/DiagnosticsAgent.js.map +1 -1
  36. package/dist/cjs/Enums.d.ts +18 -0
  37. package/dist/cjs/Enums.d.ts.map +1 -1
  38. package/dist/cjs/Enums.js +20 -1
  39. package/dist/cjs/Enums.js.map +1 -1
  40. package/dist/cjs/ListAgent.d.ts +71 -6
  41. package/dist/cjs/ListAgent.d.ts.map +1 -1
  42. package/dist/cjs/ListAgent.js +157 -0
  43. package/dist/cjs/ListAgent.js.map +1 -1
  44. package/dist/cjs/TicketAgent.d.ts +23 -0
  45. package/dist/cjs/TicketAgent.d.ts.map +1 -1
  46. package/dist/cjs/TicketAgent.js +65 -0
  47. package/dist/cjs/TicketAgent.js.map +1 -1
  48. package/dist/esm/Carriers.d.ts +367 -4
  49. package/dist/esm/Carriers.d.ts.map +1 -1
  50. package/dist/esm/Converters.d.ts +9 -0
  51. package/dist/esm/Converters.d.ts.map +1 -1
  52. package/dist/esm/Converters.js +159 -0
  53. package/dist/esm/Converters.js.map +1 -1
  54. package/dist/esm/DiagnosticsAgent.d.ts +38 -0
  55. package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
  56. package/dist/esm/DiagnosticsAgent.js +91 -0
  57. package/dist/esm/DiagnosticsAgent.js.map +1 -1
  58. package/dist/esm/Enums.d.ts +18 -0
  59. package/dist/esm/Enums.d.ts.map +1 -1
  60. package/dist/esm/Enums.js +19 -0
  61. package/dist/esm/Enums.js.map +1 -1
  62. package/dist/esm/ListAgent.d.ts +71 -6
  63. package/dist/esm/ListAgent.d.ts.map +1 -1
  64. package/dist/esm/ListAgent.js +157 -0
  65. package/dist/esm/ListAgent.js.map +1 -1
  66. package/dist/esm/TicketAgent.d.ts +23 -0
  67. package/dist/esm/TicketAgent.d.ts.map +1 -1
  68. package/dist/esm/TicketAgent.js +65 -0
  69. package/dist/esm/TicketAgent.js.map +1 -1
  70. package/examples-js/hello.js +12 -12
  71. package/examples-ts/hello.ts +8 -8
  72. package/package.json +93 -93
  73. package/scripts/postbuild.js +22 -22
  74. package/scripts/setVersion.js +44 -44
  75. package/src/AIAgent.ts +1992 -1992
  76. package/src/AppointmentAgent.ts +6263 -6263
  77. package/src/AppointmentRestApi.ts +225 -225
  78. package/src/ArchiveAgent.ts +1950 -1950
  79. package/src/AssociateAgent.ts +422 -422
  80. package/src/AxiosCacheHandler.ts +74 -74
  81. package/src/BLOBAgent.ts +2100 -2100
  82. package/src/Base64.ts +285 -285
  83. package/src/BatchAgent.ts +910 -910
  84. package/src/BulkUpdateAgent.ts +504 -504
  85. package/src/CRMScriptAgent.ts +1390 -1390
  86. package/src/Carriers.ts +52750 -52274
  87. package/src/ChatAgent.ts +1422 -1422
  88. package/src/ConfigurationAgent.ts +2228 -2228
  89. package/src/ContactAgent.ts +1756 -1756
  90. package/src/ContactRestApi.ts +237 -237
  91. package/src/Converters.ts +23271 -23090
  92. package/src/CustomerServiceAgent.ts +1799 -1799
  93. package/src/DashAgent.ts +1674 -1674
  94. package/src/DatabaseAgent.ts +120 -120
  95. package/src/DatabaseTableAgent.ts +534 -534
  96. package/src/Day_js.ts +41 -41
  97. package/src/DiagnosticsAgent.ts +1384 -1240
  98. package/src/DocumentAgent.ts +5079 -5079
  99. package/src/DocumentMigrationAgent.ts +524 -524
  100. package/src/DocumentRestApi.ts +259 -259
  101. package/src/EMailAgent.ts +5328 -5328
  102. package/src/Enums.ts +6936 -6916
  103. package/src/ErpSyncAgent.ts +2658 -2658
  104. package/src/FavouriteAgent.ts +720 -720
  105. package/src/FindAgent.ts +2330 -2330
  106. package/src/ForeignSystemAgent.ts +1710 -1710
  107. package/src/FreeTextAgent.ts +372 -372
  108. package/src/ImportAgent.ts +304 -304
  109. package/src/LicenseAgent.ts +1230 -1230
  110. package/src/ListAgent.ts +11451 -11237
  111. package/src/MDOAgent.ts +748 -748
  112. package/src/MarketingAgent.ts +890 -890
  113. package/src/MessagingAgent.ts +384 -384
  114. package/src/NavigatorAgent.ts +140 -140
  115. package/src/NumberAllocationAgent.ts +296 -296
  116. package/src/PersonAgent.ts +3287 -3287
  117. package/src/PersonRestApi.ts +241 -241
  118. package/src/PhoneListAgent.ts +458 -458
  119. package/src/PocketAgent.ts +780 -780
  120. package/src/PreferenceAgent.ts +1900 -1900
  121. package/src/PreviewsAgent.ts +116 -116
  122. package/src/ProjectAgent.ts +2391 -2391
  123. package/src/ProjectRestApi.ts +239 -239
  124. package/src/QuoteAgent.ts +5159 -5159
  125. package/src/RelationAgent.ts +220 -220
  126. package/src/ReportAgent.ts +154 -154
  127. package/src/ResourceAgent.ts +358 -358
  128. package/src/SaintAgent.ts +601 -601
  129. package/src/SaleAgent.ts +2034 -2034
  130. package/src/SaleRestApi.ts +233 -233
  131. package/src/SelectionAgent.ts +3195 -3195
  132. package/src/SentryAgent.ts +462 -462
  133. package/src/SoApiConstants.ts +8 -8
  134. package/src/TargetsAgent.ts +1104 -1104
  135. package/src/TicketAgent.ts +3708 -3638
  136. package/src/TimeZoneAgent.ts +528 -528
  137. package/src/TooltipsAgent.ts +116 -116
  138. package/src/UserAgent.ts +4856 -4856
  139. package/src/UserDefinedFieldInfoAgent.ts +1764 -1764
  140. package/src/ViewStateAgent.ts +858 -858
  141. package/src/WebApi.ts +872 -872
  142. package/src/WebApiBase.ts +565 -565
  143. package/src/WebhookAgent.ts +388 -388
  144. package/src/WorkflowAgent.ts +1338 -1338
  145. package/tsconfig.esm.json +8 -8
  146. package/tsconfig.jest.json +8 -8
  147. package/tsconfig.json +34 -34
@@ -1,1240 +1,1384 @@
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/DiagnosticsAgent.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
- * Diagnostics, usage data collection, caches and flushing
28
- */
29
- export interface IDiagnosticsAgent {
30
- flushCachesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
31
- getCacheNamesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
32
- flushCachesByNameAsync(request: carriers.Diagnostics_FlushCachesByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
33
- flushCachesByNameAsync(cacheNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
34
- getCacheStateAsync(request: carriers.Diagnostics_GetCacheStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
35
- getCacheStateAsync(cacheNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< string >;
36
- getCacheInvalidationGenerationsAsync(request: carriers.Diagnostics_GetCacheInvalidationGenerationsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CacheInvalidation[] >;
37
- getCacheInvalidationGenerationsAsync(names: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CacheInvalidation[] >;
38
- getEntityCountsForCurrentUserAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EntityCounts[] >;
39
- getEntityCountsForAllUsersAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EntityCounts[] >;
40
- logViewStateAsync(request: carriers.Diagnostics_LogViewStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
41
- logViewStateAsync(viewState: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
42
- changeLogSettingsAsync(request: carriers.Diagnostics_ChangeLogSettingsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
43
- changeLogSettingsAsync(logWarning: boolean, logInformation: boolean, logSuccessAudit: boolean, logFailureAudit: boolean, logToEventLog: boolean, logToSuperOffice: boolean, logToFile: boolean, logToTrace: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
44
- collectDataAdditionsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
45
- collectWinUsageAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
46
- collectWebUsageAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
47
- collectTableSizesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
48
- resyncUsersAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
49
- sendSystemMessageAsync(request: carriers.Diagnostics_SendSystemMessageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
50
- sendSystemMessageAsync(systemMessageId: string, associateId: number, markdownMessage: string, expire: Date, type: enums.SystemMessageType, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
51
- removeSystemMessageAsync(request: carriers.Diagnostics_RemoveSystemMessageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
52
- removeSystemMessageAsync(onlineappId: number, systemMessageId: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
53
- removeSystemMessageForAssociateAsync(request: carriers.Diagnostics_RemoveSystemMessageForAssociateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
54
- removeSystemMessageForAssociateAsync(onlineappId: number, systemMessageId: string, associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
55
- getSystemMessagesAsync(request: carriers.Diagnostics_GetSystemMessagesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemMessage[] >;
56
- getSystemMessagesAsync(associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemMessage[] >;
57
- removeExpiredSystemMessagesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
58
- getNextTableNumberAsync(webapi_options?:base.WebApiRequestOptions) : Promise< number >;
59
- performTasksAfterUpgradeAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string >;
60
- performTasksAfterCustomObjectTableCreatedAsync(request: carriers.Diagnostics_PerformTasksAfterCustomObjectTableCreatedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
61
- performTasksAfterCustomObjectTableCreatedAsync(tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
62
- performTasksAfterCustomObjectTableDeletedAsync(request: carriers.Diagnostics_PerformTasksAfterCustomObjectTableDeletedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
63
- performTasksAfterCustomObjectTableDeletedAsync(tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
64
- addWebAppUsageAsync(request: carriers.Diagnostics_AddWebAppUsageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
65
- addWebAppUsageAsync(webAppUsages: carriers.WebAppUsage[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
66
- webAppUsageExistsInPeriodAsync(request: carriers.Diagnostics_WebAppUsageExistsInPeriodRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
67
- webAppUsageExistsInPeriodAsync(associateId: number, viewState: string, fromDate: Date, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
68
- getWebAppUsagesForPeriodAsync(request: carriers.Diagnostics_GetWebAppUsagesForPeriodRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WebAppUsage[] >;
69
- getWebAppUsagesForPeriodAsync(fromDate: Date, toDate: Date, searchTerm: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WebAppUsage[] >;
70
- } // interface IDiagnosticsAgent
71
-
72
-
73
-
74
-
75
- /**
76
- * Diagnostics, usage data collection, caches and flushing
77
- */
78
- export class DiagnosticsAgent extends base.WebApiBase implements IDiagnosticsAgent {
79
- constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
80
- constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
81
- constructor(baseUrl: string, resourceManager:any);
82
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
83
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
84
- constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
85
- constructor(options: base.WebApiOptions);
86
-
87
- constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
88
- langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
89
- langOrResourceOrRM?:string|base.ResourceParsing|any,
90
- cultureCode?: string,
91
- ) {
92
- const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
93
- options.basePath = "v1/Agents/Diagnostics/";
94
- super(options);
95
- }
96
-
97
-
98
-
99
- private async _flushCachesAsync( options?:base.WebApiRequestOptions) : Promise< void > {
100
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
101
- base.WebApiBase.SetPending(options);
102
- return new Promise< void >(async (resolve, reject) => {
103
- try {
104
- config.baseURL = this._options.baseUrl;
105
- const response = await this._axios.post("FlushCaches", undefined , config);
106
- base.WebApiBase.SetCompleted(options, response);
107
- const res = response.data;
108
- resolve(res);
109
- }
110
- catch( err ) {
111
- base.WebApiBase.HandleError(options, config, err);
112
- reject(err);
113
- }
114
- });
115
- }
116
-
117
-
118
- /**
119
- * Flushes all NetServer caches
120
- * @returns
121
- */
122
- public async flushCachesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
123
- {
124
- return this._flushCachesAsync(webapi_options);
125
- }
126
-
127
-
128
- private async _getCacheNamesAsync( options?:base.WebApiRequestOptions) : Promise< string[] > {
129
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
130
- base.WebApiBase.SetPending(options);
131
- return new Promise< string[] >(async (resolve, reject) => {
132
- try {
133
- config.baseURL = this._options.baseUrl;
134
- const response = await this._axios.post("GetCacheNames", undefined , config);
135
- base.WebApiBase.SetCompleted(options, response);
136
- const res : string[] = response.data as string[];
137
- resolve(res);
138
- }
139
- catch( err ) {
140
- base.WebApiBase.HandleError(options, config, err);
141
- reject(err);
142
- }
143
- });
144
- }
145
-
146
-
147
- /**
148
- * Get the name of the caches that can be flushed
149
- * @returns Name of the caches that can be flusehd
150
- */
151
- public async getCacheNamesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >
152
- {
153
- return this._getCacheNamesAsync(webapi_options);
154
- }
155
-
156
-
157
- private async _flushCachesByNameAsync(request: carriers.Diagnostics_FlushCachesByNameRequest, options?:base.WebApiRequestOptions) : Promise< void > {
158
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
159
- base.WebApiBase.SetPending(options);
160
- return new Promise< void >(async (resolve, reject) => {
161
- try {
162
- config.baseURL = this._options.baseUrl;
163
- const response = await this._axios.post("FlushCachesByName", request , config);
164
- base.WebApiBase.SetCompleted(options, response);
165
- const res = response.data;
166
- resolve(res);
167
- }
168
- catch( err ) {
169
- base.WebApiBase.HandleError(options, config, err);
170
- reject(err);
171
- }
172
- });
173
- }
174
-
175
-
176
-
177
- /**
178
- * Flushes all NetServer caches named
179
- * @param request - CacheNames
180
- * @returns This method has no return value
181
- */
182
- public async flushCachesByNameAsync(request: carriers.Diagnostics_FlushCachesByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
183
-
184
- /**
185
- * Flushes all NetServer caches named
186
- * @param cacheNames - Name of the cachnes to flush
187
- * @returns This method has no return value
188
- */
189
- public async flushCachesByNameAsync(cacheNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
190
-
191
- public async flushCachesByNameAsync(cacheNames:string[]|carriers.Diagnostics_FlushCachesByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
192
- let _request : carriers.Diagnostics_FlushCachesByNameRequest = null;
193
- let _options : base.WebApiRequestOptions = null;
194
- const first : any = cacheNames;
195
- if( typeof( first ) === "object" && first && ( typeof(first.cacheNames)!='undefined' ) )
196
- {
197
- _request = cacheNames as carriers.Diagnostics_FlushCachesByNameRequest;
198
- _options = webapi_options as base.WebApiRequestOptions;
199
- }
200
- else
201
- {
202
- _request = {
203
- cacheNames: cacheNames as string[],
204
- };
205
- _options = webapi_options;
206
- }
207
- return this._flushCachesByNameAsync( _request, _options );
208
- }
209
-
210
-
211
- private async _getCacheStateAsync(request: carriers.Diagnostics_GetCacheStateRequest, options?:base.WebApiRequestOptions) : Promise< string > {
212
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
213
- base.WebApiBase.SetPending(options);
214
- return new Promise< string >(async (resolve, reject) => {
215
- try {
216
- config.baseURL = this._options.baseUrl;
217
- const response = await this._axios.post("GetCacheState", request , config);
218
- base.WebApiBase.SetCompleted(options, response);
219
- const res : string = response.data as string;
220
- resolve(res);
221
- }
222
- catch( err ) {
223
- base.WebApiBase.HandleError(options, config, err);
224
- reject(err);
225
- }
226
- });
227
- }
228
-
229
-
230
-
231
- /**
232
- * Get the current generation value of the named caches. State is opaque.
233
- * @param request - CacheNames
234
- * @returns Current state of the caches named. If not the same as previous value, then it is time to flush
235
- */
236
- public async getCacheStateAsync(request: carriers.Diagnostics_GetCacheStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
237
-
238
- /**
239
- * Get the current generation value of the named caches. State is opaque.
240
- * @param cacheNames - Names of the caches to check
241
- * @returns Current state of the caches named. If not the same as previous value, then it is time to flush
242
- */
243
- public async getCacheStateAsync(cacheNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< string >;
244
-
245
- public async getCacheStateAsync(cacheNames:string[]|carriers.Diagnostics_GetCacheStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
246
- let _request : carriers.Diagnostics_GetCacheStateRequest = null;
247
- let _options : base.WebApiRequestOptions = null;
248
- const first : any = cacheNames;
249
- if( typeof( first ) === "object" && first && ( typeof(first.cacheNames)!='undefined' ) )
250
- {
251
- _request = cacheNames as carriers.Diagnostics_GetCacheStateRequest;
252
- _options = webapi_options as base.WebApiRequestOptions;
253
- }
254
- else
255
- {
256
- _request = {
257
- cacheNames: cacheNames as string[],
258
- };
259
- _options = webapi_options;
260
- }
261
- return this._getCacheStateAsync( _request, _options );
262
- }
263
-
264
-
265
- private async _getCacheInvalidationGenerationsAsync(request: carriers.Diagnostics_GetCacheInvalidationGenerationsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CacheInvalidation[] > {
266
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
267
- base.WebApiBase.SetPending(options);
268
- return new Promise< carriers.CacheInvalidation[] >(async (resolve, reject) => {
269
- try {
270
- config.baseURL = this._options.baseUrl;
271
- const response = await this._axios.post("GetCacheInvalidationGenerations", request , config);
272
- base.WebApiBase.SetCompleted(options, response);
273
- const res : carriers.CacheInvalidation[] = converters.Create_CacheInvalidationArray_From( response.data );
274
- resolve(res);
275
- }
276
- catch( err ) {
277
- base.WebApiBase.HandleError(options, config, err);
278
- reject(err);
279
- }
280
- });
281
- }
282
-
283
-
284
-
285
- /**
286
- * Get generation for provided names
287
- * @param request - Names
288
- * @returns Array of caches with generation number
289
- */
290
- public async getCacheInvalidationGenerationsAsync(request: carriers.Diagnostics_GetCacheInvalidationGenerationsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CacheInvalidation[] >;
291
-
292
- /**
293
- * Get generation for provided names
294
- * @param names - Name of caches
295
- * @returns Array of caches with generation number
296
- */
297
- public async getCacheInvalidationGenerationsAsync(names: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CacheInvalidation[] >;
298
-
299
- public async getCacheInvalidationGenerationsAsync(names:string[]|carriers.Diagnostics_GetCacheInvalidationGenerationsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CacheInvalidation[] > {
300
- let _request : carriers.Diagnostics_GetCacheInvalidationGenerationsRequest = null;
301
- let _options : base.WebApiRequestOptions = null;
302
- const first : any = names;
303
- if( typeof( first ) === "object" && first && ( typeof(first.names)!='undefined' ) )
304
- {
305
- _request = names as carriers.Diagnostics_GetCacheInvalidationGenerationsRequest;
306
- _options = webapi_options as base.WebApiRequestOptions;
307
- }
308
- else
309
- {
310
- _request = {
311
- names: names as string[],
312
- };
313
- _options = webapi_options;
314
- }
315
- return this._getCacheInvalidationGenerationsAsync( _request, _options );
316
- }
317
-
318
-
319
- private async _getEntityCountsForCurrentUserAsync( options?:base.WebApiRequestOptions) : Promise< carriers.EntityCounts[] > {
320
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
321
- base.WebApiBase.SetPending(options);
322
- return new Promise< carriers.EntityCounts[] >(async (resolve, reject) => {
323
- try {
324
- config.baseURL = this._options.baseUrl;
325
- const response = await this._axios.post("GetEntityCountsForCurrentUser", undefined , config);
326
- base.WebApiBase.SetCompleted(options, response);
327
- const res : carriers.EntityCounts[] = converters.Create_EntityCountsArray_From( response.data );
328
- resolve(res);
329
- }
330
- catch( err ) {
331
- base.WebApiBase.HandleError(options, config, err);
332
- reject(err);
333
- }
334
- });
335
- }
336
-
337
-
338
- /**
339
- * Get an array of entities and number of entities created for the current associate
340
- * @returns Array of EntityCounts[] for the current associate
341
- */
342
- public async getEntityCountsForCurrentUserAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EntityCounts[] >
343
- {
344
- return this._getEntityCountsForCurrentUserAsync(webapi_options);
345
- }
346
-
347
-
348
- private async _getEntityCountsForAllUsersAsync( options?:base.WebApiRequestOptions) : Promise< carriers.EntityCounts[] > {
349
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
350
- base.WebApiBase.SetPending(options);
351
- return new Promise< carriers.EntityCounts[] >(async (resolve, reject) => {
352
- try {
353
- config.baseURL = this._options.baseUrl;
354
- const response = await this._axios.post("GetEntityCountsForAllUsers", undefined , config);
355
- base.WebApiBase.SetCompleted(options, response);
356
- const res : carriers.EntityCounts[] = converters.Create_EntityCountsArray_From( response.data );
357
- resolve(res);
358
- }
359
- catch( err ) {
360
- base.WebApiBase.HandleError(options, config, err);
361
- reject(err);
362
- }
363
- });
364
- }
365
-
366
-
367
- /**
368
- * Get an array of entities and number of entities created for all associates.
369
- * @returns Array of EntityCounts[] for all the users
370
- */
371
- public async getEntityCountsForAllUsersAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EntityCounts[] >
372
- {
373
- return this._getEntityCountsForAllUsersAsync(webapi_options);
374
- }
375
-
376
-
377
- private async _logViewStateAsync(request: carriers.Diagnostics_LogViewStateRequest, options?:base.WebApiRequestOptions) : Promise< void > {
378
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
379
- base.WebApiBase.SetPending(options);
380
- return new Promise< void >(async (resolve, reject) => {
381
- try {
382
- config.baseURL = this._options.baseUrl;
383
- const response = await this._axios.post("LogViewState", request , config);
384
- base.WebApiBase.SetCompleted(options, response);
385
- const res = response.data;
386
- resolve(res);
387
- }
388
- catch( err ) {
389
- base.WebApiBase.HandleError(options, config, err);
390
- reject(err);
391
- }
392
- });
393
- }
394
-
395
-
396
-
397
- /**
398
- * Log a change in view state. The granularity of the logging depends on the current configuration. This call returns asynchronously, leaving the server to finish processing later on.
399
- * @param request - ViewState
400
- * @returns
401
- */
402
- public async logViewStateAsync(request: carriers.Diagnostics_LogViewStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
403
-
404
- /**
405
- * Log a change in view state. The granularity of the logging depends on the current configuration. This call returns asynchronously, leaving the server to finish processing later on.
406
- * @param viewState - Current view state to be logged
407
- * @returns
408
- */
409
- public async logViewStateAsync(viewState: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
410
-
411
- public async logViewStateAsync(viewState:string|carriers.Diagnostics_LogViewStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
412
- let _request : carriers.Diagnostics_LogViewStateRequest = null;
413
- let _options : base.WebApiRequestOptions = null;
414
- const first : any = viewState;
415
- if( typeof( first ) === "object" && first && ( typeof(first.viewState)!='undefined' ) )
416
- {
417
- _request = viewState as carriers.Diagnostics_LogViewStateRequest;
418
- _options = webapi_options as base.WebApiRequestOptions;
419
- }
420
- else
421
- {
422
- _request = {
423
- viewState: viewState as string,
424
- };
425
- _options = webapi_options;
426
- }
427
- return this._logViewStateAsync( _request, _options );
428
- }
429
-
430
-
431
- private async _changeLogSettingsAsync(request: carriers.Diagnostics_ChangeLogSettingsRequest, options?:base.WebApiRequestOptions) : Promise< void > {
432
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
433
- base.WebApiBase.SetPending(options);
434
- return new Promise< void >(async (resolve, reject) => {
435
- try {
436
- config.baseURL = this._options.baseUrl;
437
- const response = await this._axios.post("ChangeLogSettings", request , config);
438
- base.WebApiBase.SetCompleted(options, response);
439
- const res = response.data;
440
- resolve(res);
441
- }
442
- catch( err ) {
443
- base.WebApiBase.HandleError(options, config, err);
444
- reject(err);
445
- }
446
- });
447
- }
448
-
449
-
450
-
451
- /**
452
- * Change NetServer log settings.
453
- * @param request - LogWarning, LogInformation, LogSuccessAudit, LogFailureAudit, LogToEventLog, LogToSuperOffice, LogToFile, LogToTrace
454
- * @returns
455
- */
456
- public async changeLogSettingsAsync(request: carriers.Diagnostics_ChangeLogSettingsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
457
-
458
- /**
459
- * Change NetServer log settings.
460
- * @param logWarning - Turn on warning log
461
- * @param logInformation - Turn on information log
462
- * @param logSuccessAudit - Turn on success audit log
463
- * @param logFailureAudit - Turn on failure audit log
464
- * @param logToEventLog - Log to event log
465
- * @param logToSuperOffice - Log to SuperOffice
466
- * @param logToFile - Log to file
467
- * @param logToTrace - Log to trace
468
- * @returns
469
- */
470
- public async changeLogSettingsAsync(logWarning: boolean, logInformation: boolean, logSuccessAudit: boolean, logFailureAudit: boolean, logToEventLog: boolean, logToSuperOffice: boolean, logToFile: boolean, logToTrace: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
471
-
472
- public async changeLogSettingsAsync(logWarning:boolean|carriers.Diagnostics_ChangeLogSettingsRequest, logInformation?:boolean|base.WebApiRequestOptions, logSuccessAudit?:boolean, logFailureAudit?:boolean, logToEventLog?:boolean, logToSuperOffice?:boolean, logToFile?:boolean, logToTrace?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
473
- let _request : carriers.Diagnostics_ChangeLogSettingsRequest = null;
474
- let _options : base.WebApiRequestOptions = null;
475
- const first : any = logWarning;
476
- if( typeof( first ) === "object" && first && ( typeof(first.logWarning)!='undefined' || typeof(first.logInformation)!='undefined' || typeof(first.logSuccessAudit)!='undefined' || typeof(first.logFailureAudit)!='undefined' || typeof(first.logToEventLog)!='undefined' || typeof(first.logToSuperOffice)!='undefined' || typeof(first.logToFile)!='undefined' || typeof(first.logToTrace)!='undefined' ) )
477
- {
478
- _request = logWarning as carriers.Diagnostics_ChangeLogSettingsRequest;
479
- _options = logInformation as base.WebApiRequestOptions;
480
- }
481
- else
482
- {
483
- _request = {
484
- logWarning: logWarning as boolean,
485
- logInformation: logInformation as boolean,
486
- logSuccessAudit: logSuccessAudit as boolean,
487
- logFailureAudit: logFailureAudit as boolean,
488
- logToEventLog: logToEventLog as boolean,
489
- logToSuperOffice: logToSuperOffice as boolean,
490
- logToFile: logToFile as boolean,
491
- logToTrace: logToTrace as boolean,
492
- };
493
- _options = webapi_options;
494
- }
495
- return this._changeLogSettingsAsync( _request, _options );
496
- }
497
-
498
-
499
- private async _collectDataAdditionsAsync( options?:base.WebApiRequestOptions) : Promise< void > {
500
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
501
- base.WebApiBase.SetPending(options);
502
- return new Promise< void >(async (resolve, reject) => {
503
- try {
504
- config.baseURL = this._options.baseUrl;
505
- const response = await this._axios.post("CollectDataAdditions", undefined , config);
506
- base.WebApiBase.SetCompleted(options, response);
507
- const res = response.data;
508
- resolve(res);
509
- }
510
- catch( err ) {
511
- base.WebApiBase.HandleError(options, config, err);
512
- reject(err);
513
- }
514
- });
515
- }
516
-
517
-
518
- /**
519
- * Collect and transmit usage statistics: Database Additions. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
520
- * @returns This method has no return value
521
- */
522
- public async collectDataAdditionsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
523
- {
524
- return this._collectDataAdditionsAsync(webapi_options);
525
- }
526
-
527
-
528
- private async _collectWinUsageAsync( options?:base.WebApiRequestOptions) : Promise< void > {
529
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
530
- base.WebApiBase.SetPending(options);
531
- return new Promise< void >(async (resolve, reject) => {
532
- try {
533
- config.baseURL = this._options.baseUrl;
534
- const response = await this._axios.post("CollectWinUsage", undefined , config);
535
- base.WebApiBase.SetCompleted(options, response);
536
- const res = response.data;
537
- resolve(res);
538
- }
539
- catch( err ) {
540
- base.WebApiBase.HandleError(options, config, err);
541
- reject(err);
542
- }
543
- });
544
- }
545
-
546
-
547
- /**
548
- * Collect and transmit usage statistics: Windows CRM Client Usage. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
549
- * @returns This method has no return value
550
- */
551
- public async collectWinUsageAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
552
- {
553
- return this._collectWinUsageAsync(webapi_options);
554
- }
555
-
556
-
557
- private async _collectWebUsageAsync( options?:base.WebApiRequestOptions) : Promise< void > {
558
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
559
- base.WebApiBase.SetPending(options);
560
- return new Promise< void >(async (resolve, reject) => {
561
- try {
562
- config.baseURL = this._options.baseUrl;
563
- const response = await this._axios.post("CollectWebUsage", undefined , config);
564
- base.WebApiBase.SetCompleted(options, response);
565
- const res = response.data;
566
- resolve(res);
567
- }
568
- catch( err ) {
569
- base.WebApiBase.HandleError(options, config, err);
570
- reject(err);
571
- }
572
- });
573
- }
574
-
575
-
576
- /**
577
- * Collect and transmit usage statistics: Web-based clients Usage. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
578
- * @returns This method has no return value
579
- */
580
- public async collectWebUsageAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
581
- {
582
- return this._collectWebUsageAsync(webapi_options);
583
- }
584
-
585
-
586
- private async _collectTableSizesAsync( options?:base.WebApiRequestOptions) : Promise< void > {
587
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
588
- base.WebApiBase.SetPending(options);
589
- return new Promise< void >(async (resolve, reject) => {
590
- try {
591
- config.baseURL = this._options.baseUrl;
592
- const response = await this._axios.post("CollectTableSizes", undefined , config);
593
- base.WebApiBase.SetCompleted(options, response);
594
- const res = response.data;
595
- resolve(res);
596
- }
597
- catch( err ) {
598
- base.WebApiBase.HandleError(options, config, err);
599
- reject(err);
600
- }
601
- });
602
- }
603
-
604
-
605
- /**
606
- * Collect and transmit usage statistics: Table Sizes. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
607
- * @returns This method has no return value
608
- */
609
- public async collectTableSizesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
610
- {
611
- return this._collectTableSizesAsync(webapi_options);
612
- }
613
-
614
-
615
- private async _resyncUsersAsync( options?:base.WebApiRequestOptions) : Promise< void > {
616
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
617
- base.WebApiBase.SetPending(options);
618
- return new Promise< void >(async (resolve, reject) => {
619
- try {
620
- config.baseURL = this._options.baseUrl;
621
- const response = await this._axios.post("ResyncUsers", undefined , config);
622
- base.WebApiBase.SetCompleted(options, response);
623
- const res = response.data;
624
- resolve(res);
625
- }
626
- catch( err ) {
627
- base.WebApiBase.HandleError(options, config, err);
628
- reject(err);
629
- }
630
- });
631
- }
632
-
633
-
634
- /**
635
- * Resynchronize user information with SuperOffice Community, if opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
636
- * @returns This method has no return value
637
- */
638
- public async resyncUsersAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
639
- {
640
- return this._resyncUsersAsync(webapi_options);
641
- }
642
-
643
-
644
- private async _sendSystemMessageAsync(request: carriers.Diagnostics_SendSystemMessageRequest, options?:base.WebApiRequestOptions) : Promise< void > {
645
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
646
- base.WebApiBase.SetPending(options);
647
- return new Promise< void >(async (resolve, reject) => {
648
- try {
649
- config.baseURL = this._options.baseUrl;
650
- const response = await this._axios.post("SendSystemMessage", request , config);
651
- base.WebApiBase.SetCompleted(options, response);
652
- const res = response.data;
653
- resolve(res);
654
- }
655
- catch( err ) {
656
- base.WebApiBase.HandleError(options, config, err);
657
- reject(err);
658
- }
659
- });
660
- }
661
-
662
-
663
-
664
- /**
665
- * Adds a system message for a specific associate.
666
- * @param request - SystemMessageId, AssociateId, MarkdownMessage, Expire, Type
667
- * @returns
668
- */
669
- public async sendSystemMessageAsync(request: carriers.Diagnostics_SendSystemMessageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
670
-
671
- /**
672
- * Adds a system message for a specific associate.
673
- * @param systemMessageId - The message string id
674
- * @param associateId - The associateId of the message target.
675
- * @param markdownMessage - Markdown message to be displayed to the user
676
- * @param expire - When the message will no longer be available
677
- * @param type - Type of message, example: info, warning, error
678
- * @returns
679
- */
680
- public async sendSystemMessageAsync(systemMessageId: string, associateId: number, markdownMessage: string, expire: Date, type: enums.SystemMessageType, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
681
-
682
- public async sendSystemMessageAsync(systemMessageId:string|carriers.Diagnostics_SendSystemMessageRequest, associateId?:number|base.WebApiRequestOptions, markdownMessage?:string, expire?:Date, type?:enums.SystemMessageType, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
683
- let _request : carriers.Diagnostics_SendSystemMessageRequest = null;
684
- let _options : base.WebApiRequestOptions = null;
685
- const first : any = systemMessageId;
686
- if( typeof( first ) === "object" && first && ( typeof(first.systemMessageId)!='undefined' || typeof(first.associateId)!='undefined' || typeof(first.markdownMessage)!='undefined' || typeof(first.expire)!='undefined' || typeof(first.type)!='undefined' ) )
687
- {
688
- _request = systemMessageId as carriers.Diagnostics_SendSystemMessageRequest;
689
- _options = associateId as base.WebApiRequestOptions;
690
- }
691
- else
692
- {
693
- _request = {
694
- systemMessageId: systemMessageId as string,
695
- associateId: associateId as number,
696
- markdownMessage: markdownMessage as string,
697
- expire: expire as Date,
698
- type: type as enums.SystemMessageType,
699
- };
700
- _options = webapi_options;
701
- }
702
- return this._sendSystemMessageAsync( _request, _options );
703
- }
704
-
705
-
706
- private async _removeSystemMessageAsync(request: carriers.Diagnostics_RemoveSystemMessageRequest, options?:base.WebApiRequestOptions) : Promise< void > {
707
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
708
- base.WebApiBase.SetPending(options);
709
- return new Promise< void >(async (resolve, reject) => {
710
- try {
711
- config.baseURL = this._options.baseUrl;
712
- const response = await this._axios.post("RemoveSystemMessage", request , config);
713
- base.WebApiBase.SetCompleted(options, response);
714
- const res = response.data;
715
- resolve(res);
716
- }
717
- catch( err ) {
718
- base.WebApiBase.HandleError(options, config, err);
719
- reject(err);
720
- }
721
- });
722
- }
723
-
724
-
725
-
726
- /**
727
- * Removes a system message for current associate
728
- * @param request - OnlineappId, SystemMessageId
729
- * @returns
730
- */
731
- public async removeSystemMessageAsync(request: carriers.Diagnostics_RemoveSystemMessageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
732
-
733
- /**
734
- * Removes a system message for current associate
735
- * @param onlineappId - Id of the online app that owns this message
736
- * @param systemMessageId - Message identifier, used for message removal
737
- * @returns
738
- */
739
- public async removeSystemMessageAsync(onlineappId: number, systemMessageId: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
740
-
741
- public async removeSystemMessageAsync(onlineappId:number|carriers.Diagnostics_RemoveSystemMessageRequest, systemMessageId?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
742
- let _request : carriers.Diagnostics_RemoveSystemMessageRequest = null;
743
- let _options : base.WebApiRequestOptions = null;
744
- const first : any = onlineappId;
745
- if( typeof( first ) === "object" && first && ( typeof(first.onlineappId)!='undefined' || typeof(first.systemMessageId)!='undefined' ) )
746
- {
747
- _request = onlineappId as carriers.Diagnostics_RemoveSystemMessageRequest;
748
- _options = systemMessageId as base.WebApiRequestOptions;
749
- }
750
- else
751
- {
752
- _request = {
753
- onlineappId: onlineappId as number,
754
- systemMessageId: systemMessageId as string,
755
- };
756
- _options = webapi_options;
757
- }
758
- return this._removeSystemMessageAsync( _request, _options );
759
- }
760
-
761
-
762
- private async _removeSystemMessageForAssociateAsync(request: carriers.Diagnostics_RemoveSystemMessageForAssociateRequest, options?:base.WebApiRequestOptions) : Promise< void > {
763
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
764
- base.WebApiBase.SetPending(options);
765
- return new Promise< void >(async (resolve, reject) => {
766
- try {
767
- config.baseURL = this._options.baseUrl;
768
- const response = await this._axios.post("RemoveSystemMessageForAssociate", request , config);
769
- base.WebApiBase.SetCompleted(options, response);
770
- const res = response.data;
771
- resolve(res);
772
- }
773
- catch( err ) {
774
- base.WebApiBase.HandleError(options, config, err);
775
- reject(err);
776
- }
777
- });
778
- }
779
-
780
-
781
-
782
- /**
783
- * Removes a system message for specific associate.
784
- * @param request - OnlineappId, SystemMessageId, AssociateId
785
- * @returns
786
- */
787
- public async removeSystemMessageForAssociateAsync(request: carriers.Diagnostics_RemoveSystemMessageForAssociateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
788
-
789
- /**
790
- * Removes a system message for specific associate.
791
- * @param onlineappId - Id of the online app that owns this message
792
- * @param systemMessageId - Message identifier, used for message update or removal
793
- * @param associateId - The associateId of the message target.
794
- * @returns
795
- */
796
- public async removeSystemMessageForAssociateAsync(onlineappId: number, systemMessageId: string, associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
797
-
798
- public async removeSystemMessageForAssociateAsync(onlineappId:number|carriers.Diagnostics_RemoveSystemMessageForAssociateRequest, systemMessageId?:string|base.WebApiRequestOptions, associateId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
799
- let _request : carriers.Diagnostics_RemoveSystemMessageForAssociateRequest = null;
800
- let _options : base.WebApiRequestOptions = null;
801
- const first : any = onlineappId;
802
- if( typeof( first ) === "object" && first && ( typeof(first.onlineappId)!='undefined' || typeof(first.systemMessageId)!='undefined' || typeof(first.associateId)!='undefined' ) )
803
- {
804
- _request = onlineappId as carriers.Diagnostics_RemoveSystemMessageForAssociateRequest;
805
- _options = systemMessageId as base.WebApiRequestOptions;
806
- }
807
- else
808
- {
809
- _request = {
810
- onlineappId: onlineappId as number,
811
- systemMessageId: systemMessageId as string,
812
- associateId: associateId as number,
813
- };
814
- _options = webapi_options;
815
- }
816
- return this._removeSystemMessageForAssociateAsync( _request, _options );
817
- }
818
-
819
-
820
- private async _getSystemMessagesAsync(request: carriers.Diagnostics_GetSystemMessagesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SystemMessage[] > {
821
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
822
- base.WebApiBase.SetPending(options);
823
- return new Promise< carriers.SystemMessage[] >(async (resolve, reject) => {
824
- try {
825
- config.baseURL = this._options.baseUrl;
826
- const response = await this._axios.post("GetSystemMessages", request , config);
827
- base.WebApiBase.SetCompleted(options, response);
828
- const res : carriers.SystemMessage[] = converters.Create_SystemMessageArray_From( response.data );
829
- resolve(res);
830
- }
831
- catch( err ) {
832
- base.WebApiBase.HandleError(options, config, err);
833
- reject(err);
834
- }
835
- });
836
- }
837
-
838
-
839
-
840
- /**
841
- * Retrieves a list of system messages for a specific associate.
842
- * @param request - AssociateId
843
- * @returns List of SystemMessages for desired associate
844
- */
845
- public async getSystemMessagesAsync(request: carriers.Diagnostics_GetSystemMessagesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemMessage[] >;
846
-
847
- /**
848
- * Retrieves a list of system messages for a specific associate.
849
- * @param associateId - The associateId of the message target.
850
- * @returns List of SystemMessages for desired associate
851
- */
852
- public async getSystemMessagesAsync(associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemMessage[] >;
853
-
854
- public async getSystemMessagesAsync(associateId:number|carriers.Diagnostics_GetSystemMessagesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemMessage[] > {
855
- let _request : carriers.Diagnostics_GetSystemMessagesRequest = null;
856
- let _options : base.WebApiRequestOptions = null;
857
- const first : any = associateId;
858
- if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' ) )
859
- {
860
- _request = associateId as carriers.Diagnostics_GetSystemMessagesRequest;
861
- _options = webapi_options as base.WebApiRequestOptions;
862
- }
863
- else
864
- {
865
- _request = {
866
- associateId: associateId as number,
867
- };
868
- _options = webapi_options;
869
- }
870
- return this._getSystemMessagesAsync( _request, _options );
871
- }
872
-
873
-
874
- private async _removeExpiredSystemMessagesAsync( options?:base.WebApiRequestOptions) : Promise< void > {
875
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
876
- base.WebApiBase.SetPending(options);
877
- return new Promise< void >(async (resolve, reject) => {
878
- try {
879
- config.baseURL = this._options.baseUrl;
880
- const response = await this._axios.post("RemoveExpiredSystemMessages", undefined , config);
881
- base.WebApiBase.SetCompleted(options, response);
882
- const res = response.data;
883
- resolve(res);
884
- }
885
- catch( err ) {
886
- base.WebApiBase.HandleError(options, config, err);
887
- reject(err);
888
- }
889
- });
890
- }
891
-
892
-
893
- /**
894
- * Deletes expired system messages.
895
- * @returns
896
- */
897
- public async removeExpiredSystemMessagesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
898
- {
899
- return this._removeExpiredSystemMessagesAsync(webapi_options);
900
- }
901
-
902
-
903
- private async _getNextTableNumberAsync( options?:base.WebApiRequestOptions) : Promise< number > {
904
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
905
- base.WebApiBase.SetPending(options);
906
- return new Promise< number >(async (resolve, reject) => {
907
- try {
908
- config.baseURL = this._options.baseUrl;
909
- const response = await this._axios.post("GetNextTableNumber", undefined , config);
910
- base.WebApiBase.SetCompleted(options, response);
911
- const res : number = response.data as number;
912
- resolve(res);
913
- }
914
- catch( err ) {
915
- base.WebApiBase.HandleError(options, config, err);
916
- reject(err);
917
- }
918
- });
919
- }
920
-
921
-
922
- /**
923
- * Increment save and return NextTableNumber, to be used when creating new extra table
924
- * @returns NextTableNumber of DatabaseModel
925
- */
926
- public async getNextTableNumberAsync(webapi_options?:base.WebApiRequestOptions) : Promise< number >
927
- {
928
- return this._getNextTableNumberAsync(webapi_options);
929
- }
930
-
931
-
932
- private async _performTasksAfterUpgradeAsync( options?:base.WebApiRequestOptions) : Promise< string > {
933
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
934
- base.WebApiBase.SetPending(options);
935
- return new Promise< string >(async (resolve, reject) => {
936
- try {
937
- config.baseURL = this._options.baseUrl;
938
- const response = await this._axios.post("PerformTasksAfterUpgrade", undefined , config);
939
- base.WebApiBase.SetCompleted(options, response);
940
- const res : string = response.data as string;
941
- resolve(res);
942
- }
943
- catch( err ) {
944
- base.WebApiBase.HandleError(options, config, err);
945
- reject(err);
946
- }
947
- });
948
- }
949
-
950
-
951
- /**
952
- * After upgrading to a new fileset, there may be tasks that need to be done. Examples - import new TypicalSearches, if present. Tasks performed here need to be idempotent and independent of the actual upgrade jump (what was the previous version). They should complete in a reasonable time, not more than a few minutes maximum.
953
- * @returns Message that can be shown to the user, summarizing what has been done, if anything.
954
- */
955
- public async performTasksAfterUpgradeAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string >
956
- {
957
- return this._performTasksAfterUpgradeAsync(webapi_options);
958
- }
959
-
960
-
961
- private async _performTasksAfterCustomObjectTableCreatedAsync(request: carriers.Diagnostics_PerformTasksAfterCustomObjectTableCreatedRequest, options?:base.WebApiRequestOptions) : Promise< void > {
962
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
963
- base.WebApiBase.SetPending(options);
964
- return new Promise< void >(async (resolve, reject) => {
965
- try {
966
- config.baseURL = this._options.baseUrl;
967
- const response = await this._axios.post("PerformTasksAfterCustomObjectTableCreated", request , config);
968
- base.WebApiBase.SetCompleted(options, response);
969
- const res = response.data;
970
- resolve(res);
971
- }
972
- catch( err ) {
973
- base.WebApiBase.HandleError(options, config, err);
974
- reject(err);
975
- }
976
- });
977
- }
978
-
979
-
980
-
981
- /**
982
- * A temporary method to be used from c++ until CustomObjectsAgent.CreateTable implemented in NetServer
983
- * @param request - TableName
984
- * @returns This method has no return value
985
- */
986
- public async performTasksAfterCustomObjectTableCreatedAsync(request: carriers.Diagnostics_PerformTasksAfterCustomObjectTableCreatedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
987
-
988
- /**
989
- * A temporary method to be used from c++ until CustomObjectsAgent.CreateTable implemented in NetServer
990
- * @param tableName - Name of DB table of the custom object that was created. E.g., 'y_car'
991
- * @returns This method has no return value
992
- */
993
- public async performTasksAfterCustomObjectTableCreatedAsync(tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
994
-
995
- public async performTasksAfterCustomObjectTableCreatedAsync(tableName:string|carriers.Diagnostics_PerformTasksAfterCustomObjectTableCreatedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
996
- let _request : carriers.Diagnostics_PerformTasksAfterCustomObjectTableCreatedRequest = null;
997
- let _options : base.WebApiRequestOptions = null;
998
- const first : any = tableName;
999
- if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' ) )
1000
- {
1001
- _request = tableName as carriers.Diagnostics_PerformTasksAfterCustomObjectTableCreatedRequest;
1002
- _options = webapi_options as base.WebApiRequestOptions;
1003
- }
1004
- else
1005
- {
1006
- _request = {
1007
- tableName: tableName as string,
1008
- };
1009
- _options = webapi_options;
1010
- }
1011
- return this._performTasksAfterCustomObjectTableCreatedAsync( _request, _options );
1012
- }
1013
-
1014
-
1015
- private async _performTasksAfterCustomObjectTableDeletedAsync(request: carriers.Diagnostics_PerformTasksAfterCustomObjectTableDeletedRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1016
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1017
- base.WebApiBase.SetPending(options);
1018
- return new Promise< void >(async (resolve, reject) => {
1019
- try {
1020
- config.baseURL = this._options.baseUrl;
1021
- const response = await this._axios.post("PerformTasksAfterCustomObjectTableDeleted", request , config);
1022
- base.WebApiBase.SetCompleted(options, response);
1023
- const res = response.data;
1024
- resolve(res);
1025
- }
1026
- catch( err ) {
1027
- base.WebApiBase.HandleError(options, config, err);
1028
- reject(err);
1029
- }
1030
- });
1031
- }
1032
-
1033
-
1034
-
1035
- /**
1036
- * A temporary method to be used from c++ until CustomObjectsAgent.DeleteTable implemented in NetServer
1037
- * @param request - TableName
1038
- * @returns This method has no return value
1039
- */
1040
- public async performTasksAfterCustomObjectTableDeletedAsync(request: carriers.Diagnostics_PerformTasksAfterCustomObjectTableDeletedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1041
-
1042
- /**
1043
- * A temporary method to be used from c++ until CustomObjectsAgent.DeleteTable implemented in NetServer
1044
- * @param tableName - Name of DB table of the custom object that was deleted. E.g., 'y_car'
1045
- * @returns This method has no return value
1046
- */
1047
- public async performTasksAfterCustomObjectTableDeletedAsync(tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1048
-
1049
- public async performTasksAfterCustomObjectTableDeletedAsync(tableName:string|carriers.Diagnostics_PerformTasksAfterCustomObjectTableDeletedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1050
- let _request : carriers.Diagnostics_PerformTasksAfterCustomObjectTableDeletedRequest = null;
1051
- let _options : base.WebApiRequestOptions = null;
1052
- const first : any = tableName;
1053
- if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' ) )
1054
- {
1055
- _request = tableName as carriers.Diagnostics_PerformTasksAfterCustomObjectTableDeletedRequest;
1056
- _options = webapi_options as base.WebApiRequestOptions;
1057
- }
1058
- else
1059
- {
1060
- _request = {
1061
- tableName: tableName as string,
1062
- };
1063
- _options = webapi_options;
1064
- }
1065
- return this._performTasksAfterCustomObjectTableDeletedAsync( _request, _options );
1066
- }
1067
-
1068
-
1069
- private async _addWebAppUsageAsync(request: carriers.Diagnostics_AddWebAppUsageRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1070
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1071
- base.WebApiBase.SetPending(options);
1072
- return new Promise< void >(async (resolve, reject) => {
1073
- try {
1074
- config.baseURL = this._options.baseUrl;
1075
- const response = await this._axios.post("AddWebAppUsage", request , config);
1076
- base.WebApiBase.SetCompleted(options, response);
1077
- const res = response.data;
1078
- resolve(res);
1079
- }
1080
- catch( err ) {
1081
- base.WebApiBase.HandleError(options, config, err);
1082
- reject(err);
1083
- }
1084
- });
1085
- }
1086
-
1087
-
1088
-
1089
- /**
1090
- * Adds WebApp usage to existing log
1091
- * @param request - WebAppUsages
1092
- * @returns
1093
- */
1094
- public async addWebAppUsageAsync(request: carriers.Diagnostics_AddWebAppUsageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1095
-
1096
- /**
1097
- * Adds WebApp usage to existing log
1098
- * @param webAppUsages - Web app usage.
1099
- * @returns
1100
- */
1101
- public async addWebAppUsageAsync(webAppUsages: carriers.WebAppUsage[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1102
-
1103
- public async addWebAppUsageAsync(webAppUsages:carriers.WebAppUsage[]|carriers.Diagnostics_AddWebAppUsageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1104
- let _request : carriers.Diagnostics_AddWebAppUsageRequest = null;
1105
- let _options : base.WebApiRequestOptions = null;
1106
- const first : any = webAppUsages;
1107
- if( typeof( first ) === "object" && first && ( typeof(first.webAppUsages)!='undefined' ) )
1108
- {
1109
- _request = webAppUsages as carriers.Diagnostics_AddWebAppUsageRequest;
1110
- _options = webapi_options as base.WebApiRequestOptions;
1111
- }
1112
- else
1113
- {
1114
- _request = {
1115
- webAppUsages: webAppUsages as carriers.WebAppUsage[],
1116
- };
1117
- _options = webapi_options;
1118
- }
1119
- return this._addWebAppUsageAsync( _request, _options );
1120
- }
1121
-
1122
-
1123
- private async _webAppUsageExistsInPeriodAsync(request: carriers.Diagnostics_WebAppUsageExistsInPeriodRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
1124
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1125
- base.WebApiBase.SetPending(options);
1126
- return new Promise< boolean >(async (resolve, reject) => {
1127
- try {
1128
- config.baseURL = this._options.baseUrl;
1129
- const response = await this._axios.post("WebAppUsageExistsInPeriod", request , config);
1130
- base.WebApiBase.SetCompleted(options, response);
1131
- const res : boolean = response.data as boolean;
1132
- resolve(res);
1133
- }
1134
- catch( err ) {
1135
- base.WebApiBase.HandleError(options, config, err);
1136
- reject(err);
1137
- }
1138
- });
1139
- }
1140
-
1141
-
1142
-
1143
- /**
1144
- * Returns true if viewState has been clicked at least once since FromDate, if asscoiateId &lt; 0 or FromDate is DateTime.MinValue no restriction given for those parameters
1145
- * @param request - AssociateId, ViewState, FromDate
1146
- * @returns Returns true if viewState has been clicked at least once since FromDate
1147
- */
1148
- public async webAppUsageExistsInPeriodAsync(request: carriers.Diagnostics_WebAppUsageExistsInPeriodRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
1149
-
1150
- /**
1151
- * Returns true if viewState has been clicked at least once since FromDate, if asscoiateId &lt; 0 or FromDate is DateTime.MinValue no restriction given for those parameters
1152
- * @param associateId - The asscoiate id to look for webapp usage
1153
- * @param viewState - The viewState to search for
1154
- * @param fromDate - The datetime to restrict webapp usage on
1155
- * @returns Returns true if viewState has been clicked at least once since FromDate
1156
- */
1157
- public async webAppUsageExistsInPeriodAsync(associateId: number, viewState: string, fromDate: Date, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
1158
-
1159
- public async webAppUsageExistsInPeriodAsync(associateId:number|carriers.Diagnostics_WebAppUsageExistsInPeriodRequest, viewState?:string|base.WebApiRequestOptions, fromDate?:Date, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
1160
- let _request : carriers.Diagnostics_WebAppUsageExistsInPeriodRequest = null;
1161
- let _options : base.WebApiRequestOptions = null;
1162
- const first : any = associateId;
1163
- if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' || typeof(first.viewState)!='undefined' || typeof(first.fromDate)!='undefined' ) )
1164
- {
1165
- _request = associateId as carriers.Diagnostics_WebAppUsageExistsInPeriodRequest;
1166
- _options = viewState as base.WebApiRequestOptions;
1167
- }
1168
- else
1169
- {
1170
- _request = {
1171
- associateId: associateId as number,
1172
- viewState: viewState as string,
1173
- fromDate: fromDate as Date,
1174
- };
1175
- _options = webapi_options;
1176
- }
1177
- return this._webAppUsageExistsInPeriodAsync( _request, _options );
1178
- }
1179
-
1180
-
1181
- private async _getWebAppUsagesForPeriodAsync(request: carriers.Diagnostics_GetWebAppUsagesForPeriodRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WebAppUsage[] > {
1182
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1183
- base.WebApiBase.SetPending(options);
1184
- return new Promise< carriers.WebAppUsage[] >(async (resolve, reject) => {
1185
- try {
1186
- config.baseURL = this._options.baseUrl;
1187
- const response = await this._axios.post("GetWebAppUsagesForPeriod", request , config);
1188
- base.WebApiBase.SetCompleted(options, response);
1189
- const res : carriers.WebAppUsage[] = converters.Create_WebAppUsageArray_From( response.data );
1190
- resolve(res);
1191
- }
1192
- catch( err ) {
1193
- base.WebApiBase.HandleError(options, config, err);
1194
- reject(err);
1195
- }
1196
- });
1197
- }
1198
-
1199
-
1200
-
1201
- /**
1202
- * Get all WebAppUsages for a given period, that match an optional search term
1203
- * @param request - FromDate, ToDate, SearchTerm
1204
- * @returns
1205
- */
1206
- public async getWebAppUsagesForPeriodAsync(request: carriers.Diagnostics_GetWebAppUsagesForPeriodRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WebAppUsage[] >;
1207
-
1208
- /**
1209
- * Get all WebAppUsages for a given period, that match an optional search term
1210
- * @param fromDate -
1211
- * @param toDate -
1212
- * @param searchTerm - ViewState search term. '%' is the wildcard character, for example 'Pocket%' will match all viewstates starting with 'Pocket'. If empty, all viewstates will be matched
1213
- * @returns
1214
- */
1215
- public async getWebAppUsagesForPeriodAsync(fromDate: Date, toDate: Date, searchTerm: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WebAppUsage[] >;
1216
-
1217
- public async getWebAppUsagesForPeriodAsync(fromDate:Date|carriers.Diagnostics_GetWebAppUsagesForPeriodRequest, toDate?:Date|base.WebApiRequestOptions, searchTerm?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WebAppUsage[] > {
1218
- let _request : carriers.Diagnostics_GetWebAppUsagesForPeriodRequest = null;
1219
- let _options : base.WebApiRequestOptions = null;
1220
- const first : any = fromDate;
1221
- if( typeof( first ) === "object" && first && ( typeof(first.fromDate)!='undefined' || typeof(first.toDate)!='undefined' || typeof(first.searchTerm)!='undefined' ) )
1222
- {
1223
- _request = fromDate as carriers.Diagnostics_GetWebAppUsagesForPeriodRequest;
1224
- _options = toDate as base.WebApiRequestOptions;
1225
- }
1226
- else
1227
- {
1228
- _request = {
1229
- fromDate: fromDate as Date,
1230
- toDate: toDate as Date,
1231
- searchTerm: searchTerm as string,
1232
- };
1233
- _options = webapi_options;
1234
- }
1235
- return this._getWebAppUsagesForPeriodAsync( _request, _options );
1236
- }
1237
-
1238
- } // class v1DiagnosticsAgentController
1239
-
1240
-
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/DiagnosticsAgent.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
+ * Diagnostics, usage data collection, caches and flushing
28
+ */
29
+ export interface IDiagnosticsAgent {
30
+ getAnalyticsDataAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.AnalyticsData >;
31
+ flushCachesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
32
+ getCacheNamesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
33
+ flushCachesByNameAsync(request: carriers.Diagnostics_FlushCachesByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
34
+ flushCachesByNameAsync(cacheNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
35
+ getCacheStateAsync(request: carriers.Diagnostics_GetCacheStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
36
+ getCacheStateAsync(cacheNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< string >;
37
+ getCacheInvalidationGenerationsAsync(request: carriers.Diagnostics_GetCacheInvalidationGenerationsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CacheInvalidation[] >;
38
+ getCacheInvalidationGenerationsAsync(names: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CacheInvalidation[] >;
39
+ getEntityCountsForCurrentUserAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EntityCounts[] >;
40
+ getEntityCountsForAllUsersAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EntityCounts[] >;
41
+ logViewStateAsync(request: carriers.Diagnostics_LogViewStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
42
+ logViewStateAsync(viewState: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
43
+ changeLogSettingsAsync(request: carriers.Diagnostics_ChangeLogSettingsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
44
+ changeLogSettingsAsync(logWarning: boolean, logInformation: boolean, logSuccessAudit: boolean, logFailureAudit: boolean, logToEventLog: boolean, logToSuperOffice: boolean, logToFile: boolean, logToTrace: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
45
+ trackEventAsync(request: carriers.Diagnostics_TrackEventRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
46
+ trackEventAsync(trackEventName: string, eventProperties: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
47
+ trackUserAsync(request: carriers.Diagnostics_TrackUserRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
48
+ trackUserAsync(userProperties: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
49
+ collectDataAdditionsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
50
+ collectWinUsageAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
51
+ collectWebUsageAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
52
+ collectTableSizesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
53
+ resyncUsersAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
54
+ sendSystemMessageAsync(request: carriers.Diagnostics_SendSystemMessageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
55
+ sendSystemMessageAsync(systemMessageId: string, associateId: number, markdownMessage: string, expire: Date, type: enums.SystemMessageType, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
56
+ removeSystemMessageAsync(request: carriers.Diagnostics_RemoveSystemMessageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
57
+ removeSystemMessageAsync(onlineappId: number, systemMessageId: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
58
+ removeSystemMessageForAssociateAsync(request: carriers.Diagnostics_RemoveSystemMessageForAssociateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
59
+ removeSystemMessageForAssociateAsync(onlineappId: number, systemMessageId: string, associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
60
+ getSystemMessagesAsync(request: carriers.Diagnostics_GetSystemMessagesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemMessage[] >;
61
+ getSystemMessagesAsync(associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemMessage[] >;
62
+ removeExpiredSystemMessagesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >;
63
+ getNextTableNumberAsync(webapi_options?:base.WebApiRequestOptions) : Promise< number >;
64
+ performTasksAfterUpgradeAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string >;
65
+ performTasksAfterCustomObjectTableCreatedAsync(request: carriers.Diagnostics_PerformTasksAfterCustomObjectTableCreatedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
66
+ performTasksAfterCustomObjectTableCreatedAsync(tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
67
+ performTasksAfterCustomObjectTableDeletedAsync(request: carriers.Diagnostics_PerformTasksAfterCustomObjectTableDeletedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
68
+ performTasksAfterCustomObjectTableDeletedAsync(tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
69
+ addWebAppUsageAsync(request: carriers.Diagnostics_AddWebAppUsageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
70
+ addWebAppUsageAsync(webAppUsages: carriers.WebAppUsage[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
71
+ webAppUsageExistsInPeriodAsync(request: carriers.Diagnostics_WebAppUsageExistsInPeriodRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
72
+ webAppUsageExistsInPeriodAsync(associateId: number, viewState: string, fromDate: Date, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
73
+ getWebAppUsagesForPeriodAsync(request: carriers.Diagnostics_GetWebAppUsagesForPeriodRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WebAppUsage[] >;
74
+ getWebAppUsagesForPeriodAsync(fromDate: Date, toDate: Date, searchTerm: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WebAppUsage[] >;
75
+ } // interface IDiagnosticsAgent
76
+
77
+
78
+
79
+
80
+ /**
81
+ * Diagnostics, usage data collection, caches and flushing
82
+ */
83
+ export class DiagnosticsAgent extends base.WebApiBase implements IDiagnosticsAgent {
84
+ constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
85
+ constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
86
+ constructor(baseUrl: string, resourceManager:any);
87
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
88
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
89
+ constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
90
+ constructor(options: base.WebApiOptions);
91
+
92
+ constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
93
+ langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
94
+ langOrResourceOrRM?:string|base.ResourceParsing|any,
95
+ cultureCode?: string,
96
+ ) {
97
+ const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
98
+ options.basePath = "v1/Agents/Diagnostics/";
99
+ super(options);
100
+ }
101
+
102
+
103
+
104
+ private async _getAnalyticsDataAsync( options?:base.WebApiRequestOptions) : Promise< carriers.AnalyticsData > {
105
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
106
+ base.WebApiBase.SetPending(options);
107
+ return new Promise< carriers.AnalyticsData >(async (resolve, reject) => {
108
+ try {
109
+ config.baseURL = this._options.baseUrl;
110
+ const response = await this._axios.post("GetAnalyticsData", undefined , config);
111
+ base.WebApiBase.SetCompleted(options, response);
112
+ const res : carriers.AnalyticsData = converters.Create_AnalyticsData_From( response.data );
113
+ resolve(res);
114
+ }
115
+ catch( err ) {
116
+ base.WebApiBase.HandleError(options, config, err);
117
+ reject(err);
118
+ }
119
+ });
120
+ }
121
+
122
+
123
+ /**
124
+ * Retrieve analytics properties to be included in usage tracking.
125
+ * @returns Description Analytics Data
126
+ */
127
+ public async getAnalyticsDataAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.AnalyticsData >
128
+ {
129
+ return this._getAnalyticsDataAsync(webapi_options);
130
+ }
131
+
132
+
133
+ private async _flushCachesAsync( options?:base.WebApiRequestOptions) : Promise< void > {
134
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
135
+ base.WebApiBase.SetPending(options);
136
+ return new Promise< void >(async (resolve, reject) => {
137
+ try {
138
+ config.baseURL = this._options.baseUrl;
139
+ const response = await this._axios.post("FlushCaches", undefined , config);
140
+ base.WebApiBase.SetCompleted(options, response);
141
+ const res = response.data;
142
+ resolve(res);
143
+ }
144
+ catch( err ) {
145
+ base.WebApiBase.HandleError(options, config, err);
146
+ reject(err);
147
+ }
148
+ });
149
+ }
150
+
151
+
152
+ /**
153
+ * Flushes all NetServer caches
154
+ * @returns
155
+ */
156
+ public async flushCachesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
157
+ {
158
+ return this._flushCachesAsync(webapi_options);
159
+ }
160
+
161
+
162
+ private async _getCacheNamesAsync( options?:base.WebApiRequestOptions) : Promise< string[] > {
163
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
164
+ base.WebApiBase.SetPending(options);
165
+ return new Promise< string[] >(async (resolve, reject) => {
166
+ try {
167
+ config.baseURL = this._options.baseUrl;
168
+ const response = await this._axios.post("GetCacheNames", undefined , config);
169
+ base.WebApiBase.SetCompleted(options, response);
170
+ const res : string[] = response.data as string[];
171
+ resolve(res);
172
+ }
173
+ catch( err ) {
174
+ base.WebApiBase.HandleError(options, config, err);
175
+ reject(err);
176
+ }
177
+ });
178
+ }
179
+
180
+
181
+ /**
182
+ * Get the name of the caches that can be flushed
183
+ * @returns Name of the caches that can be flusehd
184
+ */
185
+ public async getCacheNamesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string[] >
186
+ {
187
+ return this._getCacheNamesAsync(webapi_options);
188
+ }
189
+
190
+
191
+ private async _flushCachesByNameAsync(request: carriers.Diagnostics_FlushCachesByNameRequest, options?:base.WebApiRequestOptions) : Promise< void > {
192
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
193
+ base.WebApiBase.SetPending(options);
194
+ return new Promise< void >(async (resolve, reject) => {
195
+ try {
196
+ config.baseURL = this._options.baseUrl;
197
+ const response = await this._axios.post("FlushCachesByName", request , config);
198
+ base.WebApiBase.SetCompleted(options, response);
199
+ const res = response.data;
200
+ resolve(res);
201
+ }
202
+ catch( err ) {
203
+ base.WebApiBase.HandleError(options, config, err);
204
+ reject(err);
205
+ }
206
+ });
207
+ }
208
+
209
+
210
+
211
+ /**
212
+ * Flushes all NetServer caches named
213
+ * @param request - CacheNames
214
+ * @returns This method has no return value
215
+ */
216
+ public async flushCachesByNameAsync(request: carriers.Diagnostics_FlushCachesByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
217
+
218
+ /**
219
+ * Flushes all NetServer caches named
220
+ * @param cacheNames - Name of the cachnes to flush
221
+ * @returns This method has no return value
222
+ */
223
+ public async flushCachesByNameAsync(cacheNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
224
+
225
+ public async flushCachesByNameAsync(cacheNames:string[]|carriers.Diagnostics_FlushCachesByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
226
+ let _request : carriers.Diagnostics_FlushCachesByNameRequest = null;
227
+ let _options : base.WebApiRequestOptions = null;
228
+ const first : any = cacheNames;
229
+ if( typeof( first ) === "object" && first && ( typeof(first.cacheNames)!='undefined' ) )
230
+ {
231
+ _request = cacheNames as carriers.Diagnostics_FlushCachesByNameRequest;
232
+ _options = webapi_options as base.WebApiRequestOptions;
233
+ }
234
+ else
235
+ {
236
+ _request = {
237
+ cacheNames: cacheNames as string[],
238
+ };
239
+ _options = webapi_options;
240
+ }
241
+ return this._flushCachesByNameAsync( _request, _options );
242
+ }
243
+
244
+
245
+ private async _getCacheStateAsync(request: carriers.Diagnostics_GetCacheStateRequest, options?:base.WebApiRequestOptions) : Promise< string > {
246
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
247
+ base.WebApiBase.SetPending(options);
248
+ return new Promise< string >(async (resolve, reject) => {
249
+ try {
250
+ config.baseURL = this._options.baseUrl;
251
+ const response = await this._axios.post("GetCacheState", request , config);
252
+ base.WebApiBase.SetCompleted(options, response);
253
+ const res : string = response.data as string;
254
+ resolve(res);
255
+ }
256
+ catch( err ) {
257
+ base.WebApiBase.HandleError(options, config, err);
258
+ reject(err);
259
+ }
260
+ });
261
+ }
262
+
263
+
264
+
265
+ /**
266
+ * Get the current generation value of the named caches. State is opaque.
267
+ * @param request - CacheNames
268
+ * @returns Current state of the caches named. If not the same as previous value, then it is time to flush
269
+ */
270
+ public async getCacheStateAsync(request: carriers.Diagnostics_GetCacheStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
271
+
272
+ /**
273
+ * Get the current generation value of the named caches. State is opaque.
274
+ * @param cacheNames - Names of the caches to check
275
+ * @returns Current state of the caches named. If not the same as previous value, then it is time to flush
276
+ */
277
+ public async getCacheStateAsync(cacheNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< string >;
278
+
279
+ public async getCacheStateAsync(cacheNames:string[]|carriers.Diagnostics_GetCacheStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
280
+ let _request : carriers.Diagnostics_GetCacheStateRequest = null;
281
+ let _options : base.WebApiRequestOptions = null;
282
+ const first : any = cacheNames;
283
+ if( typeof( first ) === "object" && first && ( typeof(first.cacheNames)!='undefined' ) )
284
+ {
285
+ _request = cacheNames as carriers.Diagnostics_GetCacheStateRequest;
286
+ _options = webapi_options as base.WebApiRequestOptions;
287
+ }
288
+ else
289
+ {
290
+ _request = {
291
+ cacheNames: cacheNames as string[],
292
+ };
293
+ _options = webapi_options;
294
+ }
295
+ return this._getCacheStateAsync( _request, _options );
296
+ }
297
+
298
+
299
+ private async _getCacheInvalidationGenerationsAsync(request: carriers.Diagnostics_GetCacheInvalidationGenerationsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CacheInvalidation[] > {
300
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
301
+ base.WebApiBase.SetPending(options);
302
+ return new Promise< carriers.CacheInvalidation[] >(async (resolve, reject) => {
303
+ try {
304
+ config.baseURL = this._options.baseUrl;
305
+ const response = await this._axios.post("GetCacheInvalidationGenerations", request , config);
306
+ base.WebApiBase.SetCompleted(options, response);
307
+ const res : carriers.CacheInvalidation[] = converters.Create_CacheInvalidationArray_From( response.data );
308
+ resolve(res);
309
+ }
310
+ catch( err ) {
311
+ base.WebApiBase.HandleError(options, config, err);
312
+ reject(err);
313
+ }
314
+ });
315
+ }
316
+
317
+
318
+
319
+ /**
320
+ * Get generation for provided names
321
+ * @param request - Names
322
+ * @returns Array of caches with generation number
323
+ */
324
+ public async getCacheInvalidationGenerationsAsync(request: carriers.Diagnostics_GetCacheInvalidationGenerationsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CacheInvalidation[] >;
325
+
326
+ /**
327
+ * Get generation for provided names
328
+ * @param names - Name of caches
329
+ * @returns Array of caches with generation number
330
+ */
331
+ public async getCacheInvalidationGenerationsAsync(names: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CacheInvalidation[] >;
332
+
333
+ public async getCacheInvalidationGenerationsAsync(names:string[]|carriers.Diagnostics_GetCacheInvalidationGenerationsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CacheInvalidation[] > {
334
+ let _request : carriers.Diagnostics_GetCacheInvalidationGenerationsRequest = null;
335
+ let _options : base.WebApiRequestOptions = null;
336
+ const first : any = names;
337
+ if( typeof( first ) === "object" && first && ( typeof(first.names)!='undefined' ) )
338
+ {
339
+ _request = names as carriers.Diagnostics_GetCacheInvalidationGenerationsRequest;
340
+ _options = webapi_options as base.WebApiRequestOptions;
341
+ }
342
+ else
343
+ {
344
+ _request = {
345
+ names: names as string[],
346
+ };
347
+ _options = webapi_options;
348
+ }
349
+ return this._getCacheInvalidationGenerationsAsync( _request, _options );
350
+ }
351
+
352
+
353
+ private async _getEntityCountsForCurrentUserAsync( options?:base.WebApiRequestOptions) : Promise< carriers.EntityCounts[] > {
354
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
355
+ base.WebApiBase.SetPending(options);
356
+ return new Promise< carriers.EntityCounts[] >(async (resolve, reject) => {
357
+ try {
358
+ config.baseURL = this._options.baseUrl;
359
+ const response = await this._axios.post("GetEntityCountsForCurrentUser", undefined , config);
360
+ base.WebApiBase.SetCompleted(options, response);
361
+ const res : carriers.EntityCounts[] = converters.Create_EntityCountsArray_From( response.data );
362
+ resolve(res);
363
+ }
364
+ catch( err ) {
365
+ base.WebApiBase.HandleError(options, config, err);
366
+ reject(err);
367
+ }
368
+ });
369
+ }
370
+
371
+
372
+ /**
373
+ * Get an array of entities and number of entities created for the current associate
374
+ * @returns Array of EntityCounts[] for the current associate
375
+ */
376
+ public async getEntityCountsForCurrentUserAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EntityCounts[] >
377
+ {
378
+ return this._getEntityCountsForCurrentUserAsync(webapi_options);
379
+ }
380
+
381
+
382
+ private async _getEntityCountsForAllUsersAsync( options?:base.WebApiRequestOptions) : Promise< carriers.EntityCounts[] > {
383
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
384
+ base.WebApiBase.SetPending(options);
385
+ return new Promise< carriers.EntityCounts[] >(async (resolve, reject) => {
386
+ try {
387
+ config.baseURL = this._options.baseUrl;
388
+ const response = await this._axios.post("GetEntityCountsForAllUsers", undefined , config);
389
+ base.WebApiBase.SetCompleted(options, response);
390
+ const res : carriers.EntityCounts[] = converters.Create_EntityCountsArray_From( response.data );
391
+ resolve(res);
392
+ }
393
+ catch( err ) {
394
+ base.WebApiBase.HandleError(options, config, err);
395
+ reject(err);
396
+ }
397
+ });
398
+ }
399
+
400
+
401
+ /**
402
+ * Get an array of entities and number of entities created for all associates.
403
+ * @returns Array of EntityCounts[] for all the users
404
+ */
405
+ public async getEntityCountsForAllUsersAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EntityCounts[] >
406
+ {
407
+ return this._getEntityCountsForAllUsersAsync(webapi_options);
408
+ }
409
+
410
+
411
+ private async _logViewStateAsync(request: carriers.Diagnostics_LogViewStateRequest, options?:base.WebApiRequestOptions) : Promise< void > {
412
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
413
+ base.WebApiBase.SetPending(options);
414
+ return new Promise< void >(async (resolve, reject) => {
415
+ try {
416
+ config.baseURL = this._options.baseUrl;
417
+ const response = await this._axios.post("LogViewState", request , config);
418
+ base.WebApiBase.SetCompleted(options, response);
419
+ const res = response.data;
420
+ resolve(res);
421
+ }
422
+ catch( err ) {
423
+ base.WebApiBase.HandleError(options, config, err);
424
+ reject(err);
425
+ }
426
+ });
427
+ }
428
+
429
+
430
+
431
+ /**
432
+ * Log a change in view state. The granularity of the logging depends on the current configuration. This call returns asynchronously, leaving the server to finish processing later on.
433
+ * @param request - ViewState
434
+ * @returns
435
+ */
436
+ public async logViewStateAsync(request: carriers.Diagnostics_LogViewStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
437
+
438
+ /**
439
+ * Log a change in view state. The granularity of the logging depends on the current configuration. This call returns asynchronously, leaving the server to finish processing later on.
440
+ * @param viewState - Current view state to be logged
441
+ * @returns
442
+ */
443
+ public async logViewStateAsync(viewState: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
444
+
445
+ public async logViewStateAsync(viewState:string|carriers.Diagnostics_LogViewStateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
446
+ let _request : carriers.Diagnostics_LogViewStateRequest = null;
447
+ let _options : base.WebApiRequestOptions = null;
448
+ const first : any = viewState;
449
+ if( typeof( first ) === "object" && first && ( typeof(first.viewState)!='undefined' ) )
450
+ {
451
+ _request = viewState as carriers.Diagnostics_LogViewStateRequest;
452
+ _options = webapi_options as base.WebApiRequestOptions;
453
+ }
454
+ else
455
+ {
456
+ _request = {
457
+ viewState: viewState as string,
458
+ };
459
+ _options = webapi_options;
460
+ }
461
+ return this._logViewStateAsync( _request, _options );
462
+ }
463
+
464
+
465
+ private async _changeLogSettingsAsync(request: carriers.Diagnostics_ChangeLogSettingsRequest, options?:base.WebApiRequestOptions) : Promise< void > {
466
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
467
+ base.WebApiBase.SetPending(options);
468
+ return new Promise< void >(async (resolve, reject) => {
469
+ try {
470
+ config.baseURL = this._options.baseUrl;
471
+ const response = await this._axios.post("ChangeLogSettings", request , config);
472
+ base.WebApiBase.SetCompleted(options, response);
473
+ const res = response.data;
474
+ resolve(res);
475
+ }
476
+ catch( err ) {
477
+ base.WebApiBase.HandleError(options, config, err);
478
+ reject(err);
479
+ }
480
+ });
481
+ }
482
+
483
+
484
+
485
+ /**
486
+ * Change NetServer log settings.
487
+ * @param request - LogWarning, LogInformation, LogSuccessAudit, LogFailureAudit, LogToEventLog, LogToSuperOffice, LogToFile, LogToTrace
488
+ * @returns
489
+ */
490
+ public async changeLogSettingsAsync(request: carriers.Diagnostics_ChangeLogSettingsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
491
+
492
+ /**
493
+ * Change NetServer log settings.
494
+ * @param logWarning - Turn on warning log
495
+ * @param logInformation - Turn on information log
496
+ * @param logSuccessAudit - Turn on success audit log
497
+ * @param logFailureAudit - Turn on failure audit log
498
+ * @param logToEventLog - Log to event log
499
+ * @param logToSuperOffice - Log to SuperOffice
500
+ * @param logToFile - Log to file
501
+ * @param logToTrace - Log to trace
502
+ * @returns
503
+ */
504
+ public async changeLogSettingsAsync(logWarning: boolean, logInformation: boolean, logSuccessAudit: boolean, logFailureAudit: boolean, logToEventLog: boolean, logToSuperOffice: boolean, logToFile: boolean, logToTrace: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
505
+
506
+ public async changeLogSettingsAsync(logWarning:boolean|carriers.Diagnostics_ChangeLogSettingsRequest, logInformation?:boolean|base.WebApiRequestOptions, logSuccessAudit?:boolean, logFailureAudit?:boolean, logToEventLog?:boolean, logToSuperOffice?:boolean, logToFile?:boolean, logToTrace?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
507
+ let _request : carriers.Diagnostics_ChangeLogSettingsRequest = null;
508
+ let _options : base.WebApiRequestOptions = null;
509
+ const first : any = logWarning;
510
+ if( typeof( first ) === "object" && first && ( typeof(first.logWarning)!='undefined' || typeof(first.logInformation)!='undefined' || typeof(first.logSuccessAudit)!='undefined' || typeof(first.logFailureAudit)!='undefined' || typeof(first.logToEventLog)!='undefined' || typeof(first.logToSuperOffice)!='undefined' || typeof(first.logToFile)!='undefined' || typeof(first.logToTrace)!='undefined' ) )
511
+ {
512
+ _request = logWarning as carriers.Diagnostics_ChangeLogSettingsRequest;
513
+ _options = logInformation as base.WebApiRequestOptions;
514
+ }
515
+ else
516
+ {
517
+ _request = {
518
+ logWarning: logWarning as boolean,
519
+ logInformation: logInformation as boolean,
520
+ logSuccessAudit: logSuccessAudit as boolean,
521
+ logFailureAudit: logFailureAudit as boolean,
522
+ logToEventLog: logToEventLog as boolean,
523
+ logToSuperOffice: logToSuperOffice as boolean,
524
+ logToFile: logToFile as boolean,
525
+ logToTrace: logToTrace as boolean,
526
+ };
527
+ _options = webapi_options;
528
+ }
529
+ return this._changeLogSettingsAsync( _request, _options );
530
+ }
531
+
532
+
533
+ private async _trackEventAsync(request: carriers.Diagnostics_TrackEventRequest, options?:base.WebApiRequestOptions) : Promise< number > {
534
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
535
+ base.WebApiBase.SetPending(options);
536
+ return new Promise< number >(async (resolve, reject) => {
537
+ try {
538
+ config.baseURL = this._options.baseUrl;
539
+ const response = await this._axios.post("TrackEvent", request , config);
540
+ base.WebApiBase.SetCompleted(options, response);
541
+ const res : number = response.data as number;
542
+ resolve(res);
543
+ }
544
+ catch( err ) {
545
+ base.WebApiBase.HandleError(options, config, err);
546
+ reject(err);
547
+ }
548
+ });
549
+ }
550
+
551
+
552
+
553
+ /**
554
+ * Sends events to Amplitude and Userflow.
555
+ * @param request - TrackEventName, EventProperties
556
+ * @returns Amplitude Session id used to track the event. May be the same as passed in SO-AMPLITUDE header or ampSess cookie, or a fresh one if none defined.
557
+ */
558
+ public async trackEventAsync(request: carriers.Diagnostics_TrackEventRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
559
+
560
+ /**
561
+ * Sends events to Amplitude and Userflow.
562
+ * @param trackEventName - "Sale Completed" or "Sale Sold" etc. See the TrackEventNames class for suitable string constants.
563
+ * @param eventProperties - key-value pairs of event properties. client is set from the application token. Special keys: app_version, platform, os_name, os_version, device_brand, device_manufacturer
564
+ * @returns Amplitude Session id used to track the event. May be the same as passed in SO-AMPLITUDE header or ampSess cookie, or a fresh one if none defined.
565
+ */
566
+ public async trackEventAsync(trackEventName: string, eventProperties: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
567
+
568
+ public async trackEventAsync(trackEventName:string|carriers.Diagnostics_TrackEventRequest, eventProperties?:carriers.StringDictionary|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
569
+ let _request : carriers.Diagnostics_TrackEventRequest = null;
570
+ let _options : base.WebApiRequestOptions = null;
571
+ const first : any = trackEventName;
572
+ if( typeof( first ) === "object" && first && ( typeof(first.trackEventName)!='undefined' || typeof(first.eventProperties)!='undefined' ) )
573
+ {
574
+ _request = trackEventName as carriers.Diagnostics_TrackEventRequest;
575
+ _options = eventProperties as base.WebApiRequestOptions;
576
+ }
577
+ else
578
+ {
579
+ _request = {
580
+ trackEventName: trackEventName as string,
581
+ eventProperties: eventProperties as carriers.StringDictionary,
582
+ };
583
+ _options = webapi_options;
584
+ }
585
+ return this._trackEventAsync( _request, _options );
586
+ }
587
+
588
+
589
+ private async _trackUserAsync(request: carriers.Diagnostics_TrackUserRequest, options?:base.WebApiRequestOptions) : Promise< number > {
590
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
591
+ base.WebApiBase.SetPending(options);
592
+ return new Promise< number >(async (resolve, reject) => {
593
+ try {
594
+ config.baseURL = this._options.baseUrl;
595
+ const response = await this._axios.post("TrackUser", request , config);
596
+ base.WebApiBase.SetCompleted(options, response);
597
+ const res : number = response.data as number;
598
+ resolve(res);
599
+ }
600
+ catch( err ) {
601
+ base.WebApiBase.HandleError(options, config, err);
602
+ reject(err);
603
+ }
604
+ });
605
+ }
606
+
607
+
608
+
609
+ /**
610
+ * Sends user identification to Amplitude and Userflow. Sets current rights, user licenses automatically. Additional properties can be specified in userProperties.
611
+ * @param request - UserProperties
612
+ * @returns Amplitude Session id used to track the user. May be the same as passed in SO-AMPLITUDE header or ampSess cookie, or a fresh one if none defined.
613
+ */
614
+ public async trackUserAsync(request: carriers.Diagnostics_TrackUserRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
615
+
616
+ /**
617
+ * Sends user identification to Amplitude and Userflow. Sets current rights, user licenses automatically. Additional properties can be specified in userProperties.
618
+ * @param userProperties - Optional: Additional key-value pairs of user properties to set on the user. Special keys: app_version, platform, os_name, os_version, device_brand, device_manufacturer
619
+ * @returns Amplitude Session id used to track the user. May be the same as passed in SO-AMPLITUDE header or ampSess cookie, or a fresh one if none defined.
620
+ */
621
+ public async trackUserAsync(userProperties: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
622
+
623
+ public async trackUserAsync(userProperties:carriers.StringDictionary|carriers.Diagnostics_TrackUserRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
624
+ let _request : carriers.Diagnostics_TrackUserRequest = null;
625
+ let _options : base.WebApiRequestOptions = null;
626
+ const first : any = userProperties;
627
+ if( typeof( first ) === "object" && first && ( typeof(first.userProperties)!='undefined' ) )
628
+ {
629
+ _request = userProperties as carriers.Diagnostics_TrackUserRequest;
630
+ _options = webapi_options as base.WebApiRequestOptions;
631
+ }
632
+ else
633
+ {
634
+ _request = {
635
+ userProperties: userProperties as carriers.StringDictionary,
636
+ };
637
+ _options = webapi_options;
638
+ }
639
+ return this._trackUserAsync( _request, _options );
640
+ }
641
+
642
+
643
+ private async _collectDataAdditionsAsync( options?:base.WebApiRequestOptions) : Promise< void > {
644
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
645
+ base.WebApiBase.SetPending(options);
646
+ return new Promise< void >(async (resolve, reject) => {
647
+ try {
648
+ config.baseURL = this._options.baseUrl;
649
+ const response = await this._axios.post("CollectDataAdditions", undefined , config);
650
+ base.WebApiBase.SetCompleted(options, response);
651
+ const res = response.data;
652
+ resolve(res);
653
+ }
654
+ catch( err ) {
655
+ base.WebApiBase.HandleError(options, config, err);
656
+ reject(err);
657
+ }
658
+ });
659
+ }
660
+
661
+
662
+ /**
663
+ * Collect and transmit usage statistics: Database Additions. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
664
+ * @returns This method has no return value
665
+ */
666
+ public async collectDataAdditionsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
667
+ {
668
+ return this._collectDataAdditionsAsync(webapi_options);
669
+ }
670
+
671
+
672
+ private async _collectWinUsageAsync( options?:base.WebApiRequestOptions) : Promise< void > {
673
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
674
+ base.WebApiBase.SetPending(options);
675
+ return new Promise< void >(async (resolve, reject) => {
676
+ try {
677
+ config.baseURL = this._options.baseUrl;
678
+ const response = await this._axios.post("CollectWinUsage", undefined , config);
679
+ base.WebApiBase.SetCompleted(options, response);
680
+ const res = response.data;
681
+ resolve(res);
682
+ }
683
+ catch( err ) {
684
+ base.WebApiBase.HandleError(options, config, err);
685
+ reject(err);
686
+ }
687
+ });
688
+ }
689
+
690
+
691
+ /**
692
+ * Collect and transmit usage statistics: Windows CRM Client Usage. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
693
+ * @returns This method has no return value
694
+ */
695
+ public async collectWinUsageAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
696
+ {
697
+ return this._collectWinUsageAsync(webapi_options);
698
+ }
699
+
700
+
701
+ private async _collectWebUsageAsync( options?:base.WebApiRequestOptions) : Promise< void > {
702
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
703
+ base.WebApiBase.SetPending(options);
704
+ return new Promise< void >(async (resolve, reject) => {
705
+ try {
706
+ config.baseURL = this._options.baseUrl;
707
+ const response = await this._axios.post("CollectWebUsage", undefined , config);
708
+ base.WebApiBase.SetCompleted(options, response);
709
+ const res = response.data;
710
+ resolve(res);
711
+ }
712
+ catch( err ) {
713
+ base.WebApiBase.HandleError(options, config, err);
714
+ reject(err);
715
+ }
716
+ });
717
+ }
718
+
719
+
720
+ /**
721
+ * Collect and transmit usage statistics: Web-based clients Usage. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
722
+ * @returns This method has no return value
723
+ */
724
+ public async collectWebUsageAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
725
+ {
726
+ return this._collectWebUsageAsync(webapi_options);
727
+ }
728
+
729
+
730
+ private async _collectTableSizesAsync( options?:base.WebApiRequestOptions) : Promise< void > {
731
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
732
+ base.WebApiBase.SetPending(options);
733
+ return new Promise< void >(async (resolve, reject) => {
734
+ try {
735
+ config.baseURL = this._options.baseUrl;
736
+ const response = await this._axios.post("CollectTableSizes", undefined , config);
737
+ base.WebApiBase.SetCompleted(options, response);
738
+ const res = response.data;
739
+ resolve(res);
740
+ }
741
+ catch( err ) {
742
+ base.WebApiBase.HandleError(options, config, err);
743
+ reject(err);
744
+ }
745
+ });
746
+ }
747
+
748
+
749
+ /**
750
+ * Collect and transmit usage statistics: Table Sizes. If opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
751
+ * @returns This method has no return value
752
+ */
753
+ public async collectTableSizesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
754
+ {
755
+ return this._collectTableSizesAsync(webapi_options);
756
+ }
757
+
758
+
759
+ private async _resyncUsersAsync( options?:base.WebApiRequestOptions) : Promise< void > {
760
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
761
+ base.WebApiBase.SetPending(options);
762
+ return new Promise< void >(async (resolve, reject) => {
763
+ try {
764
+ config.baseURL = this._options.baseUrl;
765
+ const response = await this._axios.post("ResyncUsers", undefined , config);
766
+ base.WebApiBase.SetCompleted(options, response);
767
+ const res = response.data;
768
+ resolve(res);
769
+ }
770
+ catch( err ) {
771
+ base.WebApiBase.HandleError(options, config, err);
772
+ reject(err);
773
+ }
774
+ });
775
+ }
776
+
777
+
778
+ /**
779
+ * Resynchronize user information with SuperOffice Community, if opted-out then this call does nothing. The call returns immediately (starting a background thread), and updates CS scheduler table to set the next run time.
780
+ * @returns This method has no return value
781
+ */
782
+ public async resyncUsersAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
783
+ {
784
+ return this._resyncUsersAsync(webapi_options);
785
+ }
786
+
787
+
788
+ private async _sendSystemMessageAsync(request: carriers.Diagnostics_SendSystemMessageRequest, options?:base.WebApiRequestOptions) : Promise< void > {
789
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
790
+ base.WebApiBase.SetPending(options);
791
+ return new Promise< void >(async (resolve, reject) => {
792
+ try {
793
+ config.baseURL = this._options.baseUrl;
794
+ const response = await this._axios.post("SendSystemMessage", request , config);
795
+ base.WebApiBase.SetCompleted(options, response);
796
+ const res = response.data;
797
+ resolve(res);
798
+ }
799
+ catch( err ) {
800
+ base.WebApiBase.HandleError(options, config, err);
801
+ reject(err);
802
+ }
803
+ });
804
+ }
805
+
806
+
807
+
808
+ /**
809
+ * Adds a system message for a specific associate.
810
+ * @param request - SystemMessageId, AssociateId, MarkdownMessage, Expire, Type
811
+ * @returns
812
+ */
813
+ public async sendSystemMessageAsync(request: carriers.Diagnostics_SendSystemMessageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
814
+
815
+ /**
816
+ * Adds a system message for a specific associate.
817
+ * @param systemMessageId - The message string id
818
+ * @param associateId - The associateId of the message target.
819
+ * @param markdownMessage - Markdown message to be displayed to the user
820
+ * @param expire - When the message will no longer be available
821
+ * @param type - Type of message, example: info, warning, error
822
+ * @returns
823
+ */
824
+ public async sendSystemMessageAsync(systemMessageId: string, associateId: number, markdownMessage: string, expire: Date, type: enums.SystemMessageType, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
825
+
826
+ public async sendSystemMessageAsync(systemMessageId:string|carriers.Diagnostics_SendSystemMessageRequest, associateId?:number|base.WebApiRequestOptions, markdownMessage?:string, expire?:Date, type?:enums.SystemMessageType, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
827
+ let _request : carriers.Diagnostics_SendSystemMessageRequest = null;
828
+ let _options : base.WebApiRequestOptions = null;
829
+ const first : any = systemMessageId;
830
+ if( typeof( first ) === "object" && first && ( typeof(first.systemMessageId)!='undefined' || typeof(first.associateId)!='undefined' || typeof(first.markdownMessage)!='undefined' || typeof(first.expire)!='undefined' || typeof(first.type)!='undefined' ) )
831
+ {
832
+ _request = systemMessageId as carriers.Diagnostics_SendSystemMessageRequest;
833
+ _options = associateId as base.WebApiRequestOptions;
834
+ }
835
+ else
836
+ {
837
+ _request = {
838
+ systemMessageId: systemMessageId as string,
839
+ associateId: associateId as number,
840
+ markdownMessage: markdownMessage as string,
841
+ expire: expire as Date,
842
+ type: type as enums.SystemMessageType,
843
+ };
844
+ _options = webapi_options;
845
+ }
846
+ return this._sendSystemMessageAsync( _request, _options );
847
+ }
848
+
849
+
850
+ private async _removeSystemMessageAsync(request: carriers.Diagnostics_RemoveSystemMessageRequest, options?:base.WebApiRequestOptions) : Promise< void > {
851
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
852
+ base.WebApiBase.SetPending(options);
853
+ return new Promise< void >(async (resolve, reject) => {
854
+ try {
855
+ config.baseURL = this._options.baseUrl;
856
+ const response = await this._axios.post("RemoveSystemMessage", request , config);
857
+ base.WebApiBase.SetCompleted(options, response);
858
+ const res = response.data;
859
+ resolve(res);
860
+ }
861
+ catch( err ) {
862
+ base.WebApiBase.HandleError(options, config, err);
863
+ reject(err);
864
+ }
865
+ });
866
+ }
867
+
868
+
869
+
870
+ /**
871
+ * Removes a system message for current associate
872
+ * @param request - OnlineappId, SystemMessageId
873
+ * @returns
874
+ */
875
+ public async removeSystemMessageAsync(request: carriers.Diagnostics_RemoveSystemMessageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
876
+
877
+ /**
878
+ * Removes a system message for current associate
879
+ * @param onlineappId - Id of the online app that owns this message
880
+ * @param systemMessageId - Message identifier, used for message removal
881
+ * @returns
882
+ */
883
+ public async removeSystemMessageAsync(onlineappId: number, systemMessageId: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
884
+
885
+ public async removeSystemMessageAsync(onlineappId:number|carriers.Diagnostics_RemoveSystemMessageRequest, systemMessageId?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
886
+ let _request : carriers.Diagnostics_RemoveSystemMessageRequest = null;
887
+ let _options : base.WebApiRequestOptions = null;
888
+ const first : any = onlineappId;
889
+ if( typeof( first ) === "object" && first && ( typeof(first.onlineappId)!='undefined' || typeof(first.systemMessageId)!='undefined' ) )
890
+ {
891
+ _request = onlineappId as carriers.Diagnostics_RemoveSystemMessageRequest;
892
+ _options = systemMessageId as base.WebApiRequestOptions;
893
+ }
894
+ else
895
+ {
896
+ _request = {
897
+ onlineappId: onlineappId as number,
898
+ systemMessageId: systemMessageId as string,
899
+ };
900
+ _options = webapi_options;
901
+ }
902
+ return this._removeSystemMessageAsync( _request, _options );
903
+ }
904
+
905
+
906
+ private async _removeSystemMessageForAssociateAsync(request: carriers.Diagnostics_RemoveSystemMessageForAssociateRequest, options?:base.WebApiRequestOptions) : Promise< void > {
907
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
908
+ base.WebApiBase.SetPending(options);
909
+ return new Promise< void >(async (resolve, reject) => {
910
+ try {
911
+ config.baseURL = this._options.baseUrl;
912
+ const response = await this._axios.post("RemoveSystemMessageForAssociate", request , config);
913
+ base.WebApiBase.SetCompleted(options, response);
914
+ const res = response.data;
915
+ resolve(res);
916
+ }
917
+ catch( err ) {
918
+ base.WebApiBase.HandleError(options, config, err);
919
+ reject(err);
920
+ }
921
+ });
922
+ }
923
+
924
+
925
+
926
+ /**
927
+ * Removes a system message for specific associate.
928
+ * @param request - OnlineappId, SystemMessageId, AssociateId
929
+ * @returns
930
+ */
931
+ public async removeSystemMessageForAssociateAsync(request: carriers.Diagnostics_RemoveSystemMessageForAssociateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
932
+
933
+ /**
934
+ * Removes a system message for specific associate.
935
+ * @param onlineappId - Id of the online app that owns this message
936
+ * @param systemMessageId - Message identifier, used for message update or removal
937
+ * @param associateId - The associateId of the message target.
938
+ * @returns
939
+ */
940
+ public async removeSystemMessageForAssociateAsync(onlineappId: number, systemMessageId: string, associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
941
+
942
+ public async removeSystemMessageForAssociateAsync(onlineappId:number|carriers.Diagnostics_RemoveSystemMessageForAssociateRequest, systemMessageId?:string|base.WebApiRequestOptions, associateId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
943
+ let _request : carriers.Diagnostics_RemoveSystemMessageForAssociateRequest = null;
944
+ let _options : base.WebApiRequestOptions = null;
945
+ const first : any = onlineappId;
946
+ if( typeof( first ) === "object" && first && ( typeof(first.onlineappId)!='undefined' || typeof(first.systemMessageId)!='undefined' || typeof(first.associateId)!='undefined' ) )
947
+ {
948
+ _request = onlineappId as carriers.Diagnostics_RemoveSystemMessageForAssociateRequest;
949
+ _options = systemMessageId as base.WebApiRequestOptions;
950
+ }
951
+ else
952
+ {
953
+ _request = {
954
+ onlineappId: onlineappId as number,
955
+ systemMessageId: systemMessageId as string,
956
+ associateId: associateId as number,
957
+ };
958
+ _options = webapi_options;
959
+ }
960
+ return this._removeSystemMessageForAssociateAsync( _request, _options );
961
+ }
962
+
963
+
964
+ private async _getSystemMessagesAsync(request: carriers.Diagnostics_GetSystemMessagesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SystemMessage[] > {
965
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
966
+ base.WebApiBase.SetPending(options);
967
+ return new Promise< carriers.SystemMessage[] >(async (resolve, reject) => {
968
+ try {
969
+ config.baseURL = this._options.baseUrl;
970
+ const response = await this._axios.post("GetSystemMessages", request , config);
971
+ base.WebApiBase.SetCompleted(options, response);
972
+ const res : carriers.SystemMessage[] = converters.Create_SystemMessageArray_From( response.data );
973
+ resolve(res);
974
+ }
975
+ catch( err ) {
976
+ base.WebApiBase.HandleError(options, config, err);
977
+ reject(err);
978
+ }
979
+ });
980
+ }
981
+
982
+
983
+
984
+ /**
985
+ * Retrieves a list of system messages for a specific associate.
986
+ * @param request - AssociateId
987
+ * @returns List of SystemMessages for desired associate
988
+ */
989
+ public async getSystemMessagesAsync(request: carriers.Diagnostics_GetSystemMessagesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemMessage[] >;
990
+
991
+ /**
992
+ * Retrieves a list of system messages for a specific associate.
993
+ * @param associateId - The associateId of the message target.
994
+ * @returns List of SystemMessages for desired associate
995
+ */
996
+ public async getSystemMessagesAsync(associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemMessage[] >;
997
+
998
+ public async getSystemMessagesAsync(associateId:number|carriers.Diagnostics_GetSystemMessagesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemMessage[] > {
999
+ let _request : carriers.Diagnostics_GetSystemMessagesRequest = null;
1000
+ let _options : base.WebApiRequestOptions = null;
1001
+ const first : any = associateId;
1002
+ if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' ) )
1003
+ {
1004
+ _request = associateId as carriers.Diagnostics_GetSystemMessagesRequest;
1005
+ _options = webapi_options as base.WebApiRequestOptions;
1006
+ }
1007
+ else
1008
+ {
1009
+ _request = {
1010
+ associateId: associateId as number,
1011
+ };
1012
+ _options = webapi_options;
1013
+ }
1014
+ return this._getSystemMessagesAsync( _request, _options );
1015
+ }
1016
+
1017
+
1018
+ private async _removeExpiredSystemMessagesAsync( options?:base.WebApiRequestOptions) : Promise< void > {
1019
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1020
+ base.WebApiBase.SetPending(options);
1021
+ return new Promise< void >(async (resolve, reject) => {
1022
+ try {
1023
+ config.baseURL = this._options.baseUrl;
1024
+ const response = await this._axios.post("RemoveExpiredSystemMessages", undefined , config);
1025
+ base.WebApiBase.SetCompleted(options, response);
1026
+ const res = response.data;
1027
+ resolve(res);
1028
+ }
1029
+ catch( err ) {
1030
+ base.WebApiBase.HandleError(options, config, err);
1031
+ reject(err);
1032
+ }
1033
+ });
1034
+ }
1035
+
1036
+
1037
+ /**
1038
+ * Deletes expired system messages.
1039
+ * @returns
1040
+ */
1041
+ public async removeExpiredSystemMessagesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< void >
1042
+ {
1043
+ return this._removeExpiredSystemMessagesAsync(webapi_options);
1044
+ }
1045
+
1046
+
1047
+ private async _getNextTableNumberAsync( options?:base.WebApiRequestOptions) : Promise< number > {
1048
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1049
+ base.WebApiBase.SetPending(options);
1050
+ return new Promise< number >(async (resolve, reject) => {
1051
+ try {
1052
+ config.baseURL = this._options.baseUrl;
1053
+ const response = await this._axios.post("GetNextTableNumber", undefined , config);
1054
+ base.WebApiBase.SetCompleted(options, response);
1055
+ const res : number = response.data as number;
1056
+ resolve(res);
1057
+ }
1058
+ catch( err ) {
1059
+ base.WebApiBase.HandleError(options, config, err);
1060
+ reject(err);
1061
+ }
1062
+ });
1063
+ }
1064
+
1065
+
1066
+ /**
1067
+ * Increment save and return NextTableNumber, to be used when creating new extra table
1068
+ * @returns NextTableNumber of DatabaseModel
1069
+ */
1070
+ public async getNextTableNumberAsync(webapi_options?:base.WebApiRequestOptions) : Promise< number >
1071
+ {
1072
+ return this._getNextTableNumberAsync(webapi_options);
1073
+ }
1074
+
1075
+
1076
+ private async _performTasksAfterUpgradeAsync( options?:base.WebApiRequestOptions) : Promise< string > {
1077
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1078
+ base.WebApiBase.SetPending(options);
1079
+ return new Promise< string >(async (resolve, reject) => {
1080
+ try {
1081
+ config.baseURL = this._options.baseUrl;
1082
+ const response = await this._axios.post("PerformTasksAfterUpgrade", undefined , config);
1083
+ base.WebApiBase.SetCompleted(options, response);
1084
+ const res : string = response.data as string;
1085
+ resolve(res);
1086
+ }
1087
+ catch( err ) {
1088
+ base.WebApiBase.HandleError(options, config, err);
1089
+ reject(err);
1090
+ }
1091
+ });
1092
+ }
1093
+
1094
+
1095
+ /**
1096
+ * After upgrading to a new fileset, there may be tasks that need to be done. Examples - import new TypicalSearches, if present. Tasks performed here need to be idempotent and independent of the actual upgrade jump (what was the previous version). They should complete in a reasonable time, not more than a few minutes maximum.
1097
+ * @returns Message that can be shown to the user, summarizing what has been done, if anything.
1098
+ */
1099
+ public async performTasksAfterUpgradeAsync(webapi_options?:base.WebApiRequestOptions) : Promise< string >
1100
+ {
1101
+ return this._performTasksAfterUpgradeAsync(webapi_options);
1102
+ }
1103
+
1104
+
1105
+ private async _performTasksAfterCustomObjectTableCreatedAsync(request: carriers.Diagnostics_PerformTasksAfterCustomObjectTableCreatedRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1106
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1107
+ base.WebApiBase.SetPending(options);
1108
+ return new Promise< void >(async (resolve, reject) => {
1109
+ try {
1110
+ config.baseURL = this._options.baseUrl;
1111
+ const response = await this._axios.post("PerformTasksAfterCustomObjectTableCreated", request , config);
1112
+ base.WebApiBase.SetCompleted(options, response);
1113
+ const res = response.data;
1114
+ resolve(res);
1115
+ }
1116
+ catch( err ) {
1117
+ base.WebApiBase.HandleError(options, config, err);
1118
+ reject(err);
1119
+ }
1120
+ });
1121
+ }
1122
+
1123
+
1124
+
1125
+ /**
1126
+ * A temporary method to be used from c++ until CustomObjectsAgent.CreateTable implemented in NetServer
1127
+ * @param request - TableName
1128
+ * @returns This method has no return value
1129
+ */
1130
+ public async performTasksAfterCustomObjectTableCreatedAsync(request: carriers.Diagnostics_PerformTasksAfterCustomObjectTableCreatedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1131
+
1132
+ /**
1133
+ * A temporary method to be used from c++ until CustomObjectsAgent.CreateTable implemented in NetServer
1134
+ * @param tableName - Name of DB table of the custom object that was created. E.g., 'y_car'
1135
+ * @returns This method has no return value
1136
+ */
1137
+ public async performTasksAfterCustomObjectTableCreatedAsync(tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1138
+
1139
+ public async performTasksAfterCustomObjectTableCreatedAsync(tableName:string|carriers.Diagnostics_PerformTasksAfterCustomObjectTableCreatedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1140
+ let _request : carriers.Diagnostics_PerformTasksAfterCustomObjectTableCreatedRequest = null;
1141
+ let _options : base.WebApiRequestOptions = null;
1142
+ const first : any = tableName;
1143
+ if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' ) )
1144
+ {
1145
+ _request = tableName as carriers.Diagnostics_PerformTasksAfterCustomObjectTableCreatedRequest;
1146
+ _options = webapi_options as base.WebApiRequestOptions;
1147
+ }
1148
+ else
1149
+ {
1150
+ _request = {
1151
+ tableName: tableName as string,
1152
+ };
1153
+ _options = webapi_options;
1154
+ }
1155
+ return this._performTasksAfterCustomObjectTableCreatedAsync( _request, _options );
1156
+ }
1157
+
1158
+
1159
+ private async _performTasksAfterCustomObjectTableDeletedAsync(request: carriers.Diagnostics_PerformTasksAfterCustomObjectTableDeletedRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1160
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1161
+ base.WebApiBase.SetPending(options);
1162
+ return new Promise< void >(async (resolve, reject) => {
1163
+ try {
1164
+ config.baseURL = this._options.baseUrl;
1165
+ const response = await this._axios.post("PerformTasksAfterCustomObjectTableDeleted", request , config);
1166
+ base.WebApiBase.SetCompleted(options, response);
1167
+ const res = response.data;
1168
+ resolve(res);
1169
+ }
1170
+ catch( err ) {
1171
+ base.WebApiBase.HandleError(options, config, err);
1172
+ reject(err);
1173
+ }
1174
+ });
1175
+ }
1176
+
1177
+
1178
+
1179
+ /**
1180
+ * A temporary method to be used from c++ until CustomObjectsAgent.DeleteTable implemented in NetServer
1181
+ * @param request - TableName
1182
+ * @returns This method has no return value
1183
+ */
1184
+ public async performTasksAfterCustomObjectTableDeletedAsync(request: carriers.Diagnostics_PerformTasksAfterCustomObjectTableDeletedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1185
+
1186
+ /**
1187
+ * A temporary method to be used from c++ until CustomObjectsAgent.DeleteTable implemented in NetServer
1188
+ * @param tableName - Name of DB table of the custom object that was deleted. E.g., 'y_car'
1189
+ * @returns This method has no return value
1190
+ */
1191
+ public async performTasksAfterCustomObjectTableDeletedAsync(tableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1192
+
1193
+ public async performTasksAfterCustomObjectTableDeletedAsync(tableName:string|carriers.Diagnostics_PerformTasksAfterCustomObjectTableDeletedRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1194
+ let _request : carriers.Diagnostics_PerformTasksAfterCustomObjectTableDeletedRequest = null;
1195
+ let _options : base.WebApiRequestOptions = null;
1196
+ const first : any = tableName;
1197
+ if( typeof( first ) === "object" && first && ( typeof(first.tableName)!='undefined' ) )
1198
+ {
1199
+ _request = tableName as carriers.Diagnostics_PerformTasksAfterCustomObjectTableDeletedRequest;
1200
+ _options = webapi_options as base.WebApiRequestOptions;
1201
+ }
1202
+ else
1203
+ {
1204
+ _request = {
1205
+ tableName: tableName as string,
1206
+ };
1207
+ _options = webapi_options;
1208
+ }
1209
+ return this._performTasksAfterCustomObjectTableDeletedAsync( _request, _options );
1210
+ }
1211
+
1212
+
1213
+ private async _addWebAppUsageAsync(request: carriers.Diagnostics_AddWebAppUsageRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1214
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1215
+ base.WebApiBase.SetPending(options);
1216
+ return new Promise< void >(async (resolve, reject) => {
1217
+ try {
1218
+ config.baseURL = this._options.baseUrl;
1219
+ const response = await this._axios.post("AddWebAppUsage", request , config);
1220
+ base.WebApiBase.SetCompleted(options, response);
1221
+ const res = response.data;
1222
+ resolve(res);
1223
+ }
1224
+ catch( err ) {
1225
+ base.WebApiBase.HandleError(options, config, err);
1226
+ reject(err);
1227
+ }
1228
+ });
1229
+ }
1230
+
1231
+
1232
+
1233
+ /**
1234
+ * Adds WebApp usage to existing log
1235
+ * @param request - WebAppUsages
1236
+ * @returns
1237
+ */
1238
+ public async addWebAppUsageAsync(request: carriers.Diagnostics_AddWebAppUsageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1239
+
1240
+ /**
1241
+ * Adds WebApp usage to existing log
1242
+ * @param webAppUsages - Web app usage.
1243
+ * @returns
1244
+ */
1245
+ public async addWebAppUsageAsync(webAppUsages: carriers.WebAppUsage[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1246
+
1247
+ public async addWebAppUsageAsync(webAppUsages:carriers.WebAppUsage[]|carriers.Diagnostics_AddWebAppUsageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1248
+ let _request : carriers.Diagnostics_AddWebAppUsageRequest = null;
1249
+ let _options : base.WebApiRequestOptions = null;
1250
+ const first : any = webAppUsages;
1251
+ if( typeof( first ) === "object" && first && ( typeof(first.webAppUsages)!='undefined' ) )
1252
+ {
1253
+ _request = webAppUsages as carriers.Diagnostics_AddWebAppUsageRequest;
1254
+ _options = webapi_options as base.WebApiRequestOptions;
1255
+ }
1256
+ else
1257
+ {
1258
+ _request = {
1259
+ webAppUsages: webAppUsages as carriers.WebAppUsage[],
1260
+ };
1261
+ _options = webapi_options;
1262
+ }
1263
+ return this._addWebAppUsageAsync( _request, _options );
1264
+ }
1265
+
1266
+
1267
+ private async _webAppUsageExistsInPeriodAsync(request: carriers.Diagnostics_WebAppUsageExistsInPeriodRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
1268
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1269
+ base.WebApiBase.SetPending(options);
1270
+ return new Promise< boolean >(async (resolve, reject) => {
1271
+ try {
1272
+ config.baseURL = this._options.baseUrl;
1273
+ const response = await this._axios.post("WebAppUsageExistsInPeriod", request , config);
1274
+ base.WebApiBase.SetCompleted(options, response);
1275
+ const res : boolean = response.data as boolean;
1276
+ resolve(res);
1277
+ }
1278
+ catch( err ) {
1279
+ base.WebApiBase.HandleError(options, config, err);
1280
+ reject(err);
1281
+ }
1282
+ });
1283
+ }
1284
+
1285
+
1286
+
1287
+ /**
1288
+ * Returns true if viewState has been clicked at least once since FromDate, if asscoiateId &lt; 0 or FromDate is DateTime.MinValue no restriction given for those parameters
1289
+ * @param request - AssociateId, ViewState, FromDate
1290
+ * @returns Returns true if viewState has been clicked at least once since FromDate
1291
+ */
1292
+ public async webAppUsageExistsInPeriodAsync(request: carriers.Diagnostics_WebAppUsageExistsInPeriodRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
1293
+
1294
+ /**
1295
+ * Returns true if viewState has been clicked at least once since FromDate, if asscoiateId &lt; 0 or FromDate is DateTime.MinValue no restriction given for those parameters
1296
+ * @param associateId - The asscoiate id to look for webapp usage
1297
+ * @param viewState - The viewState to search for
1298
+ * @param fromDate - The datetime to restrict webapp usage on
1299
+ * @returns Returns true if viewState has been clicked at least once since FromDate
1300
+ */
1301
+ public async webAppUsageExistsInPeriodAsync(associateId: number, viewState: string, fromDate: Date, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
1302
+
1303
+ public async webAppUsageExistsInPeriodAsync(associateId:number|carriers.Diagnostics_WebAppUsageExistsInPeriodRequest, viewState?:string|base.WebApiRequestOptions, fromDate?:Date, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
1304
+ let _request : carriers.Diagnostics_WebAppUsageExistsInPeriodRequest = null;
1305
+ let _options : base.WebApiRequestOptions = null;
1306
+ const first : any = associateId;
1307
+ if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' || typeof(first.viewState)!='undefined' || typeof(first.fromDate)!='undefined' ) )
1308
+ {
1309
+ _request = associateId as carriers.Diagnostics_WebAppUsageExistsInPeriodRequest;
1310
+ _options = viewState as base.WebApiRequestOptions;
1311
+ }
1312
+ else
1313
+ {
1314
+ _request = {
1315
+ associateId: associateId as number,
1316
+ viewState: viewState as string,
1317
+ fromDate: fromDate as Date,
1318
+ };
1319
+ _options = webapi_options;
1320
+ }
1321
+ return this._webAppUsageExistsInPeriodAsync( _request, _options );
1322
+ }
1323
+
1324
+
1325
+ private async _getWebAppUsagesForPeriodAsync(request: carriers.Diagnostics_GetWebAppUsagesForPeriodRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WebAppUsage[] > {
1326
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1327
+ base.WebApiBase.SetPending(options);
1328
+ return new Promise< carriers.WebAppUsage[] >(async (resolve, reject) => {
1329
+ try {
1330
+ config.baseURL = this._options.baseUrl;
1331
+ const response = await this._axios.post("GetWebAppUsagesForPeriod", request , config);
1332
+ base.WebApiBase.SetCompleted(options, response);
1333
+ const res : carriers.WebAppUsage[] = converters.Create_WebAppUsageArray_From( response.data );
1334
+ resolve(res);
1335
+ }
1336
+ catch( err ) {
1337
+ base.WebApiBase.HandleError(options, config, err);
1338
+ reject(err);
1339
+ }
1340
+ });
1341
+ }
1342
+
1343
+
1344
+
1345
+ /**
1346
+ * Get all WebAppUsages for a given period, that match an optional search term
1347
+ * @param request - FromDate, ToDate, SearchTerm
1348
+ * @returns
1349
+ */
1350
+ public async getWebAppUsagesForPeriodAsync(request: carriers.Diagnostics_GetWebAppUsagesForPeriodRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WebAppUsage[] >;
1351
+
1352
+ /**
1353
+ * Get all WebAppUsages for a given period, that match an optional search term
1354
+ * @param fromDate -
1355
+ * @param toDate -
1356
+ * @param searchTerm - ViewState search term. '%' is the wildcard character, for example 'Pocket%' will match all viewstates starting with 'Pocket'. If empty, all viewstates will be matched
1357
+ * @returns
1358
+ */
1359
+ public async getWebAppUsagesForPeriodAsync(fromDate: Date, toDate: Date, searchTerm: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WebAppUsage[] >;
1360
+
1361
+ public async getWebAppUsagesForPeriodAsync(fromDate:Date|carriers.Diagnostics_GetWebAppUsagesForPeriodRequest, toDate?:Date|base.WebApiRequestOptions, searchTerm?:string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WebAppUsage[] > {
1362
+ let _request : carriers.Diagnostics_GetWebAppUsagesForPeriodRequest = null;
1363
+ let _options : base.WebApiRequestOptions = null;
1364
+ const first : any = fromDate;
1365
+ if( typeof( first ) === "object" && first && ( typeof(first.fromDate)!='undefined' || typeof(first.toDate)!='undefined' || typeof(first.searchTerm)!='undefined' ) )
1366
+ {
1367
+ _request = fromDate as carriers.Diagnostics_GetWebAppUsagesForPeriodRequest;
1368
+ _options = toDate as base.WebApiRequestOptions;
1369
+ }
1370
+ else
1371
+ {
1372
+ _request = {
1373
+ fromDate: fromDate as Date,
1374
+ toDate: toDate as Date,
1375
+ searchTerm: searchTerm as string,
1376
+ };
1377
+ _options = webapi_options;
1378
+ }
1379
+ return this._getWebAppUsagesForPeriodAsync( _request, _options );
1380
+ }
1381
+
1382
+ } // class v1DiagnosticsAgentController
1383
+
1384
+