@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,1230 +1,1230 @@
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/LicenseAgent.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
- * License query, download, activation
28
- */
29
- export interface ILicenseAgent {
30
- getLicenseForAllOwnersFromDBAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo[] >;
31
- getLicenseFromLicenseServerAsync(request: carriers.License_GetLicenseFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
32
- getLicenseFromLicenseServerAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
33
- getModuleLicenseHistoryFromLicenseServerAsync(request: carriers.License_GetModuleLicenseHistoryFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
34
- getModuleLicenseHistoryFromLicenseServerAsync(licenseInfo: carriers.ExtendedLicenseInfo, moduleLicense: carriers.ExtendedModuleLicense, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
35
- validateLicenseInfoAsync(request: carriers.License_ValidateLicenseInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
36
- validateLicenseInfoAsync(licenseInfo: carriers.ExtendedLicenseInfo, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
37
- activateLicenseInfoAsync(request: carriers.License_ActivateLicenseInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
38
- activateLicenseInfoAsync(newLicense: carriers.ExtendedLicenseInfo, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
39
- getLicenseStatusFromLicenseServerAsync(request: carriers.License_GetLicenseStatusFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CheckLicenseStatusResult >;
40
- getLicenseStatusFromLicenseServerAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CheckLicenseStatusResult >;
41
- getLicenseFromDBAsync(request: carriers.License_GetLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
42
- getLicenseFromDBAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
43
- getUserAndInstallationLicenceStatusAsync(request: carriers.License_GetUserAndInstallationLicenceStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserAndInstallationLicenceStatus >;
44
- getUserAndInstallationLicenceStatusAsync(associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserAndInstallationLicenceStatus >;
45
- changeSerialNumberAsync(request: carriers.License_ChangeSerialNumberRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
46
- changeSerialNumberAsync(newCompanyName: string, newSerialNumber: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
47
- getUserLicensesAsync(request: carriers.License_GetUserLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
48
- getUserLicensesAsync(associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
49
- getSatelliteLicensesAsync(request: carriers.License_GetSatelliteLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
50
- getSatelliteLicensesAsync(satelliteId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
51
- removeLicenseFromDBAsync(request: carriers.License_RemoveLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
52
- removeLicenseFromDBAsync(moduleOwner: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
53
- getLicenseFromFileAsync(request: carriers.License_GetLicenseFromFileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
54
- getLicenseFromFileAsync(fileContent: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
55
- getShopUrlAsync(request: carriers.License_GetShopUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
56
- getShopUrlAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
57
- getUserLicensesMDOListAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
58
- getModuleLicenseFromDBAsync(request: carriers.License_GetModuleLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicense >;
59
- getModuleLicenseFromDBAsync(ownerName: string, moduleName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicense >;
60
- addLicenseFromFileAsync(request: carriers.License_AddLicenseFromFileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
61
- addLicenseFromFileAsync(fileContent: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
62
- getThirdPartyLicenseAssignmentsAsync(request: carriers.License_GetThirdPartyLicenseAssignmentsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
63
- getThirdPartyLicenseAssignmentsAsync(associateId: number, moduleOwner: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
64
- assignThirdPartyLicensesAsync(request: carriers.License_AssignThirdPartyLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
65
- assignThirdPartyLicensesAsync(associateId: number, moduleOwner: string, moduleLicenseNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
66
- unassignThirdPartyLicensesAsync(request: carriers.License_UnassignThirdPartyLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
67
- unassignThirdPartyLicensesAsync(associateId: number, moduleOwner: string, moduleLicenseNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
68
- getCentralLicenseAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
69
- saveCentralLicenseAsync(request: carriers.License_SaveCentralLicenseRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
70
- saveCentralLicenseAsync(license: carriers.LicenseOwner[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
71
- } // interface ILicenseAgent
72
-
73
-
74
-
75
-
76
- /**
77
- * License query, download, activation
78
- */
79
- export class LicenseAgent extends base.WebApiBase implements ILicenseAgent {
80
- constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
81
- constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
82
- constructor(baseUrl: string, resourceManager:any);
83
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
84
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
85
- constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
86
- constructor(options: base.WebApiOptions);
87
-
88
- constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
89
- langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
90
- langOrResourceOrRM?:string|base.ResourceParsing|any,
91
- cultureCode?: string,
92
- ) {
93
- const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
94
- options.basePath = "v1/Agents/License/";
95
- super(options);
96
- }
97
-
98
-
99
-
100
- private async _getLicenseForAllOwnersFromDBAsync( options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo[] > {
101
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
102
- base.WebApiBase.SetPending(options);
103
- return new Promise< carriers.ExtendedLicenseInfo[] >(async (resolve, reject) => {
104
- try {
105
- config.baseURL = this._options.baseUrl;
106
- const response = await this._axios.post("GetLicenseForAllOwnersFromDB", undefined , config);
107
- base.WebApiBase.SetCompleted(options, response);
108
- const res : carriers.ExtendedLicenseInfo[] = converters.Create_ExtendedLicenseInfoArray_From( response.data );
109
- resolve(res);
110
- }
111
- catch( err ) {
112
- base.WebApiBase.HandleError(options, config, err);
113
- reject(err);
114
- }
115
- });
116
- }
117
-
118
-
119
- /**
120
- * Get all licenses, with usage, from all module owners as they are stored in the database
121
- * @returns
122
- */
123
- public async getLicenseForAllOwnersFromDBAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo[] >
124
- {
125
- return this._getLicenseForAllOwnersFromDBAsync(webapi_options);
126
- }
127
-
128
-
129
- private async _getLicenseFromLicenseServerAsync(request: carriers.License_GetLicenseFromLicenseServerRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
130
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
131
- base.WebApiBase.SetPending(options);
132
- return new Promise< carriers.ExtendedLicenseInfo >(async (resolve, reject) => {
133
- try {
134
- config.baseURL = this._options.baseUrl;
135
- const response = await this._axios.post("GetLicenseFromLicenseServer", request , config);
136
- base.WebApiBase.SetCompleted(options, response);
137
- const res : carriers.ExtendedLicenseInfo = converters.Create_ExtendedLicenseInfo_From( response.data );
138
- resolve(res);
139
- }
140
- catch( err ) {
141
- base.WebApiBase.HandleError(options, config, err);
142
- reject(err);
143
- }
144
- });
145
- }
146
-
147
-
148
-
149
- /**
150
- *
151
- * @param request - OwnerName
152
- * @returns
153
- */
154
- public async getLicenseFromLicenseServerAsync(request: carriers.License_GetLicenseFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
155
-
156
- /**
157
- *
158
- * @param ownerName -
159
- * @returns
160
- */
161
- public async getLicenseFromLicenseServerAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
162
-
163
- public async getLicenseFromLicenseServerAsync(ownerName:string|carriers.License_GetLicenseFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
164
- let _request : carriers.License_GetLicenseFromLicenseServerRequest = null;
165
- let _options : base.WebApiRequestOptions = null;
166
- const first : any = ownerName;
167
- if( typeof( first ) === "object" && first && ( typeof(first.ownerName)!='undefined' ) )
168
- {
169
- _request = ownerName as carriers.License_GetLicenseFromLicenseServerRequest;
170
- _options = webapi_options as base.WebApiRequestOptions;
171
- }
172
- else
173
- {
174
- _request = {
175
- ownerName: ownerName as string,
176
- };
177
- _options = webapi_options;
178
- }
179
- return this._getLicenseFromLicenseServerAsync( _request, _options );
180
- }
181
-
182
-
183
- private async _getModuleLicenseHistoryFromLicenseServerAsync(request: carriers.License_GetModuleLicenseHistoryFromLicenseServerRequest, options?:base.WebApiRequestOptions) : Promise< string > {
184
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
185
- base.WebApiBase.SetPending(options);
186
- return new Promise< string >(async (resolve, reject) => {
187
- try {
188
- config.baseURL = this._options.baseUrl;
189
- const response = await this._axios.post("GetModuleLicenseHistoryFromLicenseServer", request , config);
190
- base.WebApiBase.SetCompleted(options, response);
191
- const res : string = response.data as string;
192
- resolve(res);
193
- }
194
- catch( err ) {
195
- base.WebApiBase.HandleError(options, config, err);
196
- reject(err);
197
- }
198
- });
199
- }
200
-
201
-
202
-
203
- /**
204
- * Get details about a license from the license server.
205
- * @param request - LicenseInfo, ModuleLicense
206
- * @returns Information about a particular license module.
207
- */
208
- public async getModuleLicenseHistoryFromLicenseServerAsync(request: carriers.License_GetModuleLicenseHistoryFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
209
-
210
- /**
211
- * Get details about a license from the license server.
212
- * @param licenseInfo - Description of the license
213
- * @param moduleLicense - Information about a particular module to get information for.
214
- * @returns Information about a particular license module.
215
- */
216
- public async getModuleLicenseHistoryFromLicenseServerAsync(licenseInfo: carriers.ExtendedLicenseInfo, moduleLicense: carriers.ExtendedModuleLicense, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
217
-
218
- public async getModuleLicenseHistoryFromLicenseServerAsync(licenseInfo:carriers.ExtendedLicenseInfo|carriers.License_GetModuleLicenseHistoryFromLicenseServerRequest, moduleLicense?:carriers.ExtendedModuleLicense|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
219
- let _request : carriers.License_GetModuleLicenseHistoryFromLicenseServerRequest = null;
220
- let _options : base.WebApiRequestOptions = null;
221
- const first : any = licenseInfo;
222
- if( typeof( first ) === "object" && first && ( typeof(first.licenseInfo)!='undefined' || typeof(first.moduleLicense)!='undefined' ) )
223
- {
224
- _request = licenseInfo as carriers.License_GetModuleLicenseHistoryFromLicenseServerRequest;
225
- _options = moduleLicense as base.WebApiRequestOptions;
226
- }
227
- else
228
- {
229
- _request = {
230
- licenseInfo: licenseInfo as carriers.ExtendedLicenseInfo,
231
- moduleLicense: moduleLicense as carriers.ExtendedModuleLicense,
232
- };
233
- _options = webapi_options;
234
- }
235
- return this._getModuleLicenseHistoryFromLicenseServerAsync( _request, _options );
236
- }
237
-
238
-
239
- private async _validateLicenseInfoAsync(request: carriers.License_ValidateLicenseInfoRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
240
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
241
- base.WebApiBase.SetPending(options);
242
- return new Promise< carriers.LicenseResult >(async (resolve, reject) => {
243
- try {
244
- config.baseURL = this._options.baseUrl;
245
- const response = await this._axios.post("ValidateLicenseInfo", request , config);
246
- base.WebApiBase.SetCompleted(options, response);
247
- const res : carriers.LicenseResult = converters.Create_LicenseResult_From( response.data );
248
- resolve(res);
249
- }
250
- catch( err ) {
251
- base.WebApiBase.HandleError(options, config, err);
252
- reject(err);
253
- }
254
- });
255
- }
256
-
257
-
258
-
259
- /**
260
- * Validate that a license is consistant.
261
- * @param request - LicenseInfo
262
- * @returns
263
- */
264
- public async validateLicenseInfoAsync(request: carriers.License_ValidateLicenseInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
265
-
266
- /**
267
- * Validate that a license is consistant.
268
- * @param licenseInfo - License to validate consistancy for
269
- * @returns
270
- */
271
- public async validateLicenseInfoAsync(licenseInfo: carriers.ExtendedLicenseInfo, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
272
-
273
- public async validateLicenseInfoAsync(licenseInfo:carriers.ExtendedLicenseInfo|carriers.License_ValidateLicenseInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
274
- let _request : carriers.License_ValidateLicenseInfoRequest = null;
275
- let _options : base.WebApiRequestOptions = null;
276
- const first : any = licenseInfo;
277
- if( typeof( first ) === "object" && first && ( typeof(first.licenseInfo)!='undefined' ) )
278
- {
279
- _request = licenseInfo as carriers.License_ValidateLicenseInfoRequest;
280
- _options = webapi_options as base.WebApiRequestOptions;
281
- }
282
- else
283
- {
284
- _request = {
285
- licenseInfo: licenseInfo as carriers.ExtendedLicenseInfo,
286
- };
287
- _options = webapi_options;
288
- }
289
- return this._validateLicenseInfoAsync( _request, _options );
290
- }
291
-
292
-
293
- private async _activateLicenseInfoAsync(request: carriers.License_ActivateLicenseInfoRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
294
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
295
- base.WebApiBase.SetPending(options);
296
- return new Promise< carriers.LicenseResult >(async (resolve, reject) => {
297
- try {
298
- config.baseURL = this._options.baseUrl;
299
- const response = await this._axios.post("ActivateLicenseInfo", request , config);
300
- base.WebApiBase.SetCompleted(options, response);
301
- const res : carriers.LicenseResult = converters.Create_LicenseResult_From( response.data );
302
- resolve(res);
303
- }
304
- catch( err ) {
305
- base.WebApiBase.HandleError(options, config, err);
306
- reject(err);
307
- }
308
- });
309
- }
310
-
311
-
312
-
313
- /**
314
- * Save a new license to the database.
315
- * @param request - NewLicense
316
- * @returns
317
- */
318
- public async activateLicenseInfoAsync(request: carriers.License_ActivateLicenseInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
319
-
320
- /**
321
- * Save a new license to the database.
322
- * @param newLicense - New license to save to the database.
323
- * @returns
324
- */
325
- public async activateLicenseInfoAsync(newLicense: carriers.ExtendedLicenseInfo, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
326
-
327
- public async activateLicenseInfoAsync(newLicense:carriers.ExtendedLicenseInfo|carriers.License_ActivateLicenseInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
328
- let _request : carriers.License_ActivateLicenseInfoRequest = null;
329
- let _options : base.WebApiRequestOptions = null;
330
- const first : any = newLicense;
331
- if( typeof( first ) === "object" && first && ( typeof(first.newLicense)!='undefined' ) )
332
- {
333
- _request = newLicense as carriers.License_ActivateLicenseInfoRequest;
334
- _options = webapi_options as base.WebApiRequestOptions;
335
- }
336
- else
337
- {
338
- _request = {
339
- newLicense: newLicense as carriers.ExtendedLicenseInfo,
340
- };
341
- _options = webapi_options;
342
- }
343
- return this._activateLicenseInfoAsync( _request, _options );
344
- }
345
-
346
-
347
- private async _getLicenseStatusFromLicenseServerAsync(request: carriers.License_GetLicenseStatusFromLicenseServerRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CheckLicenseStatusResult > {
348
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
349
- base.WebApiBase.SetPending(options);
350
- return new Promise< carriers.CheckLicenseStatusResult >(async (resolve, reject) => {
351
- try {
352
- config.baseURL = this._options.baseUrl;
353
- const response = await this._axios.post("GetLicenseStatusFromLicenseServer", request , config);
354
- base.WebApiBase.SetCompleted(options, response);
355
- const res : carriers.CheckLicenseStatusResult = converters.Create_CheckLicenseStatusResult_From( response.data );
356
- resolve(res);
357
- }
358
- catch( err ) {
359
- base.WebApiBase.HandleError(options, config, err);
360
- reject(err);
361
- }
362
- });
363
- }
364
-
365
-
366
-
367
- /**
368
- * Get License from the license server for a particular module owner.
369
- * @param request - OwnerName
370
- * @returns License from the database, from the license server and with usage.
371
- */
372
- public async getLicenseStatusFromLicenseServerAsync(request: carriers.License_GetLicenseStatusFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CheckLicenseStatusResult >;
373
-
374
- /**
375
- * Get License from the license server for a particular module owner.
376
- * @param ownerName - Name of the module owner to get license from.
377
- * @returns License from the database, from the license server and with usage.
378
- */
379
- public async getLicenseStatusFromLicenseServerAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CheckLicenseStatusResult >;
380
-
381
- public async getLicenseStatusFromLicenseServerAsync(ownerName:string|carriers.License_GetLicenseStatusFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CheckLicenseStatusResult > {
382
- let _request : carriers.License_GetLicenseStatusFromLicenseServerRequest = null;
383
- let _options : base.WebApiRequestOptions = null;
384
- const first : any = ownerName;
385
- if( typeof( first ) === "object" && first && ( typeof(first.ownerName)!='undefined' ) )
386
- {
387
- _request = ownerName as carriers.License_GetLicenseStatusFromLicenseServerRequest;
388
- _options = webapi_options as base.WebApiRequestOptions;
389
- }
390
- else
391
- {
392
- _request = {
393
- ownerName: ownerName as string,
394
- };
395
- _options = webapi_options;
396
- }
397
- return this._getLicenseStatusFromLicenseServerAsync( _request, _options );
398
- }
399
-
400
-
401
- private async _getLicenseFromDBAsync(request: carriers.License_GetLicenseFromDBRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
402
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
403
- base.WebApiBase.SetPending(options);
404
- return new Promise< carriers.ExtendedLicenseInfo >(async (resolve, reject) => {
405
- try {
406
- config.baseURL = this._options.baseUrl;
407
- const response = await this._axios.post("GetLicenseFromDB", request , config);
408
- base.WebApiBase.SetCompleted(options, response);
409
- const res : carriers.ExtendedLicenseInfo = converters.Create_ExtendedLicenseInfo_From( response.data );
410
- resolve(res);
411
- }
412
- catch( err ) {
413
- base.WebApiBase.HandleError(options, config, err);
414
- reject(err);
415
- }
416
- });
417
- }
418
-
419
-
420
-
421
- /**
422
- * Get license, with usage, as it is stored in the database for one particular module owner.
423
- * @param request - OwnerName
424
- * @returns License, with usage, as it is stored in the database.
425
- */
426
- public async getLicenseFromDBAsync(request: carriers.License_GetLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
427
-
428
- /**
429
- * Get license, with usage, as it is stored in the database for one particular module owner.
430
- * @param ownerName - Name of the module owner.
431
- * @returns License, with usage, as it is stored in the database.
432
- */
433
- public async getLicenseFromDBAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
434
-
435
- public async getLicenseFromDBAsync(ownerName:string|carriers.License_GetLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
436
- let _request : carriers.License_GetLicenseFromDBRequest = null;
437
- let _options : base.WebApiRequestOptions = null;
438
- const first : any = ownerName;
439
- if( typeof( first ) === "object" && first && ( typeof(first.ownerName)!='undefined' ) )
440
- {
441
- _request = ownerName as carriers.License_GetLicenseFromDBRequest;
442
- _options = webapi_options as base.WebApiRequestOptions;
443
- }
444
- else
445
- {
446
- _request = {
447
- ownerName: ownerName as string,
448
- };
449
- _options = webapi_options;
450
- }
451
- return this._getLicenseFromDBAsync( _request, _options );
452
- }
453
-
454
-
455
- private async _getUserAndInstallationLicenceStatusAsync(request: carriers.License_GetUserAndInstallationLicenceStatusRequest, options?:base.WebApiRequestOptions) : Promise< carriers.UserAndInstallationLicenceStatus > {
456
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
457
- base.WebApiBase.SetPending(options);
458
- return new Promise< carriers.UserAndInstallationLicenceStatus >(async (resolve, reject) => {
459
- try {
460
- config.baseURL = this._options.baseUrl;
461
- const response = await this._axios.post("GetUserAndInstallationLicenceStatus", request , config);
462
- base.WebApiBase.SetCompleted(options, response);
463
- const res : carriers.UserAndInstallationLicenceStatus = converters.Create_UserAndInstallationLicenceStatus_From( response.data );
464
- resolve(res);
465
- }
466
- catch( err ) {
467
- base.WebApiBase.HandleError(options, config, err);
468
- reject(err);
469
- }
470
- });
471
- }
472
-
473
-
474
-
475
- /**
476
- * Get status values for user licenses and installation license that can be used for feedback to the user.
477
- * @param request - AssociateId
478
- * @returns An object that holds information for producing license status feedback to the user.
479
- */
480
- public async getUserAndInstallationLicenceStatusAsync(request: carriers.License_GetUserAndInstallationLicenceStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserAndInstallationLicenceStatus >;
481
-
482
- /**
483
- * Get status values for user licenses and installation license that can be used for feedback to the user.
484
- * @param associateId - Associate id to use when loading information about user licenses and installation license status.
485
- * @returns An object that holds information for producing license status feedback to the user.
486
- */
487
- public async getUserAndInstallationLicenceStatusAsync(associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserAndInstallationLicenceStatus >;
488
-
489
- public async getUserAndInstallationLicenceStatusAsync(associateId:number|carriers.License_GetUserAndInstallationLicenceStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserAndInstallationLicenceStatus > {
490
- let _request : carriers.License_GetUserAndInstallationLicenceStatusRequest = null;
491
- let _options : base.WebApiRequestOptions = null;
492
- const first : any = associateId;
493
- if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' ) )
494
- {
495
- _request = associateId as carriers.License_GetUserAndInstallationLicenceStatusRequest;
496
- _options = webapi_options as base.WebApiRequestOptions;
497
- }
498
- else
499
- {
500
- _request = {
501
- associateId: associateId as number,
502
- };
503
- _options = webapi_options;
504
- }
505
- return this._getUserAndInstallationLicenceStatusAsync( _request, _options );
506
- }
507
-
508
-
509
- private async _changeSerialNumberAsync(request: carriers.License_ChangeSerialNumberRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
510
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
511
- base.WebApiBase.SetPending(options);
512
- return new Promise< carriers.LicenseResult >(async (resolve, reject) => {
513
- try {
514
- config.baseURL = this._options.baseUrl;
515
- const response = await this._axios.post("ChangeSerialNumber", request , config);
516
- base.WebApiBase.SetCompleted(options, response);
517
- const res : carriers.LicenseResult = converters.Create_LicenseResult_From( response.data );
518
- resolve(res);
519
- }
520
- catch( err ) {
521
- base.WebApiBase.HandleError(options, config, err);
522
- reject(err);
523
- }
524
- });
525
- }
526
-
527
-
528
-
529
- /**
530
- * Change the new serial number for the installation. Requests a new license from SuperLicense, checks if change is authorized.
531
- * @param request - NewCompanyName, NewSerialNumber
532
- * @returns License after serial number/name change
533
- */
534
- public async changeSerialNumberAsync(request: carriers.License_ChangeSerialNumberRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
535
-
536
- /**
537
- * Change the new serial number for the installation. Requests a new license from SuperLicense, checks if change is authorized.
538
- * @param newCompanyName - The new company name
539
- * @param newSerialNumber - New serial number to change to.
540
- * @returns License after serial number/name change
541
- */
542
- public async changeSerialNumberAsync(newCompanyName: string, newSerialNumber: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
543
-
544
- public async changeSerialNumberAsync(newCompanyName:string|carriers.License_ChangeSerialNumberRequest, newSerialNumber?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
545
- let _request : carriers.License_ChangeSerialNumberRequest = null;
546
- let _options : base.WebApiRequestOptions = null;
547
- const first : any = newCompanyName;
548
- if( typeof( first ) === "object" && first && ( typeof(first.newCompanyName)!='undefined' || typeof(first.newSerialNumber)!='undefined' ) )
549
- {
550
- _request = newCompanyName as carriers.License_ChangeSerialNumberRequest;
551
- _options = newSerialNumber as base.WebApiRequestOptions;
552
- }
553
- else
554
- {
555
- _request = {
556
- newCompanyName: newCompanyName as string,
557
- newSerialNumber: newSerialNumber as string,
558
- };
559
- _options = webapi_options;
560
- }
561
- return this._changeSerialNumberAsync( _request, _options );
562
- }
563
-
564
-
565
- private async _getUserLicensesAsync(request: carriers.License_GetUserLicensesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
566
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
567
- base.WebApiBase.SetPending(options);
568
- return new Promise< carriers.LicenseOwner[] >(async (resolve, reject) => {
569
- try {
570
- config.baseURL = this._options.baseUrl;
571
- const response = await this._axios.post("GetUserLicenses", request , config);
572
- base.WebApiBase.SetCompleted(options, response);
573
- const res : carriers.LicenseOwner[] = converters.Create_LicenseOwnerArray_From( response.data );
574
- resolve(res);
575
- }
576
- catch( err ) {
577
- base.WebApiBase.HandleError(options, config, err);
578
- reject(err);
579
- }
580
- });
581
- }
582
-
583
-
584
-
585
- /**
586
- * Obtain information about associate module licenses
587
- * @param request - AssociateId
588
- * @returns Associate module licenses grouped by owners.
589
- */
590
- public async getUserLicensesAsync(request: carriers.License_GetUserLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
591
-
592
- /**
593
- * Obtain information about associate module licenses
594
- * @param associateId - Associate id to check for associate module licenses
595
- * @returns Associate module licenses grouped by owners.
596
- */
597
- public async getUserLicensesAsync(associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
598
-
599
- public async getUserLicensesAsync(associateId:number|carriers.License_GetUserLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
600
- let _request : carriers.License_GetUserLicensesRequest = null;
601
- let _options : base.WebApiRequestOptions = null;
602
- const first : any = associateId;
603
- if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' ) )
604
- {
605
- _request = associateId as carriers.License_GetUserLicensesRequest;
606
- _options = webapi_options as base.WebApiRequestOptions;
607
- }
608
- else
609
- {
610
- _request = {
611
- associateId: associateId as number,
612
- };
613
- _options = webapi_options;
614
- }
615
- return this._getUserLicensesAsync( _request, _options );
616
- }
617
-
618
-
619
- private async _getSatelliteLicensesAsync(request: carriers.License_GetSatelliteLicensesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
620
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
621
- base.WebApiBase.SetPending(options);
622
- return new Promise< carriers.LicenseOwner[] >(async (resolve, reject) => {
623
- try {
624
- config.baseURL = this._options.baseUrl;
625
- const response = await this._axios.post("GetSatelliteLicenses", request , config);
626
- base.WebApiBase.SetCompleted(options, response);
627
- const res : carriers.LicenseOwner[] = converters.Create_LicenseOwnerArray_From( response.data );
628
- resolve(res);
629
- }
630
- catch( err ) {
631
- base.WebApiBase.HandleError(options, config, err);
632
- reject(err);
633
- }
634
- });
635
- }
636
-
637
-
638
-
639
- /**
640
- * Obtain information about satellite module licenses
641
- * @param request - SatelliteId
642
- * @returns Satellite module licenses grouped by owners.
643
- */
644
- public async getSatelliteLicensesAsync(request: carriers.License_GetSatelliteLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
645
-
646
- /**
647
- * Obtain information about satellite module licenses
648
- * @param satelliteId - Satellite id to check for satellite module licenses
649
- * @returns Satellite module licenses grouped by owners.
650
- */
651
- public async getSatelliteLicensesAsync(satelliteId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
652
-
653
- public async getSatelliteLicensesAsync(satelliteId:number|carriers.License_GetSatelliteLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
654
- let _request : carriers.License_GetSatelliteLicensesRequest = null;
655
- let _options : base.WebApiRequestOptions = null;
656
- const first : any = satelliteId;
657
- if( typeof( first ) === "object" && first && ( typeof(first.satelliteId)!='undefined' ) )
658
- {
659
- _request = satelliteId as carriers.License_GetSatelliteLicensesRequest;
660
- _options = webapi_options as base.WebApiRequestOptions;
661
- }
662
- else
663
- {
664
- _request = {
665
- satelliteId: satelliteId as number,
666
- };
667
- _options = webapi_options;
668
- }
669
- return this._getSatelliteLicensesAsync( _request, _options );
670
- }
671
-
672
-
673
- private async _removeLicenseFromDBAsync(request: carriers.License_RemoveLicenseFromDBRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
674
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
675
- base.WebApiBase.SetPending(options);
676
- return new Promise< carriers.LicenseResult >(async (resolve, reject) => {
677
- try {
678
- config.baseURL = this._options.baseUrl;
679
- const response = await this._axios.post("RemoveLicenseFromDB", request , config);
680
- base.WebApiBase.SetCompleted(options, response);
681
- const res : carriers.LicenseResult = converters.Create_LicenseResult_From( response.data );
682
- resolve(res);
683
- }
684
- catch( err ) {
685
- base.WebApiBase.HandleError(options, config, err);
686
- reject(err);
687
- }
688
- });
689
- }
690
-
691
-
692
-
693
- /**
694
- * Remove the license from a particular module owner from the database. It is not permitted to remove licenses from SuperOffice
695
- * @param request - ModuleOwner
696
- * @returns
697
- */
698
- public async removeLicenseFromDBAsync(request: carriers.License_RemoveLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
699
-
700
- /**
701
- * Remove the license from a particular module owner from the database. It is not permitted to remove licenses from SuperOffice
702
- * @param moduleOwner - Name of the module owner to remove license from.
703
- * @returns
704
- */
705
- public async removeLicenseFromDBAsync(moduleOwner: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
706
-
707
- public async removeLicenseFromDBAsync(moduleOwner:string|carriers.License_RemoveLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
708
- let _request : carriers.License_RemoveLicenseFromDBRequest = null;
709
- let _options : base.WebApiRequestOptions = null;
710
- const first : any = moduleOwner;
711
- if( typeof( first ) === "object" && first && ( typeof(first.moduleOwner)!='undefined' ) )
712
- {
713
- _request = moduleOwner as carriers.License_RemoveLicenseFromDBRequest;
714
- _options = webapi_options as base.WebApiRequestOptions;
715
- }
716
- else
717
- {
718
- _request = {
719
- moduleOwner: moduleOwner as string,
720
- };
721
- _options = webapi_options;
722
- }
723
- return this._removeLicenseFromDBAsync( _request, _options );
724
- }
725
-
726
-
727
- private async _getLicenseFromFileAsync(request: carriers.License_GetLicenseFromFileRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
728
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
729
- base.WebApiBase.SetPending(options);
730
- return new Promise< carriers.ExtendedLicenseInfo >(async (resolve, reject) => {
731
- try {
732
- config.baseURL = this._options.baseUrl;
733
- const response = await this._axios.post("GetLicenseFromFile", request , config);
734
- base.WebApiBase.SetCompleted(options, response);
735
- const res : carriers.ExtendedLicenseInfo = converters.Create_ExtendedLicenseInfo_From( response.data );
736
- resolve(res);
737
- }
738
- catch( err ) {
739
- base.WebApiBase.HandleError(options, config, err);
740
- reject(err);
741
- }
742
- });
743
- }
744
-
745
-
746
-
747
- /**
748
- * Load a new license from file
749
- * @param request - FileContent
750
- * @returns
751
- */
752
- public async getLicenseFromFileAsync(request: carriers.License_GetLicenseFromFileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
753
-
754
- /**
755
- * Load a new license from file
756
- * @param fileContent - Content of the license file as read.
757
- * @returns
758
- */
759
- public async getLicenseFromFileAsync(fileContent: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
760
-
761
- public async getLicenseFromFileAsync(fileContent:string|carriers.License_GetLicenseFromFileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
762
- let _request : carriers.License_GetLicenseFromFileRequest = null;
763
- let _options : base.WebApiRequestOptions = null;
764
- const first : any = fileContent;
765
- if( typeof( first ) === "object" && first && ( typeof(first.fileContent)!='undefined' ) )
766
- {
767
- _request = fileContent as carriers.License_GetLicenseFromFileRequest;
768
- _options = webapi_options as base.WebApiRequestOptions;
769
- }
770
- else
771
- {
772
- _request = {
773
- fileContent: fileContent as string,
774
- };
775
- _options = webapi_options;
776
- }
777
- return this._getLicenseFromFileAsync( _request, _options );
778
- }
779
-
780
-
781
- private async _getShopUrlAsync(request: carriers.License_GetShopUrlRequest, options?:base.WebApiRequestOptions) : Promise< string > {
782
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
783
- base.WebApiBase.SetPending(options);
784
- return new Promise< string >(async (resolve, reject) => {
785
- try {
786
- config.baseURL = this._options.baseUrl;
787
- const response = await this._axios.post("GetShopUrl", request , config);
788
- base.WebApiBase.SetCompleted(options, response);
789
- const res : string = response.data as string;
790
- resolve(res);
791
- }
792
- catch( err ) {
793
- base.WebApiBase.HandleError(options, config, err);
794
- reject(err);
795
- }
796
- });
797
- }
798
-
799
-
800
-
801
- /**
802
- * Get the shop URL for the specified module owner. This can be used to redirect user to the web shop.
803
- * @param request - OwnerName
804
- * @returns The URL which contains the shop for the specified module owner.
805
- */
806
- public async getShopUrlAsync(request: carriers.License_GetShopUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
807
-
808
- /**
809
- * Get the shop URL for the specified module owner. This can be used to redirect user to the web shop.
810
- * @param ownerName - Name of the module owner.
811
- * @returns The URL which contains the shop for the specified module owner.
812
- */
813
- public async getShopUrlAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
814
-
815
- public async getShopUrlAsync(ownerName:string|carriers.License_GetShopUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
816
- let _request : carriers.License_GetShopUrlRequest = null;
817
- let _options : base.WebApiRequestOptions = null;
818
- const first : any = ownerName;
819
- if( typeof( first ) === "object" && first && ( typeof(first.ownerName)!='undefined' ) )
820
- {
821
- _request = ownerName as carriers.License_GetShopUrlRequest;
822
- _options = webapi_options as base.WebApiRequestOptions;
823
- }
824
- else
825
- {
826
- _request = {
827
- ownerName: ownerName as string,
828
- };
829
- _options = webapi_options;
830
- }
831
- return this._getShopUrlAsync( _request, _options );
832
- }
833
-
834
-
835
- private async _getUserLicensesMDOListAsync( options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
836
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
837
- base.WebApiBase.SetPending(options);
838
- return new Promise< carriers.SelectableMDOListItem[] >(async (resolve, reject) => {
839
- try {
840
- config.baseURL = this._options.baseUrl;
841
- const response = await this._axios.post("GetUserLicensesMDOList", undefined , config);
842
- base.WebApiBase.SetCompleted(options, response);
843
- const res : carriers.SelectableMDOListItem[] = converters.Create_SelectableMDOListItemArray_From( response.data );
844
- resolve(res);
845
- }
846
- catch( err ) {
847
- base.WebApiBase.HandleError(options, config, err);
848
- reject(err);
849
- }
850
- });
851
- }
852
-
853
-
854
- /**
855
- * Get all licenses in a MDOListItem structure.
856
- * @returns Hierarchical structure of user licenses.
857
- */
858
- public async getUserLicensesMDOListAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >
859
- {
860
- return this._getUserLicensesMDOListAsync(webapi_options);
861
- }
862
-
863
-
864
- private async _getModuleLicenseFromDBAsync(request: carriers.License_GetModuleLicenseFromDBRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicense > {
865
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
866
- base.WebApiBase.SetPending(options);
867
- return new Promise< carriers.ModuleLicense >(async (resolve, reject) => {
868
- try {
869
- config.baseURL = this._options.baseUrl;
870
- const response = await this._axios.post("GetModuleLicenseFromDB", request , config);
871
- base.WebApiBase.SetCompleted(options, response);
872
- const res : carriers.ModuleLicense = converters.Create_ModuleLicense_From( response.data );
873
- resolve(res);
874
- }
875
- catch( err ) {
876
- base.WebApiBase.HandleError(options, config, err);
877
- reject(err);
878
- }
879
- });
880
- }
881
-
882
-
883
-
884
- /**
885
- * Get license information for one particular license module.
886
- * @param request - OwnerName, ModuleName
887
- * @returns Module License details, as it is stored in the database. NULL if not found.
888
- */
889
- public async getModuleLicenseFromDBAsync(request: carriers.License_GetModuleLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicense >;
890
-
891
- /**
892
- * Get license information for one particular license module.
893
- * @param ownerName - Name of the module owner.
894
- * @param moduleName - Name of the license module.
895
- * @returns Module License details, as it is stored in the database. NULL if not found.
896
- */
897
- public async getModuleLicenseFromDBAsync(ownerName: string, moduleName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicense >;
898
-
899
- public async getModuleLicenseFromDBAsync(ownerName:string|carriers.License_GetModuleLicenseFromDBRequest, moduleName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicense > {
900
- let _request : carriers.License_GetModuleLicenseFromDBRequest = null;
901
- let _options : base.WebApiRequestOptions = null;
902
- const first : any = ownerName;
903
- if( typeof( first ) === "object" && first && ( typeof(first.ownerName)!='undefined' || typeof(first.moduleName)!='undefined' ) )
904
- {
905
- _request = ownerName as carriers.License_GetModuleLicenseFromDBRequest;
906
- _options = moduleName as base.WebApiRequestOptions;
907
- }
908
- else
909
- {
910
- _request = {
911
- ownerName: ownerName as string,
912
- moduleName: moduleName as string,
913
- };
914
- _options = webapi_options;
915
- }
916
- return this._getModuleLicenseFromDBAsync( _request, _options );
917
- }
918
-
919
-
920
- private async _addLicenseFromFileAsync(request: carriers.License_AddLicenseFromFileRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
921
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
922
- base.WebApiBase.SetPending(options);
923
- return new Promise< carriers.ExtendedLicenseInfo >(async (resolve, reject) => {
924
- try {
925
- config.baseURL = this._options.baseUrl;
926
- const response = await this._axios.post("AddLicenseFromFile", request , config);
927
- base.WebApiBase.SetCompleted(options, response);
928
- const res : carriers.ExtendedLicenseInfo = converters.Create_ExtendedLicenseInfo_From( response.data );
929
- resolve(res);
930
- }
931
- catch( err ) {
932
- base.WebApiBase.HandleError(options, config, err);
933
- reject(err);
934
- }
935
- });
936
- }
937
-
938
-
939
-
940
- /**
941
- * Load and activate a new license from file/string if the new license is valid.
942
- * @param request - FileContent
943
- * @returns Activated license
944
- */
945
- public async addLicenseFromFileAsync(request: carriers.License_AddLicenseFromFileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
946
-
947
- /**
948
- * Load and activate a new license from file/string if the new license is valid.
949
- * @param fileContent - Content of the license file as XML.
950
- * @returns Activated license
951
- */
952
- public async addLicenseFromFileAsync(fileContent: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
953
-
954
- public async addLicenseFromFileAsync(fileContent:string|carriers.License_AddLicenseFromFileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
955
- let _request : carriers.License_AddLicenseFromFileRequest = null;
956
- let _options : base.WebApiRequestOptions = null;
957
- const first : any = fileContent;
958
- if( typeof( first ) === "object" && first && ( typeof(first.fileContent)!='undefined' ) )
959
- {
960
- _request = fileContent as carriers.License_AddLicenseFromFileRequest;
961
- _options = webapi_options as base.WebApiRequestOptions;
962
- }
963
- else
964
- {
965
- _request = {
966
- fileContent: fileContent as string,
967
- };
968
- _options = webapi_options;
969
- }
970
- return this._addLicenseFromFileAsync( _request, _options );
971
- }
972
-
973
-
974
- private async _getThirdPartyLicenseAssignmentsAsync(request: carriers.License_GetThirdPartyLicenseAssignmentsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] > {
975
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
976
- base.WebApiBase.SetPending(options);
977
- return new Promise< carriers.ModuleLicenseLink[] >(async (resolve, reject) => {
978
- try {
979
- config.baseURL = this._options.baseUrl;
980
- const response = await this._axios.post("GetThirdPartyLicenseAssignments", request , config);
981
- base.WebApiBase.SetCompleted(options, response);
982
- const res : carriers.ModuleLicenseLink[] = converters.Create_ModuleLicenseLinkArray_From( response.data );
983
- resolve(res);
984
- }
985
- catch( err ) {
986
- base.WebApiBase.HandleError(options, config, err);
987
- reject(err);
988
- }
989
- });
990
- }
991
-
992
-
993
-
994
- /**
995
- * Get license assignments for an associate for licenses belonging to an other module owner than SuperOffice
996
- * @param request - AssociateId, ModuleOwner
997
- * @returns Module license names
998
- */
999
- public async getThirdPartyLicenseAssignmentsAsync(request: carriers.License_GetThirdPartyLicenseAssignmentsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
1000
-
1001
- /**
1002
- * Get license assignments for an associate for licenses belonging to an other module owner than SuperOffice
1003
- * @param associateId - User to get third party license assignments for
1004
- * @param moduleOwner - Name of the module owner to get license assignments for
1005
- * @returns Module license names
1006
- */
1007
- public async getThirdPartyLicenseAssignmentsAsync(associateId: number, moduleOwner: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
1008
-
1009
- public async getThirdPartyLicenseAssignmentsAsync(associateId:number|carriers.License_GetThirdPartyLicenseAssignmentsRequest, moduleOwner?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] > {
1010
- let _request : carriers.License_GetThirdPartyLicenseAssignmentsRequest = null;
1011
- let _options : base.WebApiRequestOptions = null;
1012
- const first : any = associateId;
1013
- if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' || typeof(first.moduleOwner)!='undefined' ) )
1014
- {
1015
- _request = associateId as carriers.License_GetThirdPartyLicenseAssignmentsRequest;
1016
- _options = moduleOwner as base.WebApiRequestOptions;
1017
- }
1018
- else
1019
- {
1020
- _request = {
1021
- associateId: associateId as number,
1022
- moduleOwner: moduleOwner as string,
1023
- };
1024
- _options = webapi_options;
1025
- }
1026
- return this._getThirdPartyLicenseAssignmentsAsync( _request, _options );
1027
- }
1028
-
1029
-
1030
- private async _assignThirdPartyLicensesAsync(request: carriers.License_AssignThirdPartyLicensesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] > {
1031
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1032
- base.WebApiBase.SetPending(options);
1033
- return new Promise< carriers.ModuleLicenseLink[] >(async (resolve, reject) => {
1034
- try {
1035
- config.baseURL = this._options.baseUrl;
1036
- const response = await this._axios.post("AssignThirdPartyLicenses", request , config);
1037
- base.WebApiBase.SetCompleted(options, response);
1038
- const res : carriers.ModuleLicenseLink[] = converters.Create_ModuleLicenseLinkArray_From( response.data );
1039
- resolve(res);
1040
- }
1041
- catch( err ) {
1042
- base.WebApiBase.HandleError(options, config, err);
1043
- reject(err);
1044
- }
1045
- });
1046
- }
1047
-
1048
-
1049
-
1050
- /**
1051
- * Assign third party licenses
1052
- * @param request - AssociateId, ModuleOwner, ModuleLicenseNames
1053
- * @returns All module license names assigned
1054
- */
1055
- public async assignThirdPartyLicensesAsync(request: carriers.License_AssignThirdPartyLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
1056
-
1057
- /**
1058
- * Assign third party licenses
1059
- * @param associateId - User to assign third party licenses for
1060
- * @param moduleOwner - Name of the module owner to assign license for
1061
- * @param moduleLicenseNames - Name of module licenses to assign
1062
- * @returns All module license names assigned
1063
- */
1064
- public async assignThirdPartyLicensesAsync(associateId: number, moduleOwner: string, moduleLicenseNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
1065
-
1066
- public async assignThirdPartyLicensesAsync(associateId:number|carriers.License_AssignThirdPartyLicensesRequest, moduleOwner?:string|base.WebApiRequestOptions, moduleLicenseNames?:string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] > {
1067
- let _request : carriers.License_AssignThirdPartyLicensesRequest = null;
1068
- let _options : base.WebApiRequestOptions = null;
1069
- const first : any = associateId;
1070
- if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' || typeof(first.moduleOwner)!='undefined' || typeof(first.moduleLicenseNames)!='undefined' ) )
1071
- {
1072
- _request = associateId as carriers.License_AssignThirdPartyLicensesRequest;
1073
- _options = moduleOwner as base.WebApiRequestOptions;
1074
- }
1075
- else
1076
- {
1077
- _request = {
1078
- associateId: associateId as number,
1079
- moduleOwner: moduleOwner as string,
1080
- moduleLicenseNames: moduleLicenseNames as string[],
1081
- };
1082
- _options = webapi_options;
1083
- }
1084
- return this._assignThirdPartyLicensesAsync( _request, _options );
1085
- }
1086
-
1087
-
1088
- private async _unassignThirdPartyLicensesAsync(request: carriers.License_UnassignThirdPartyLicensesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] > {
1089
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1090
- base.WebApiBase.SetPending(options);
1091
- return new Promise< carriers.ModuleLicenseLink[] >(async (resolve, reject) => {
1092
- try {
1093
- config.baseURL = this._options.baseUrl;
1094
- const response = await this._axios.post("UnassignThirdPartyLicenses", request , config);
1095
- base.WebApiBase.SetCompleted(options, response);
1096
- const res : carriers.ModuleLicenseLink[] = converters.Create_ModuleLicenseLinkArray_From( response.data );
1097
- resolve(res);
1098
- }
1099
- catch( err ) {
1100
- base.WebApiBase.HandleError(options, config, err);
1101
- reject(err);
1102
- }
1103
- });
1104
- }
1105
-
1106
-
1107
-
1108
- /**
1109
- * Unassign (remove) third party licenses
1110
- * @param request - AssociateId, ModuleOwner, ModuleLicenseNames
1111
- * @returns All module license names assigned
1112
- */
1113
- public async unassignThirdPartyLicensesAsync(request: carriers.License_UnassignThirdPartyLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
1114
-
1115
- /**
1116
- * Unassign (remove) third party licenses
1117
- * @param associateId - User to unassign third party licenses for
1118
- * @param moduleOwner - Name of the module owner to unassign license for
1119
- * @param moduleLicenseNames - Name of module licenses to unassign (remove)
1120
- * @returns All module license names assigned
1121
- */
1122
- public async unassignThirdPartyLicensesAsync(associateId: number, moduleOwner: string, moduleLicenseNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
1123
-
1124
- public async unassignThirdPartyLicensesAsync(associateId:number|carriers.License_UnassignThirdPartyLicensesRequest, moduleOwner?:string|base.WebApiRequestOptions, moduleLicenseNames?:string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] > {
1125
- let _request : carriers.License_UnassignThirdPartyLicensesRequest = null;
1126
- let _options : base.WebApiRequestOptions = null;
1127
- const first : any = associateId;
1128
- if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' || typeof(first.moduleOwner)!='undefined' || typeof(first.moduleLicenseNames)!='undefined' ) )
1129
- {
1130
- _request = associateId as carriers.License_UnassignThirdPartyLicensesRequest;
1131
- _options = moduleOwner as base.WebApiRequestOptions;
1132
- }
1133
- else
1134
- {
1135
- _request = {
1136
- associateId: associateId as number,
1137
- moduleOwner: moduleOwner as string,
1138
- moduleLicenseNames: moduleLicenseNames as string[],
1139
- };
1140
- _options = webapi_options;
1141
- }
1142
- return this._unassignThirdPartyLicensesAsync( _request, _options );
1143
- }
1144
-
1145
-
1146
- private async _getCentralLicenseAsync( options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
1147
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1148
- base.WebApiBase.SetPending(options);
1149
- return new Promise< carriers.LicenseOwner[] >(async (resolve, reject) => {
1150
- try {
1151
- config.baseURL = this._options.baseUrl;
1152
- const response = await this._axios.post("GetCentralLicense", undefined , config);
1153
- base.WebApiBase.SetCompleted(options, response);
1154
- const res : carriers.LicenseOwner[] = converters.Create_LicenseOwnerArray_From( response.data );
1155
- resolve(res);
1156
- }
1157
- catch( err ) {
1158
- base.WebApiBase.HandleError(options, config, err);
1159
- reject(err);
1160
- }
1161
- });
1162
- }
1163
-
1164
-
1165
- /**
1166
- *
1167
- * @returns
1168
- */
1169
- public async getCentralLicenseAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >
1170
- {
1171
- return this._getCentralLicenseAsync(webapi_options);
1172
- }
1173
-
1174
-
1175
- private async _saveCentralLicenseAsync(request: carriers.License_SaveCentralLicenseRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
1176
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1177
- base.WebApiBase.SetPending(options);
1178
- return new Promise< carriers.LicenseOwner[] >(async (resolve, reject) => {
1179
- try {
1180
- config.baseURL = this._options.baseUrl;
1181
- const response = await this._axios.post("SaveCentralLicense", request , config);
1182
- base.WebApiBase.SetCompleted(options, response);
1183
- const res : carriers.LicenseOwner[] = converters.Create_LicenseOwnerArray_From( response.data );
1184
- resolve(res);
1185
- }
1186
- catch( err ) {
1187
- base.WebApiBase.HandleError(options, config, err);
1188
- reject(err);
1189
- }
1190
- });
1191
- }
1192
-
1193
-
1194
-
1195
- /**
1196
- *
1197
- * @param request - License
1198
- * @returns
1199
- */
1200
- public async saveCentralLicenseAsync(request: carriers.License_SaveCentralLicenseRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
1201
-
1202
- /**
1203
- *
1204
- * @param license -
1205
- * @returns
1206
- */
1207
- public async saveCentralLicenseAsync(license: carriers.LicenseOwner[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
1208
-
1209
- public async saveCentralLicenseAsync(license:carriers.LicenseOwner[]|carriers.License_SaveCentralLicenseRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
1210
- let _request : carriers.License_SaveCentralLicenseRequest = null;
1211
- let _options : base.WebApiRequestOptions = null;
1212
- const first : any = license;
1213
- if( typeof( first ) === "object" && first && ( typeof(first.license)!='undefined' ) )
1214
- {
1215
- _request = license as carriers.License_SaveCentralLicenseRequest;
1216
- _options = webapi_options as base.WebApiRequestOptions;
1217
- }
1218
- else
1219
- {
1220
- _request = {
1221
- license: license as carriers.LicenseOwner[],
1222
- };
1223
- _options = webapi_options;
1224
- }
1225
- return this._saveCentralLicenseAsync( _request, _options );
1226
- }
1227
-
1228
- } // class v1LicenseAgentController
1229
-
1230
-
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/LicenseAgent.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
+ * License query, download, activation
28
+ */
29
+ export interface ILicenseAgent {
30
+ getLicenseForAllOwnersFromDBAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo[] >;
31
+ getLicenseFromLicenseServerAsync(request: carriers.License_GetLicenseFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
32
+ getLicenseFromLicenseServerAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
33
+ getModuleLicenseHistoryFromLicenseServerAsync(request: carriers.License_GetModuleLicenseHistoryFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
34
+ getModuleLicenseHistoryFromLicenseServerAsync(licenseInfo: carriers.ExtendedLicenseInfo, moduleLicense: carriers.ExtendedModuleLicense, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
35
+ validateLicenseInfoAsync(request: carriers.License_ValidateLicenseInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
36
+ validateLicenseInfoAsync(licenseInfo: carriers.ExtendedLicenseInfo, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
37
+ activateLicenseInfoAsync(request: carriers.License_ActivateLicenseInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
38
+ activateLicenseInfoAsync(newLicense: carriers.ExtendedLicenseInfo, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
39
+ getLicenseStatusFromLicenseServerAsync(request: carriers.License_GetLicenseStatusFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CheckLicenseStatusResult >;
40
+ getLicenseStatusFromLicenseServerAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CheckLicenseStatusResult >;
41
+ getLicenseFromDBAsync(request: carriers.License_GetLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
42
+ getLicenseFromDBAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
43
+ getUserAndInstallationLicenceStatusAsync(request: carriers.License_GetUserAndInstallationLicenceStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserAndInstallationLicenceStatus >;
44
+ getUserAndInstallationLicenceStatusAsync(associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserAndInstallationLicenceStatus >;
45
+ changeSerialNumberAsync(request: carriers.License_ChangeSerialNumberRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
46
+ changeSerialNumberAsync(newCompanyName: string, newSerialNumber: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
47
+ getUserLicensesAsync(request: carriers.License_GetUserLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
48
+ getUserLicensesAsync(associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
49
+ getSatelliteLicensesAsync(request: carriers.License_GetSatelliteLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
50
+ getSatelliteLicensesAsync(satelliteId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
51
+ removeLicenseFromDBAsync(request: carriers.License_RemoveLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
52
+ removeLicenseFromDBAsync(moduleOwner: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
53
+ getLicenseFromFileAsync(request: carriers.License_GetLicenseFromFileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
54
+ getLicenseFromFileAsync(fileContent: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
55
+ getShopUrlAsync(request: carriers.License_GetShopUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
56
+ getShopUrlAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
57
+ getUserLicensesMDOListAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >;
58
+ getModuleLicenseFromDBAsync(request: carriers.License_GetModuleLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicense >;
59
+ getModuleLicenseFromDBAsync(ownerName: string, moduleName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicense >;
60
+ addLicenseFromFileAsync(request: carriers.License_AddLicenseFromFileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
61
+ addLicenseFromFileAsync(fileContent: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
62
+ getThirdPartyLicenseAssignmentsAsync(request: carriers.License_GetThirdPartyLicenseAssignmentsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
63
+ getThirdPartyLicenseAssignmentsAsync(associateId: number, moduleOwner: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
64
+ assignThirdPartyLicensesAsync(request: carriers.License_AssignThirdPartyLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
65
+ assignThirdPartyLicensesAsync(associateId: number, moduleOwner: string, moduleLicenseNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
66
+ unassignThirdPartyLicensesAsync(request: carriers.License_UnassignThirdPartyLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
67
+ unassignThirdPartyLicensesAsync(associateId: number, moduleOwner: string, moduleLicenseNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
68
+ getCentralLicenseAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
69
+ saveCentralLicenseAsync(request: carriers.License_SaveCentralLicenseRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
70
+ saveCentralLicenseAsync(license: carriers.LicenseOwner[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
71
+ } // interface ILicenseAgent
72
+
73
+
74
+
75
+
76
+ /**
77
+ * License query, download, activation
78
+ */
79
+ export class LicenseAgent extends base.WebApiBase implements ILicenseAgent {
80
+ constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
81
+ constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
82
+ constructor(baseUrl: string, resourceManager:any);
83
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
84
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
85
+ constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
86
+ constructor(options: base.WebApiOptions);
87
+
88
+ constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
89
+ langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
90
+ langOrResourceOrRM?:string|base.ResourceParsing|any,
91
+ cultureCode?: string,
92
+ ) {
93
+ const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
94
+ options.basePath = "v1/Agents/License/";
95
+ super(options);
96
+ }
97
+
98
+
99
+
100
+ private async _getLicenseForAllOwnersFromDBAsync( options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo[] > {
101
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
102
+ base.WebApiBase.SetPending(options);
103
+ return new Promise< carriers.ExtendedLicenseInfo[] >(async (resolve, reject) => {
104
+ try {
105
+ config.baseURL = this._options.baseUrl;
106
+ const response = await this._axios.post("GetLicenseForAllOwnersFromDB", undefined , config);
107
+ base.WebApiBase.SetCompleted(options, response);
108
+ const res : carriers.ExtendedLicenseInfo[] = converters.Create_ExtendedLicenseInfoArray_From( response.data );
109
+ resolve(res);
110
+ }
111
+ catch( err ) {
112
+ base.WebApiBase.HandleError(options, config, err);
113
+ reject(err);
114
+ }
115
+ });
116
+ }
117
+
118
+
119
+ /**
120
+ * Get all licenses, with usage, from all module owners as they are stored in the database
121
+ * @returns
122
+ */
123
+ public async getLicenseForAllOwnersFromDBAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo[] >
124
+ {
125
+ return this._getLicenseForAllOwnersFromDBAsync(webapi_options);
126
+ }
127
+
128
+
129
+ private async _getLicenseFromLicenseServerAsync(request: carriers.License_GetLicenseFromLicenseServerRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
130
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
131
+ base.WebApiBase.SetPending(options);
132
+ return new Promise< carriers.ExtendedLicenseInfo >(async (resolve, reject) => {
133
+ try {
134
+ config.baseURL = this._options.baseUrl;
135
+ const response = await this._axios.post("GetLicenseFromLicenseServer", request , config);
136
+ base.WebApiBase.SetCompleted(options, response);
137
+ const res : carriers.ExtendedLicenseInfo = converters.Create_ExtendedLicenseInfo_From( response.data );
138
+ resolve(res);
139
+ }
140
+ catch( err ) {
141
+ base.WebApiBase.HandleError(options, config, err);
142
+ reject(err);
143
+ }
144
+ });
145
+ }
146
+
147
+
148
+
149
+ /**
150
+ *
151
+ * @param request - OwnerName
152
+ * @returns
153
+ */
154
+ public async getLicenseFromLicenseServerAsync(request: carriers.License_GetLicenseFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
155
+
156
+ /**
157
+ *
158
+ * @param ownerName -
159
+ * @returns
160
+ */
161
+ public async getLicenseFromLicenseServerAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
162
+
163
+ public async getLicenseFromLicenseServerAsync(ownerName:string|carriers.License_GetLicenseFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
164
+ let _request : carriers.License_GetLicenseFromLicenseServerRequest = null;
165
+ let _options : base.WebApiRequestOptions = null;
166
+ const first : any = ownerName;
167
+ if( typeof( first ) === "object" && first && ( typeof(first.ownerName)!='undefined' ) )
168
+ {
169
+ _request = ownerName as carriers.License_GetLicenseFromLicenseServerRequest;
170
+ _options = webapi_options as base.WebApiRequestOptions;
171
+ }
172
+ else
173
+ {
174
+ _request = {
175
+ ownerName: ownerName as string,
176
+ };
177
+ _options = webapi_options;
178
+ }
179
+ return this._getLicenseFromLicenseServerAsync( _request, _options );
180
+ }
181
+
182
+
183
+ private async _getModuleLicenseHistoryFromLicenseServerAsync(request: carriers.License_GetModuleLicenseHistoryFromLicenseServerRequest, options?:base.WebApiRequestOptions) : Promise< string > {
184
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
185
+ base.WebApiBase.SetPending(options);
186
+ return new Promise< string >(async (resolve, reject) => {
187
+ try {
188
+ config.baseURL = this._options.baseUrl;
189
+ const response = await this._axios.post("GetModuleLicenseHistoryFromLicenseServer", request , config);
190
+ base.WebApiBase.SetCompleted(options, response);
191
+ const res : string = response.data as string;
192
+ resolve(res);
193
+ }
194
+ catch( err ) {
195
+ base.WebApiBase.HandleError(options, config, err);
196
+ reject(err);
197
+ }
198
+ });
199
+ }
200
+
201
+
202
+
203
+ /**
204
+ * Get details about a license from the license server.
205
+ * @param request - LicenseInfo, ModuleLicense
206
+ * @returns Information about a particular license module.
207
+ */
208
+ public async getModuleLicenseHistoryFromLicenseServerAsync(request: carriers.License_GetModuleLicenseHistoryFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
209
+
210
+ /**
211
+ * Get details about a license from the license server.
212
+ * @param licenseInfo - Description of the license
213
+ * @param moduleLicense - Information about a particular module to get information for.
214
+ * @returns Information about a particular license module.
215
+ */
216
+ public async getModuleLicenseHistoryFromLicenseServerAsync(licenseInfo: carriers.ExtendedLicenseInfo, moduleLicense: carriers.ExtendedModuleLicense, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
217
+
218
+ public async getModuleLicenseHistoryFromLicenseServerAsync(licenseInfo:carriers.ExtendedLicenseInfo|carriers.License_GetModuleLicenseHistoryFromLicenseServerRequest, moduleLicense?:carriers.ExtendedModuleLicense|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
219
+ let _request : carriers.License_GetModuleLicenseHistoryFromLicenseServerRequest = null;
220
+ let _options : base.WebApiRequestOptions = null;
221
+ const first : any = licenseInfo;
222
+ if( typeof( first ) === "object" && first && ( typeof(first.licenseInfo)!='undefined' || typeof(first.moduleLicense)!='undefined' ) )
223
+ {
224
+ _request = licenseInfo as carriers.License_GetModuleLicenseHistoryFromLicenseServerRequest;
225
+ _options = moduleLicense as base.WebApiRequestOptions;
226
+ }
227
+ else
228
+ {
229
+ _request = {
230
+ licenseInfo: licenseInfo as carriers.ExtendedLicenseInfo,
231
+ moduleLicense: moduleLicense as carriers.ExtendedModuleLicense,
232
+ };
233
+ _options = webapi_options;
234
+ }
235
+ return this._getModuleLicenseHistoryFromLicenseServerAsync( _request, _options );
236
+ }
237
+
238
+
239
+ private async _validateLicenseInfoAsync(request: carriers.License_ValidateLicenseInfoRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
240
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
241
+ base.WebApiBase.SetPending(options);
242
+ return new Promise< carriers.LicenseResult >(async (resolve, reject) => {
243
+ try {
244
+ config.baseURL = this._options.baseUrl;
245
+ const response = await this._axios.post("ValidateLicenseInfo", request , config);
246
+ base.WebApiBase.SetCompleted(options, response);
247
+ const res : carriers.LicenseResult = converters.Create_LicenseResult_From( response.data );
248
+ resolve(res);
249
+ }
250
+ catch( err ) {
251
+ base.WebApiBase.HandleError(options, config, err);
252
+ reject(err);
253
+ }
254
+ });
255
+ }
256
+
257
+
258
+
259
+ /**
260
+ * Validate that a license is consistant.
261
+ * @param request - LicenseInfo
262
+ * @returns
263
+ */
264
+ public async validateLicenseInfoAsync(request: carriers.License_ValidateLicenseInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
265
+
266
+ /**
267
+ * Validate that a license is consistant.
268
+ * @param licenseInfo - License to validate consistancy for
269
+ * @returns
270
+ */
271
+ public async validateLicenseInfoAsync(licenseInfo: carriers.ExtendedLicenseInfo, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
272
+
273
+ public async validateLicenseInfoAsync(licenseInfo:carriers.ExtendedLicenseInfo|carriers.License_ValidateLicenseInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
274
+ let _request : carriers.License_ValidateLicenseInfoRequest = null;
275
+ let _options : base.WebApiRequestOptions = null;
276
+ const first : any = licenseInfo;
277
+ if( typeof( first ) === "object" && first && ( typeof(first.licenseInfo)!='undefined' ) )
278
+ {
279
+ _request = licenseInfo as carriers.License_ValidateLicenseInfoRequest;
280
+ _options = webapi_options as base.WebApiRequestOptions;
281
+ }
282
+ else
283
+ {
284
+ _request = {
285
+ licenseInfo: licenseInfo as carriers.ExtendedLicenseInfo,
286
+ };
287
+ _options = webapi_options;
288
+ }
289
+ return this._validateLicenseInfoAsync( _request, _options );
290
+ }
291
+
292
+
293
+ private async _activateLicenseInfoAsync(request: carriers.License_ActivateLicenseInfoRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
294
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
295
+ base.WebApiBase.SetPending(options);
296
+ return new Promise< carriers.LicenseResult >(async (resolve, reject) => {
297
+ try {
298
+ config.baseURL = this._options.baseUrl;
299
+ const response = await this._axios.post("ActivateLicenseInfo", request , config);
300
+ base.WebApiBase.SetCompleted(options, response);
301
+ const res : carriers.LicenseResult = converters.Create_LicenseResult_From( response.data );
302
+ resolve(res);
303
+ }
304
+ catch( err ) {
305
+ base.WebApiBase.HandleError(options, config, err);
306
+ reject(err);
307
+ }
308
+ });
309
+ }
310
+
311
+
312
+
313
+ /**
314
+ * Save a new license to the database.
315
+ * @param request - NewLicense
316
+ * @returns
317
+ */
318
+ public async activateLicenseInfoAsync(request: carriers.License_ActivateLicenseInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
319
+
320
+ /**
321
+ * Save a new license to the database.
322
+ * @param newLicense - New license to save to the database.
323
+ * @returns
324
+ */
325
+ public async activateLicenseInfoAsync(newLicense: carriers.ExtendedLicenseInfo, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
326
+
327
+ public async activateLicenseInfoAsync(newLicense:carriers.ExtendedLicenseInfo|carriers.License_ActivateLicenseInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
328
+ let _request : carriers.License_ActivateLicenseInfoRequest = null;
329
+ let _options : base.WebApiRequestOptions = null;
330
+ const first : any = newLicense;
331
+ if( typeof( first ) === "object" && first && ( typeof(first.newLicense)!='undefined' ) )
332
+ {
333
+ _request = newLicense as carriers.License_ActivateLicenseInfoRequest;
334
+ _options = webapi_options as base.WebApiRequestOptions;
335
+ }
336
+ else
337
+ {
338
+ _request = {
339
+ newLicense: newLicense as carriers.ExtendedLicenseInfo,
340
+ };
341
+ _options = webapi_options;
342
+ }
343
+ return this._activateLicenseInfoAsync( _request, _options );
344
+ }
345
+
346
+
347
+ private async _getLicenseStatusFromLicenseServerAsync(request: carriers.License_GetLicenseStatusFromLicenseServerRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CheckLicenseStatusResult > {
348
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
349
+ base.WebApiBase.SetPending(options);
350
+ return new Promise< carriers.CheckLicenseStatusResult >(async (resolve, reject) => {
351
+ try {
352
+ config.baseURL = this._options.baseUrl;
353
+ const response = await this._axios.post("GetLicenseStatusFromLicenseServer", request , config);
354
+ base.WebApiBase.SetCompleted(options, response);
355
+ const res : carriers.CheckLicenseStatusResult = converters.Create_CheckLicenseStatusResult_From( response.data );
356
+ resolve(res);
357
+ }
358
+ catch( err ) {
359
+ base.WebApiBase.HandleError(options, config, err);
360
+ reject(err);
361
+ }
362
+ });
363
+ }
364
+
365
+
366
+
367
+ /**
368
+ * Get License from the license server for a particular module owner.
369
+ * @param request - OwnerName
370
+ * @returns License from the database, from the license server and with usage.
371
+ */
372
+ public async getLicenseStatusFromLicenseServerAsync(request: carriers.License_GetLicenseStatusFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CheckLicenseStatusResult >;
373
+
374
+ /**
375
+ * Get License from the license server for a particular module owner.
376
+ * @param ownerName - Name of the module owner to get license from.
377
+ * @returns License from the database, from the license server and with usage.
378
+ */
379
+ public async getLicenseStatusFromLicenseServerAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CheckLicenseStatusResult >;
380
+
381
+ public async getLicenseStatusFromLicenseServerAsync(ownerName:string|carriers.License_GetLicenseStatusFromLicenseServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CheckLicenseStatusResult > {
382
+ let _request : carriers.License_GetLicenseStatusFromLicenseServerRequest = null;
383
+ let _options : base.WebApiRequestOptions = null;
384
+ const first : any = ownerName;
385
+ if( typeof( first ) === "object" && first && ( typeof(first.ownerName)!='undefined' ) )
386
+ {
387
+ _request = ownerName as carriers.License_GetLicenseStatusFromLicenseServerRequest;
388
+ _options = webapi_options as base.WebApiRequestOptions;
389
+ }
390
+ else
391
+ {
392
+ _request = {
393
+ ownerName: ownerName as string,
394
+ };
395
+ _options = webapi_options;
396
+ }
397
+ return this._getLicenseStatusFromLicenseServerAsync( _request, _options );
398
+ }
399
+
400
+
401
+ private async _getLicenseFromDBAsync(request: carriers.License_GetLicenseFromDBRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
402
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
403
+ base.WebApiBase.SetPending(options);
404
+ return new Promise< carriers.ExtendedLicenseInfo >(async (resolve, reject) => {
405
+ try {
406
+ config.baseURL = this._options.baseUrl;
407
+ const response = await this._axios.post("GetLicenseFromDB", request , config);
408
+ base.WebApiBase.SetCompleted(options, response);
409
+ const res : carriers.ExtendedLicenseInfo = converters.Create_ExtendedLicenseInfo_From( response.data );
410
+ resolve(res);
411
+ }
412
+ catch( err ) {
413
+ base.WebApiBase.HandleError(options, config, err);
414
+ reject(err);
415
+ }
416
+ });
417
+ }
418
+
419
+
420
+
421
+ /**
422
+ * Get license, with usage, as it is stored in the database for one particular module owner.
423
+ * @param request - OwnerName
424
+ * @returns License, with usage, as it is stored in the database.
425
+ */
426
+ public async getLicenseFromDBAsync(request: carriers.License_GetLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
427
+
428
+ /**
429
+ * Get license, with usage, as it is stored in the database for one particular module owner.
430
+ * @param ownerName - Name of the module owner.
431
+ * @returns License, with usage, as it is stored in the database.
432
+ */
433
+ public async getLicenseFromDBAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
434
+
435
+ public async getLicenseFromDBAsync(ownerName:string|carriers.License_GetLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
436
+ let _request : carriers.License_GetLicenseFromDBRequest = null;
437
+ let _options : base.WebApiRequestOptions = null;
438
+ const first : any = ownerName;
439
+ if( typeof( first ) === "object" && first && ( typeof(first.ownerName)!='undefined' ) )
440
+ {
441
+ _request = ownerName as carriers.License_GetLicenseFromDBRequest;
442
+ _options = webapi_options as base.WebApiRequestOptions;
443
+ }
444
+ else
445
+ {
446
+ _request = {
447
+ ownerName: ownerName as string,
448
+ };
449
+ _options = webapi_options;
450
+ }
451
+ return this._getLicenseFromDBAsync( _request, _options );
452
+ }
453
+
454
+
455
+ private async _getUserAndInstallationLicenceStatusAsync(request: carriers.License_GetUserAndInstallationLicenceStatusRequest, options?:base.WebApiRequestOptions) : Promise< carriers.UserAndInstallationLicenceStatus > {
456
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
457
+ base.WebApiBase.SetPending(options);
458
+ return new Promise< carriers.UserAndInstallationLicenceStatus >(async (resolve, reject) => {
459
+ try {
460
+ config.baseURL = this._options.baseUrl;
461
+ const response = await this._axios.post("GetUserAndInstallationLicenceStatus", request , config);
462
+ base.WebApiBase.SetCompleted(options, response);
463
+ const res : carriers.UserAndInstallationLicenceStatus = converters.Create_UserAndInstallationLicenceStatus_From( response.data );
464
+ resolve(res);
465
+ }
466
+ catch( err ) {
467
+ base.WebApiBase.HandleError(options, config, err);
468
+ reject(err);
469
+ }
470
+ });
471
+ }
472
+
473
+
474
+
475
+ /**
476
+ * Get status values for user licenses and installation license that can be used for feedback to the user.
477
+ * @param request - AssociateId
478
+ * @returns An object that holds information for producing license status feedback to the user.
479
+ */
480
+ public async getUserAndInstallationLicenceStatusAsync(request: carriers.License_GetUserAndInstallationLicenceStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserAndInstallationLicenceStatus >;
481
+
482
+ /**
483
+ * Get status values for user licenses and installation license that can be used for feedback to the user.
484
+ * @param associateId - Associate id to use when loading information about user licenses and installation license status.
485
+ * @returns An object that holds information for producing license status feedback to the user.
486
+ */
487
+ public async getUserAndInstallationLicenceStatusAsync(associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserAndInstallationLicenceStatus >;
488
+
489
+ public async getUserAndInstallationLicenceStatusAsync(associateId:number|carriers.License_GetUserAndInstallationLicenceStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UserAndInstallationLicenceStatus > {
490
+ let _request : carriers.License_GetUserAndInstallationLicenceStatusRequest = null;
491
+ let _options : base.WebApiRequestOptions = null;
492
+ const first : any = associateId;
493
+ if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' ) )
494
+ {
495
+ _request = associateId as carriers.License_GetUserAndInstallationLicenceStatusRequest;
496
+ _options = webapi_options as base.WebApiRequestOptions;
497
+ }
498
+ else
499
+ {
500
+ _request = {
501
+ associateId: associateId as number,
502
+ };
503
+ _options = webapi_options;
504
+ }
505
+ return this._getUserAndInstallationLicenceStatusAsync( _request, _options );
506
+ }
507
+
508
+
509
+ private async _changeSerialNumberAsync(request: carriers.License_ChangeSerialNumberRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
510
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
511
+ base.WebApiBase.SetPending(options);
512
+ return new Promise< carriers.LicenseResult >(async (resolve, reject) => {
513
+ try {
514
+ config.baseURL = this._options.baseUrl;
515
+ const response = await this._axios.post("ChangeSerialNumber", request , config);
516
+ base.WebApiBase.SetCompleted(options, response);
517
+ const res : carriers.LicenseResult = converters.Create_LicenseResult_From( response.data );
518
+ resolve(res);
519
+ }
520
+ catch( err ) {
521
+ base.WebApiBase.HandleError(options, config, err);
522
+ reject(err);
523
+ }
524
+ });
525
+ }
526
+
527
+
528
+
529
+ /**
530
+ * Change the new serial number for the installation. Requests a new license from SuperLicense, checks if change is authorized.
531
+ * @param request - NewCompanyName, NewSerialNumber
532
+ * @returns License after serial number/name change
533
+ */
534
+ public async changeSerialNumberAsync(request: carriers.License_ChangeSerialNumberRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
535
+
536
+ /**
537
+ * Change the new serial number for the installation. Requests a new license from SuperLicense, checks if change is authorized.
538
+ * @param newCompanyName - The new company name
539
+ * @param newSerialNumber - New serial number to change to.
540
+ * @returns License after serial number/name change
541
+ */
542
+ public async changeSerialNumberAsync(newCompanyName: string, newSerialNumber: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
543
+
544
+ public async changeSerialNumberAsync(newCompanyName:string|carriers.License_ChangeSerialNumberRequest, newSerialNumber?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
545
+ let _request : carriers.License_ChangeSerialNumberRequest = null;
546
+ let _options : base.WebApiRequestOptions = null;
547
+ const first : any = newCompanyName;
548
+ if( typeof( first ) === "object" && first && ( typeof(first.newCompanyName)!='undefined' || typeof(first.newSerialNumber)!='undefined' ) )
549
+ {
550
+ _request = newCompanyName as carriers.License_ChangeSerialNumberRequest;
551
+ _options = newSerialNumber as base.WebApiRequestOptions;
552
+ }
553
+ else
554
+ {
555
+ _request = {
556
+ newCompanyName: newCompanyName as string,
557
+ newSerialNumber: newSerialNumber as string,
558
+ };
559
+ _options = webapi_options;
560
+ }
561
+ return this._changeSerialNumberAsync( _request, _options );
562
+ }
563
+
564
+
565
+ private async _getUserLicensesAsync(request: carriers.License_GetUserLicensesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
566
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
567
+ base.WebApiBase.SetPending(options);
568
+ return new Promise< carriers.LicenseOwner[] >(async (resolve, reject) => {
569
+ try {
570
+ config.baseURL = this._options.baseUrl;
571
+ const response = await this._axios.post("GetUserLicenses", request , config);
572
+ base.WebApiBase.SetCompleted(options, response);
573
+ const res : carriers.LicenseOwner[] = converters.Create_LicenseOwnerArray_From( response.data );
574
+ resolve(res);
575
+ }
576
+ catch( err ) {
577
+ base.WebApiBase.HandleError(options, config, err);
578
+ reject(err);
579
+ }
580
+ });
581
+ }
582
+
583
+
584
+
585
+ /**
586
+ * Obtain information about associate module licenses
587
+ * @param request - AssociateId
588
+ * @returns Associate module licenses grouped by owners.
589
+ */
590
+ public async getUserLicensesAsync(request: carriers.License_GetUserLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
591
+
592
+ /**
593
+ * Obtain information about associate module licenses
594
+ * @param associateId - Associate id to check for associate module licenses
595
+ * @returns Associate module licenses grouped by owners.
596
+ */
597
+ public async getUserLicensesAsync(associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
598
+
599
+ public async getUserLicensesAsync(associateId:number|carriers.License_GetUserLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
600
+ let _request : carriers.License_GetUserLicensesRequest = null;
601
+ let _options : base.WebApiRequestOptions = null;
602
+ const first : any = associateId;
603
+ if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' ) )
604
+ {
605
+ _request = associateId as carriers.License_GetUserLicensesRequest;
606
+ _options = webapi_options as base.WebApiRequestOptions;
607
+ }
608
+ else
609
+ {
610
+ _request = {
611
+ associateId: associateId as number,
612
+ };
613
+ _options = webapi_options;
614
+ }
615
+ return this._getUserLicensesAsync( _request, _options );
616
+ }
617
+
618
+
619
+ private async _getSatelliteLicensesAsync(request: carriers.License_GetSatelliteLicensesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
620
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
621
+ base.WebApiBase.SetPending(options);
622
+ return new Promise< carriers.LicenseOwner[] >(async (resolve, reject) => {
623
+ try {
624
+ config.baseURL = this._options.baseUrl;
625
+ const response = await this._axios.post("GetSatelliteLicenses", request , config);
626
+ base.WebApiBase.SetCompleted(options, response);
627
+ const res : carriers.LicenseOwner[] = converters.Create_LicenseOwnerArray_From( response.data );
628
+ resolve(res);
629
+ }
630
+ catch( err ) {
631
+ base.WebApiBase.HandleError(options, config, err);
632
+ reject(err);
633
+ }
634
+ });
635
+ }
636
+
637
+
638
+
639
+ /**
640
+ * Obtain information about satellite module licenses
641
+ * @param request - SatelliteId
642
+ * @returns Satellite module licenses grouped by owners.
643
+ */
644
+ public async getSatelliteLicensesAsync(request: carriers.License_GetSatelliteLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
645
+
646
+ /**
647
+ * Obtain information about satellite module licenses
648
+ * @param satelliteId - Satellite id to check for satellite module licenses
649
+ * @returns Satellite module licenses grouped by owners.
650
+ */
651
+ public async getSatelliteLicensesAsync(satelliteId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
652
+
653
+ public async getSatelliteLicensesAsync(satelliteId:number|carriers.License_GetSatelliteLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
654
+ let _request : carriers.License_GetSatelliteLicensesRequest = null;
655
+ let _options : base.WebApiRequestOptions = null;
656
+ const first : any = satelliteId;
657
+ if( typeof( first ) === "object" && first && ( typeof(first.satelliteId)!='undefined' ) )
658
+ {
659
+ _request = satelliteId as carriers.License_GetSatelliteLicensesRequest;
660
+ _options = webapi_options as base.WebApiRequestOptions;
661
+ }
662
+ else
663
+ {
664
+ _request = {
665
+ satelliteId: satelliteId as number,
666
+ };
667
+ _options = webapi_options;
668
+ }
669
+ return this._getSatelliteLicensesAsync( _request, _options );
670
+ }
671
+
672
+
673
+ private async _removeLicenseFromDBAsync(request: carriers.License_RemoveLicenseFromDBRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
674
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
675
+ base.WebApiBase.SetPending(options);
676
+ return new Promise< carriers.LicenseResult >(async (resolve, reject) => {
677
+ try {
678
+ config.baseURL = this._options.baseUrl;
679
+ const response = await this._axios.post("RemoveLicenseFromDB", request , config);
680
+ base.WebApiBase.SetCompleted(options, response);
681
+ const res : carriers.LicenseResult = converters.Create_LicenseResult_From( response.data );
682
+ resolve(res);
683
+ }
684
+ catch( err ) {
685
+ base.WebApiBase.HandleError(options, config, err);
686
+ reject(err);
687
+ }
688
+ });
689
+ }
690
+
691
+
692
+
693
+ /**
694
+ * Remove the license from a particular module owner from the database. It is not permitted to remove licenses from SuperOffice
695
+ * @param request - ModuleOwner
696
+ * @returns
697
+ */
698
+ public async removeLicenseFromDBAsync(request: carriers.License_RemoveLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
699
+
700
+ /**
701
+ * Remove the license from a particular module owner from the database. It is not permitted to remove licenses from SuperOffice
702
+ * @param moduleOwner - Name of the module owner to remove license from.
703
+ * @returns
704
+ */
705
+ public async removeLicenseFromDBAsync(moduleOwner: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult >;
706
+
707
+ public async removeLicenseFromDBAsync(moduleOwner:string|carriers.License_RemoveLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseResult > {
708
+ let _request : carriers.License_RemoveLicenseFromDBRequest = null;
709
+ let _options : base.WebApiRequestOptions = null;
710
+ const first : any = moduleOwner;
711
+ if( typeof( first ) === "object" && first && ( typeof(first.moduleOwner)!='undefined' ) )
712
+ {
713
+ _request = moduleOwner as carriers.License_RemoveLicenseFromDBRequest;
714
+ _options = webapi_options as base.WebApiRequestOptions;
715
+ }
716
+ else
717
+ {
718
+ _request = {
719
+ moduleOwner: moduleOwner as string,
720
+ };
721
+ _options = webapi_options;
722
+ }
723
+ return this._removeLicenseFromDBAsync( _request, _options );
724
+ }
725
+
726
+
727
+ private async _getLicenseFromFileAsync(request: carriers.License_GetLicenseFromFileRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
728
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
729
+ base.WebApiBase.SetPending(options);
730
+ return new Promise< carriers.ExtendedLicenseInfo >(async (resolve, reject) => {
731
+ try {
732
+ config.baseURL = this._options.baseUrl;
733
+ const response = await this._axios.post("GetLicenseFromFile", request , config);
734
+ base.WebApiBase.SetCompleted(options, response);
735
+ const res : carriers.ExtendedLicenseInfo = converters.Create_ExtendedLicenseInfo_From( response.data );
736
+ resolve(res);
737
+ }
738
+ catch( err ) {
739
+ base.WebApiBase.HandleError(options, config, err);
740
+ reject(err);
741
+ }
742
+ });
743
+ }
744
+
745
+
746
+
747
+ /**
748
+ * Load a new license from file
749
+ * @param request - FileContent
750
+ * @returns
751
+ */
752
+ public async getLicenseFromFileAsync(request: carriers.License_GetLicenseFromFileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
753
+
754
+ /**
755
+ * Load a new license from file
756
+ * @param fileContent - Content of the license file as read.
757
+ * @returns
758
+ */
759
+ public async getLicenseFromFileAsync(fileContent: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
760
+
761
+ public async getLicenseFromFileAsync(fileContent:string|carriers.License_GetLicenseFromFileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
762
+ let _request : carriers.License_GetLicenseFromFileRequest = null;
763
+ let _options : base.WebApiRequestOptions = null;
764
+ const first : any = fileContent;
765
+ if( typeof( first ) === "object" && first && ( typeof(first.fileContent)!='undefined' ) )
766
+ {
767
+ _request = fileContent as carriers.License_GetLicenseFromFileRequest;
768
+ _options = webapi_options as base.WebApiRequestOptions;
769
+ }
770
+ else
771
+ {
772
+ _request = {
773
+ fileContent: fileContent as string,
774
+ };
775
+ _options = webapi_options;
776
+ }
777
+ return this._getLicenseFromFileAsync( _request, _options );
778
+ }
779
+
780
+
781
+ private async _getShopUrlAsync(request: carriers.License_GetShopUrlRequest, options?:base.WebApiRequestOptions) : Promise< string > {
782
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
783
+ base.WebApiBase.SetPending(options);
784
+ return new Promise< string >(async (resolve, reject) => {
785
+ try {
786
+ config.baseURL = this._options.baseUrl;
787
+ const response = await this._axios.post("GetShopUrl", request , config);
788
+ base.WebApiBase.SetCompleted(options, response);
789
+ const res : string = response.data as string;
790
+ resolve(res);
791
+ }
792
+ catch( err ) {
793
+ base.WebApiBase.HandleError(options, config, err);
794
+ reject(err);
795
+ }
796
+ });
797
+ }
798
+
799
+
800
+
801
+ /**
802
+ * Get the shop URL for the specified module owner. This can be used to redirect user to the web shop.
803
+ * @param request - OwnerName
804
+ * @returns The URL which contains the shop for the specified module owner.
805
+ */
806
+ public async getShopUrlAsync(request: carriers.License_GetShopUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
807
+
808
+ /**
809
+ * Get the shop URL for the specified module owner. This can be used to redirect user to the web shop.
810
+ * @param ownerName - Name of the module owner.
811
+ * @returns The URL which contains the shop for the specified module owner.
812
+ */
813
+ public async getShopUrlAsync(ownerName: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
814
+
815
+ public async getShopUrlAsync(ownerName:string|carriers.License_GetShopUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
816
+ let _request : carriers.License_GetShopUrlRequest = null;
817
+ let _options : base.WebApiRequestOptions = null;
818
+ const first : any = ownerName;
819
+ if( typeof( first ) === "object" && first && ( typeof(first.ownerName)!='undefined' ) )
820
+ {
821
+ _request = ownerName as carriers.License_GetShopUrlRequest;
822
+ _options = webapi_options as base.WebApiRequestOptions;
823
+ }
824
+ else
825
+ {
826
+ _request = {
827
+ ownerName: ownerName as string,
828
+ };
829
+ _options = webapi_options;
830
+ }
831
+ return this._getShopUrlAsync( _request, _options );
832
+ }
833
+
834
+
835
+ private async _getUserLicensesMDOListAsync( options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] > {
836
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
837
+ base.WebApiBase.SetPending(options);
838
+ return new Promise< carriers.SelectableMDOListItem[] >(async (resolve, reject) => {
839
+ try {
840
+ config.baseURL = this._options.baseUrl;
841
+ const response = await this._axios.post("GetUserLicensesMDOList", undefined , config);
842
+ base.WebApiBase.SetCompleted(options, response);
843
+ const res : carriers.SelectableMDOListItem[] = converters.Create_SelectableMDOListItemArray_From( response.data );
844
+ resolve(res);
845
+ }
846
+ catch( err ) {
847
+ base.WebApiBase.HandleError(options, config, err);
848
+ reject(err);
849
+ }
850
+ });
851
+ }
852
+
853
+
854
+ /**
855
+ * Get all licenses in a MDOListItem structure.
856
+ * @returns Hierarchical structure of user licenses.
857
+ */
858
+ public async getUserLicensesMDOListAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectableMDOListItem[] >
859
+ {
860
+ return this._getUserLicensesMDOListAsync(webapi_options);
861
+ }
862
+
863
+
864
+ private async _getModuleLicenseFromDBAsync(request: carriers.License_GetModuleLicenseFromDBRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicense > {
865
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
866
+ base.WebApiBase.SetPending(options);
867
+ return new Promise< carriers.ModuleLicense >(async (resolve, reject) => {
868
+ try {
869
+ config.baseURL = this._options.baseUrl;
870
+ const response = await this._axios.post("GetModuleLicenseFromDB", request , config);
871
+ base.WebApiBase.SetCompleted(options, response);
872
+ const res : carriers.ModuleLicense = converters.Create_ModuleLicense_From( response.data );
873
+ resolve(res);
874
+ }
875
+ catch( err ) {
876
+ base.WebApiBase.HandleError(options, config, err);
877
+ reject(err);
878
+ }
879
+ });
880
+ }
881
+
882
+
883
+
884
+ /**
885
+ * Get license information for one particular license module.
886
+ * @param request - OwnerName, ModuleName
887
+ * @returns Module License details, as it is stored in the database. NULL if not found.
888
+ */
889
+ public async getModuleLicenseFromDBAsync(request: carriers.License_GetModuleLicenseFromDBRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicense >;
890
+
891
+ /**
892
+ * Get license information for one particular license module.
893
+ * @param ownerName - Name of the module owner.
894
+ * @param moduleName - Name of the license module.
895
+ * @returns Module License details, as it is stored in the database. NULL if not found.
896
+ */
897
+ public async getModuleLicenseFromDBAsync(ownerName: string, moduleName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicense >;
898
+
899
+ public async getModuleLicenseFromDBAsync(ownerName:string|carriers.License_GetModuleLicenseFromDBRequest, moduleName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicense > {
900
+ let _request : carriers.License_GetModuleLicenseFromDBRequest = null;
901
+ let _options : base.WebApiRequestOptions = null;
902
+ const first : any = ownerName;
903
+ if( typeof( first ) === "object" && first && ( typeof(first.ownerName)!='undefined' || typeof(first.moduleName)!='undefined' ) )
904
+ {
905
+ _request = ownerName as carriers.License_GetModuleLicenseFromDBRequest;
906
+ _options = moduleName as base.WebApiRequestOptions;
907
+ }
908
+ else
909
+ {
910
+ _request = {
911
+ ownerName: ownerName as string,
912
+ moduleName: moduleName as string,
913
+ };
914
+ _options = webapi_options;
915
+ }
916
+ return this._getModuleLicenseFromDBAsync( _request, _options );
917
+ }
918
+
919
+
920
+ private async _addLicenseFromFileAsync(request: carriers.License_AddLicenseFromFileRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
921
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
922
+ base.WebApiBase.SetPending(options);
923
+ return new Promise< carriers.ExtendedLicenseInfo >(async (resolve, reject) => {
924
+ try {
925
+ config.baseURL = this._options.baseUrl;
926
+ const response = await this._axios.post("AddLicenseFromFile", request , config);
927
+ base.WebApiBase.SetCompleted(options, response);
928
+ const res : carriers.ExtendedLicenseInfo = converters.Create_ExtendedLicenseInfo_From( response.data );
929
+ resolve(res);
930
+ }
931
+ catch( err ) {
932
+ base.WebApiBase.HandleError(options, config, err);
933
+ reject(err);
934
+ }
935
+ });
936
+ }
937
+
938
+
939
+
940
+ /**
941
+ * Load and activate a new license from file/string if the new license is valid.
942
+ * @param request - FileContent
943
+ * @returns Activated license
944
+ */
945
+ public async addLicenseFromFileAsync(request: carriers.License_AddLicenseFromFileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
946
+
947
+ /**
948
+ * Load and activate a new license from file/string if the new license is valid.
949
+ * @param fileContent - Content of the license file as XML.
950
+ * @returns Activated license
951
+ */
952
+ public async addLicenseFromFileAsync(fileContent: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo >;
953
+
954
+ public async addLicenseFromFileAsync(fileContent:string|carriers.License_AddLicenseFromFileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ExtendedLicenseInfo > {
955
+ let _request : carriers.License_AddLicenseFromFileRequest = null;
956
+ let _options : base.WebApiRequestOptions = null;
957
+ const first : any = fileContent;
958
+ if( typeof( first ) === "object" && first && ( typeof(first.fileContent)!='undefined' ) )
959
+ {
960
+ _request = fileContent as carriers.License_AddLicenseFromFileRequest;
961
+ _options = webapi_options as base.WebApiRequestOptions;
962
+ }
963
+ else
964
+ {
965
+ _request = {
966
+ fileContent: fileContent as string,
967
+ };
968
+ _options = webapi_options;
969
+ }
970
+ return this._addLicenseFromFileAsync( _request, _options );
971
+ }
972
+
973
+
974
+ private async _getThirdPartyLicenseAssignmentsAsync(request: carriers.License_GetThirdPartyLicenseAssignmentsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] > {
975
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
976
+ base.WebApiBase.SetPending(options);
977
+ return new Promise< carriers.ModuleLicenseLink[] >(async (resolve, reject) => {
978
+ try {
979
+ config.baseURL = this._options.baseUrl;
980
+ const response = await this._axios.post("GetThirdPartyLicenseAssignments", request , config);
981
+ base.WebApiBase.SetCompleted(options, response);
982
+ const res : carriers.ModuleLicenseLink[] = converters.Create_ModuleLicenseLinkArray_From( response.data );
983
+ resolve(res);
984
+ }
985
+ catch( err ) {
986
+ base.WebApiBase.HandleError(options, config, err);
987
+ reject(err);
988
+ }
989
+ });
990
+ }
991
+
992
+
993
+
994
+ /**
995
+ * Get license assignments for an associate for licenses belonging to an other module owner than SuperOffice
996
+ * @param request - AssociateId, ModuleOwner
997
+ * @returns Module license names
998
+ */
999
+ public async getThirdPartyLicenseAssignmentsAsync(request: carriers.License_GetThirdPartyLicenseAssignmentsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
1000
+
1001
+ /**
1002
+ * Get license assignments for an associate for licenses belonging to an other module owner than SuperOffice
1003
+ * @param associateId - User to get third party license assignments for
1004
+ * @param moduleOwner - Name of the module owner to get license assignments for
1005
+ * @returns Module license names
1006
+ */
1007
+ public async getThirdPartyLicenseAssignmentsAsync(associateId: number, moduleOwner: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
1008
+
1009
+ public async getThirdPartyLicenseAssignmentsAsync(associateId:number|carriers.License_GetThirdPartyLicenseAssignmentsRequest, moduleOwner?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] > {
1010
+ let _request : carriers.License_GetThirdPartyLicenseAssignmentsRequest = null;
1011
+ let _options : base.WebApiRequestOptions = null;
1012
+ const first : any = associateId;
1013
+ if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' || typeof(first.moduleOwner)!='undefined' ) )
1014
+ {
1015
+ _request = associateId as carriers.License_GetThirdPartyLicenseAssignmentsRequest;
1016
+ _options = moduleOwner as base.WebApiRequestOptions;
1017
+ }
1018
+ else
1019
+ {
1020
+ _request = {
1021
+ associateId: associateId as number,
1022
+ moduleOwner: moduleOwner as string,
1023
+ };
1024
+ _options = webapi_options;
1025
+ }
1026
+ return this._getThirdPartyLicenseAssignmentsAsync( _request, _options );
1027
+ }
1028
+
1029
+
1030
+ private async _assignThirdPartyLicensesAsync(request: carriers.License_AssignThirdPartyLicensesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] > {
1031
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1032
+ base.WebApiBase.SetPending(options);
1033
+ return new Promise< carriers.ModuleLicenseLink[] >(async (resolve, reject) => {
1034
+ try {
1035
+ config.baseURL = this._options.baseUrl;
1036
+ const response = await this._axios.post("AssignThirdPartyLicenses", request , config);
1037
+ base.WebApiBase.SetCompleted(options, response);
1038
+ const res : carriers.ModuleLicenseLink[] = converters.Create_ModuleLicenseLinkArray_From( response.data );
1039
+ resolve(res);
1040
+ }
1041
+ catch( err ) {
1042
+ base.WebApiBase.HandleError(options, config, err);
1043
+ reject(err);
1044
+ }
1045
+ });
1046
+ }
1047
+
1048
+
1049
+
1050
+ /**
1051
+ * Assign third party licenses
1052
+ * @param request - AssociateId, ModuleOwner, ModuleLicenseNames
1053
+ * @returns All module license names assigned
1054
+ */
1055
+ public async assignThirdPartyLicensesAsync(request: carriers.License_AssignThirdPartyLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
1056
+
1057
+ /**
1058
+ * Assign third party licenses
1059
+ * @param associateId - User to assign third party licenses for
1060
+ * @param moduleOwner - Name of the module owner to assign license for
1061
+ * @param moduleLicenseNames - Name of module licenses to assign
1062
+ * @returns All module license names assigned
1063
+ */
1064
+ public async assignThirdPartyLicensesAsync(associateId: number, moduleOwner: string, moduleLicenseNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
1065
+
1066
+ public async assignThirdPartyLicensesAsync(associateId:number|carriers.License_AssignThirdPartyLicensesRequest, moduleOwner?:string|base.WebApiRequestOptions, moduleLicenseNames?:string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] > {
1067
+ let _request : carriers.License_AssignThirdPartyLicensesRequest = null;
1068
+ let _options : base.WebApiRequestOptions = null;
1069
+ const first : any = associateId;
1070
+ if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' || typeof(first.moduleOwner)!='undefined' || typeof(first.moduleLicenseNames)!='undefined' ) )
1071
+ {
1072
+ _request = associateId as carriers.License_AssignThirdPartyLicensesRequest;
1073
+ _options = moduleOwner as base.WebApiRequestOptions;
1074
+ }
1075
+ else
1076
+ {
1077
+ _request = {
1078
+ associateId: associateId as number,
1079
+ moduleOwner: moduleOwner as string,
1080
+ moduleLicenseNames: moduleLicenseNames as string[],
1081
+ };
1082
+ _options = webapi_options;
1083
+ }
1084
+ return this._assignThirdPartyLicensesAsync( _request, _options );
1085
+ }
1086
+
1087
+
1088
+ private async _unassignThirdPartyLicensesAsync(request: carriers.License_UnassignThirdPartyLicensesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] > {
1089
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1090
+ base.WebApiBase.SetPending(options);
1091
+ return new Promise< carriers.ModuleLicenseLink[] >(async (resolve, reject) => {
1092
+ try {
1093
+ config.baseURL = this._options.baseUrl;
1094
+ const response = await this._axios.post("UnassignThirdPartyLicenses", request , config);
1095
+ base.WebApiBase.SetCompleted(options, response);
1096
+ const res : carriers.ModuleLicenseLink[] = converters.Create_ModuleLicenseLinkArray_From( response.data );
1097
+ resolve(res);
1098
+ }
1099
+ catch( err ) {
1100
+ base.WebApiBase.HandleError(options, config, err);
1101
+ reject(err);
1102
+ }
1103
+ });
1104
+ }
1105
+
1106
+
1107
+
1108
+ /**
1109
+ * Unassign (remove) third party licenses
1110
+ * @param request - AssociateId, ModuleOwner, ModuleLicenseNames
1111
+ * @returns All module license names assigned
1112
+ */
1113
+ public async unassignThirdPartyLicensesAsync(request: carriers.License_UnassignThirdPartyLicensesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
1114
+
1115
+ /**
1116
+ * Unassign (remove) third party licenses
1117
+ * @param associateId - User to unassign third party licenses for
1118
+ * @param moduleOwner - Name of the module owner to unassign license for
1119
+ * @param moduleLicenseNames - Name of module licenses to unassign (remove)
1120
+ * @returns All module license names assigned
1121
+ */
1122
+ public async unassignThirdPartyLicensesAsync(associateId: number, moduleOwner: string, moduleLicenseNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] >;
1123
+
1124
+ public async unassignThirdPartyLicensesAsync(associateId:number|carriers.License_UnassignThirdPartyLicensesRequest, moduleOwner?:string|base.WebApiRequestOptions, moduleLicenseNames?:string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ModuleLicenseLink[] > {
1125
+ let _request : carriers.License_UnassignThirdPartyLicensesRequest = null;
1126
+ let _options : base.WebApiRequestOptions = null;
1127
+ const first : any = associateId;
1128
+ if( typeof( first ) === "object" && first && ( typeof(first.associateId)!='undefined' || typeof(first.moduleOwner)!='undefined' || typeof(first.moduleLicenseNames)!='undefined' ) )
1129
+ {
1130
+ _request = associateId as carriers.License_UnassignThirdPartyLicensesRequest;
1131
+ _options = moduleOwner as base.WebApiRequestOptions;
1132
+ }
1133
+ else
1134
+ {
1135
+ _request = {
1136
+ associateId: associateId as number,
1137
+ moduleOwner: moduleOwner as string,
1138
+ moduleLicenseNames: moduleLicenseNames as string[],
1139
+ };
1140
+ _options = webapi_options;
1141
+ }
1142
+ return this._unassignThirdPartyLicensesAsync( _request, _options );
1143
+ }
1144
+
1145
+
1146
+ private async _getCentralLicenseAsync( options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
1147
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1148
+ base.WebApiBase.SetPending(options);
1149
+ return new Promise< carriers.LicenseOwner[] >(async (resolve, reject) => {
1150
+ try {
1151
+ config.baseURL = this._options.baseUrl;
1152
+ const response = await this._axios.post("GetCentralLicense", undefined , config);
1153
+ base.WebApiBase.SetCompleted(options, response);
1154
+ const res : carriers.LicenseOwner[] = converters.Create_LicenseOwnerArray_From( response.data );
1155
+ resolve(res);
1156
+ }
1157
+ catch( err ) {
1158
+ base.WebApiBase.HandleError(options, config, err);
1159
+ reject(err);
1160
+ }
1161
+ });
1162
+ }
1163
+
1164
+
1165
+ /**
1166
+ *
1167
+ * @returns
1168
+ */
1169
+ public async getCentralLicenseAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >
1170
+ {
1171
+ return this._getCentralLicenseAsync(webapi_options);
1172
+ }
1173
+
1174
+
1175
+ private async _saveCentralLicenseAsync(request: carriers.License_SaveCentralLicenseRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
1176
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1177
+ base.WebApiBase.SetPending(options);
1178
+ return new Promise< carriers.LicenseOwner[] >(async (resolve, reject) => {
1179
+ try {
1180
+ config.baseURL = this._options.baseUrl;
1181
+ const response = await this._axios.post("SaveCentralLicense", request , config);
1182
+ base.WebApiBase.SetCompleted(options, response);
1183
+ const res : carriers.LicenseOwner[] = converters.Create_LicenseOwnerArray_From( response.data );
1184
+ resolve(res);
1185
+ }
1186
+ catch( err ) {
1187
+ base.WebApiBase.HandleError(options, config, err);
1188
+ reject(err);
1189
+ }
1190
+ });
1191
+ }
1192
+
1193
+
1194
+
1195
+ /**
1196
+ *
1197
+ * @param request - License
1198
+ * @returns
1199
+ */
1200
+ public async saveCentralLicenseAsync(request: carriers.License_SaveCentralLicenseRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
1201
+
1202
+ /**
1203
+ *
1204
+ * @param license -
1205
+ * @returns
1206
+ */
1207
+ public async saveCentralLicenseAsync(license: carriers.LicenseOwner[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] >;
1208
+
1209
+ public async saveCentralLicenseAsync(license:carriers.LicenseOwner[]|carriers.License_SaveCentralLicenseRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LicenseOwner[] > {
1210
+ let _request : carriers.License_SaveCentralLicenseRequest = null;
1211
+ let _options : base.WebApiRequestOptions = null;
1212
+ const first : any = license;
1213
+ if( typeof( first ) === "object" && first && ( typeof(first.license)!='undefined' ) )
1214
+ {
1215
+ _request = license as carriers.License_SaveCentralLicenseRequest;
1216
+ _options = webapi_options as base.WebApiRequestOptions;
1217
+ }
1218
+ else
1219
+ {
1220
+ _request = {
1221
+ license: license as carriers.LicenseOwner[],
1222
+ };
1223
+ _options = webapi_options;
1224
+ }
1225
+ return this._saveCentralLicenseAsync( _request, _options );
1226
+ }
1227
+
1228
+ } // class v1LicenseAgentController
1229
+
1230
+