@licensespring/node-sdk 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1452 -1
- package/dist/src/floating.d.ts +8 -33
- package/dist/src/floating.js +16 -8
- package/dist/src/floating.js.map +1 -1
- package/dist/src/license.d.ts +2 -544
- package/dist/src/license.js +1 -1
- package/dist/src/license.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1 +1,1452 @@
|
|
|
1
|
-
#
|
|
1
|
+
# LicenseSpring node.js SDK
|
|
2
|
+
|
|
3
|
+
This package is a node.js implementation of Licensespring SDK. For more information and tutorials, see: [https://docs.licensespring.com/sdk](https://docs.licensespring.com/sdk)
|
|
4
|
+
|
|
5
|
+
### Install
|
|
6
|
+
|
|
7
|
+
To install the SDK in your nodejs or typescript project run:
|
|
8
|
+
```
|
|
9
|
+
npm i --save @licensespring/node-sdk
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## LicenseAPI
|
|
13
|
+
|
|
14
|
+
Provides a direct interface to the [LicenseSpring API](https://docs.licensespring.com/license-api/). The `LicenseAPI` class encapsulates API calls, input checks, authentication and signature verification. Typescript definitions are provided for the arguments and return types of the class methods.
|
|
15
|
+
|
|
16
|
+
To import the LicenseAPI class use:
|
|
17
|
+
```javascript
|
|
18
|
+
const { LicenseAPI } = require('@licensespring/node-sdk');
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Creating an instance
|
|
22
|
+
|
|
23
|
+
```javascript
|
|
24
|
+
const licenseAPI = new LicenseAPI({
|
|
25
|
+
apiKey: '12345678-4bfe-4e3a-8737-757004d6294c',
|
|
26
|
+
sharedKey: 'eYuHrlajvIVTiSFIXpxpKhw78f4Ewy-00-12345678',
|
|
27
|
+
appName: 'js-sdk-test-1',
|
|
28
|
+
appVersion: '0.0.1',
|
|
29
|
+
/** NOTE: the following properties are set to their default values by the SDK and can be overriden manually: */
|
|
30
|
+
// apiPath: 'http://api.dev.licensespring.com/api/v4',
|
|
31
|
+
// publicKey: '...',
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The constructor takes the a single argument of the following type:
|
|
36
|
+
```typescript
|
|
37
|
+
{
|
|
38
|
+
/** your Licensespring API key */
|
|
39
|
+
apiKey: string,
|
|
40
|
+
/** your Licensespring API Shared key **/
|
|
41
|
+
sharedKey: string,
|
|
42
|
+
/** custom name for your application */
|
|
43
|
+
appName: string,
|
|
44
|
+
/** custom version string for your application */
|
|
45
|
+
appVersion: string,
|
|
46
|
+
/** your Air Gap Activation key (optional) */
|
|
47
|
+
airGapKey?: string,
|
|
48
|
+
/** override for License API url (default is https://api.licensespring.com/api/v4/) **/
|
|
49
|
+
apiPath?: string,
|
|
50
|
+
/** override for License API public key (default is pub key for api.licensespring.com) **/
|
|
51
|
+
publicKey?: string,
|
|
52
|
+
/** override for License File filename (default is "License") */
|
|
53
|
+
filename?: string,
|
|
54
|
+
/** override for License File path (default is current directory) */
|
|
55
|
+
filePath?: string,
|
|
56
|
+
/** override for License File encryption key */
|
|
57
|
+
fileKey?: string,
|
|
58
|
+
/** override for license grace period duration in hours (default is 24) */
|
|
59
|
+
gracePeriod?: number,
|
|
60
|
+
/** override for License File guard file (default is false) */
|
|
61
|
+
isGuardFileEnabled?: boolean,
|
|
62
|
+
/** override for Hardware ID calculation method (default is 0, for more info see "Hardware ID" section) */
|
|
63
|
+
hardwareIDMethod?: number,
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### API methods
|
|
68
|
+
|
|
69
|
+
For more information on API functionality, see our [LicenseSpring API docs](https://docs.licensespring.com/license-api/).
|
|
70
|
+
|
|
71
|
+
For type definitions see [Types](#types).
|
|
72
|
+
|
|
73
|
+
#### getHardwareID
|
|
74
|
+
|
|
75
|
+
Generates a [Hardware ID](#hardware-id). This value is required for various API method calls.
|
|
76
|
+
|
|
77
|
+
If the optional argument is not provided, it defaults to the value set in the configuration object provided when instantiating the LicensespringAPI object. If no value was provided in the config object, it defaults to 0 (the default Hardware ID method).
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
getHardwareID(algorithm?: HardwareIdAlgorithm): string
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### Check License
|
|
84
|
+
[https://docs.licensespring.com/license-api/check](https://docs.licensespring.com/license-api/check)
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
checkLicense(payload: LicenseIdentificator, includeExpiredFeatures: boolean = false): Promise<LicenseResponse>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### Activate License Online
|
|
91
|
+
|
|
92
|
+
[https://docs.licensespring.com/license-api/activation-deactivation/activation](https://docs.licensespring.com/license-api/activation-deactivation/activation)
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
activateLicense(payload: LicenseActivationIdentificatorWithVariables): Promise<LicenseResponse>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### Deactivate License Online
|
|
99
|
+
|
|
100
|
+
[https://docs.licensespring.com/license-api/activation-deactivation/deactivation](https://docs.licensespring.com/license-api/activation-deactivation/deactivation)
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
deactivateLicense(payload: LicenseIdentificator): Promise<boolean>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
#### Activate License Offline
|
|
107
|
+
|
|
108
|
+
[https://docs.licensespring.com/license-api/activation-deactivation/offline-activation](https://docs.licensespring.com/license-api/activation-deactivation/offline-activation)
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
activateOffline(payload: LicenseActivationIdentificatorOfflineWithVariables): Promise<LicenseResponseOffline>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
#### Deactivate License Offline
|
|
115
|
+
|
|
116
|
+
[https://docs.licensespring.com/license-api/activation-deactivation/offline-deactivation](https://docs.licensespring.com/license-api/activation-deactivation/offline-deactivation)
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
deactivateOffline(payload: LicenseIdentificator): Promise<boolean>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### Get Trial License Key
|
|
123
|
+
|
|
124
|
+
[https://docs.licensespring.com/license-api/trial-key](https://docs.licensespring.com/license-api/trial-key)
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
getTrialKey(payload: TrialKeyPayload): Promise<LicenseTrialResponse>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### List Licenses for a User
|
|
131
|
+
|
|
132
|
+
[https://docs.licensespring.com/license-api/user-licenses](https://docs.licensespring.com/license-api/user-licenses)
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
getUserLicenses(payload: GetUserLicensesPayload): Promise<LicenseResponse[]>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
#### List License Users for a Customer
|
|
139
|
+
|
|
140
|
+
[https://docs.licensespring.com/license-api/customer-license-users](https://docs.licensespring.com/license-api/customer-license-users)
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
getCustomerLicenseUsers(payload: GetCustomerLicensesPayload): Promise<CustomerLicenseUsersResponse>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
#### Check License Feature
|
|
147
|
+
|
|
148
|
+
[https://docs.licensespring.com/license-api/license-feature-check](https://docs.licensespring.com/license-api/license-feature-check)
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
checkLicenseFeature(payload: LicenseIdentificatorAndFeature): Promise<LicenseFeatureResponse>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
#### Add License Consumption
|
|
155
|
+
|
|
156
|
+
[https://docs.licensespring.com/license-api/consumption/add](https://docs.licensespring.com/license-api/consumption/add)
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
addConsumption(payload: LicenseIdentificatorAddConsumptions): Promise<LicenseConsumptionsResponse>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
#### Add License Feature Consumption
|
|
163
|
+
|
|
164
|
+
[https://docs.licensespring.com/license-api/consumption/add-feature](https://docs.licensespring.com/license-api/consumption/add-feature)
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
addFeatureConsumption(payload: LicenseIdentificatorAddFeatureConsumptions): Promise<LicenseFeatureConsumptionResponse>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
#### Product Details
|
|
171
|
+
|
|
172
|
+
[https://docs.licensespring.com/license-api/product-details](https://docs.licensespring.com/license-api/product-details)
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
getProductDetails(payload: ProductDetailsPayload): Promise<ProductDetailsResponse>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
#### Get Device Variables
|
|
179
|
+
|
|
180
|
+
[https://docs.licensespring.com/license-api/device-variables/get](https://docs.licensespring.com/license-api/device-variables/get)
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
getDeviceVariables(payload: LicenseIdentificator): Promise<DeviceVariable[]>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
#### Track Device Variables
|
|
187
|
+
|
|
188
|
+
[https://docs.licensespring.com/license-api/device-variables/track](https://docs.licensespring.com/license-api/device-variables/track)
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
trackDeviceVariables(payload: LicenseIdentificatorWithVariables): Promise<DeviceVariable[]>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
#### Borrow Floating License
|
|
195
|
+
|
|
196
|
+
[https://docs.licensespring.com/license-api/floating/license/borrow](https://docs.licensespring.com/license-api/floating/license/borrow)
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
floatingBorrow(payload: LicenseIdentificatorWithBorrowedUntil): Promise<LicenseBorrowResponse>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
#### Release Floating License
|
|
203
|
+
|
|
204
|
+
[https://docs.licensespring.com/license-api/floating/license/release](https://docs.licensespring.com/license-api/floating/license/release)
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
floatingRelease(payload: LicenseIdentificator): Promise<boolean>
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
#### Release Floating Feature
|
|
211
|
+
|
|
212
|
+
[https://docs.licensespring.com/license-api/floating/feature/release](https://docs.licensespring.com/license-api/floating/feature/release)
|
|
213
|
+
|
|
214
|
+
```typescript
|
|
215
|
+
featureRelease(payload: LicenseIdentificatorAndFeature): Promise<boolean>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
#### Change User Password
|
|
219
|
+
|
|
220
|
+
[https://docs.licensespring.com/license-api/change-password](https://docs.licensespring.com/license-api/change-password)
|
|
221
|
+
|
|
222
|
+
```typescript
|
|
223
|
+
changePassword(payload: PasswordChangePayload): Promise<boolean>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
#### List Product Versions for License
|
|
227
|
+
|
|
228
|
+
[https://docs.licensespring.com/license-api/versions](https://docs.licensespring.com/license-api/versions)
|
|
229
|
+
|
|
230
|
+
```typescript
|
|
231
|
+
getVersions(payload: LicenseIdentificator): Promise<VersionsResponse>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
#### Product Installation File Info for License
|
|
235
|
+
|
|
236
|
+
[https://docs.licensespring.com/license-api/installation-file](https://docs.licensespring.com/license-api/installation-file)
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
getInstallationFile(payload: LicenseIdentificatorWithInstallation): Promise<InstallationFileResponse>
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
#### Get Single Sign On URL
|
|
243
|
+
|
|
244
|
+
[https://docs.licensespring.com/license-api/sso-url](https://docs.licensespring.com/license-api/sso-url)
|
|
245
|
+
|
|
246
|
+
```typescript
|
|
247
|
+
getSSOUrl(payload: SSOURLParams): Promise<{ url: string }>
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
#### Get Air Gap Activation Code
|
|
251
|
+
|
|
252
|
+
[https://docs.licensespring.com/license-entitlements/activation-types/air-gapped](https://docs.licensespring.com/license-entitlements/activation-types/air-gapped)
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
getAirGapActivationCode(initializationCode: string, licenseKey: string): string
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
#### Verify Air-Gap Confirmation Code
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
verifyConfirmationCode(confirmationCode: string, licenseKey: string, policyId?: string): boolean
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
#### Activate Air-Gapped License
|
|
265
|
+
|
|
266
|
+
[https://docs.licensespring.com/license-entitlements/activation-types/air-gapped](https://docs.licensespring.com/license-entitlements/activation-types/air-gapped)
|
|
267
|
+
|
|
268
|
+
```typescript
|
|
269
|
+
activateAirgappedLicense(activationPayload: OfflineActivation, licenseKey: string, policyId: string): LicenseResponse
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## LicenseManager
|
|
273
|
+
|
|
274
|
+
Provides a high-level interface for managing licenses, including local licenses. The LicenseManager is required to work with local license files. Typescript definitions are provided for the arguments and return types of the class methods.
|
|
275
|
+
|
|
276
|
+
To import the LicenseManager class use:
|
|
277
|
+
```javascript
|
|
278
|
+
const { LicenseManager } = require('@licensespring/node-sdk');
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
To create an instance:
|
|
282
|
+
|
|
283
|
+
```javascript
|
|
284
|
+
const licenseManager = new LicenseManager({
|
|
285
|
+
apiKey: '12345678-4bfe-4e3a-8737-757004d6294c',
|
|
286
|
+
sharedKey: 'eYuHrlajvIVTiSFIXpxpKhw78f4Ewy-00-12345678',
|
|
287
|
+
appName: 'js-sdk-test-1',
|
|
288
|
+
appVersion: '0.0.1',
|
|
289
|
+
productCode: 'lkp',
|
|
290
|
+
/** NOTE: the following properties are set to their default values by the SDK and can be overriden manually: */
|
|
291
|
+
// apiPath: 'http://api.dev.licensespring.com/api/v4',
|
|
292
|
+
// publicKey: '...',
|
|
293
|
+
});
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
The constructor takes the a single argument of the following type:
|
|
297
|
+
```typescript
|
|
298
|
+
{
|
|
299
|
+
/** your Licensespring API key */
|
|
300
|
+
apiKey: string,
|
|
301
|
+
/** your Licensespring API Shared key **/
|
|
302
|
+
sharedKey: string,
|
|
303
|
+
/** custom name for your application */
|
|
304
|
+
appName: string,
|
|
305
|
+
/** custom version string for your application */
|
|
306
|
+
appVersion: string,
|
|
307
|
+
/** your product short code */
|
|
308
|
+
productCode: string,
|
|
309
|
+
/** your Air Gap Activation key (optional) */
|
|
310
|
+
airGapKey?: string,
|
|
311
|
+
/** override for License API url (default is https://api.licensespring.com/api/v4/) **/
|
|
312
|
+
apiPath?: string,
|
|
313
|
+
/** override for License API public key (default is pub key for api.licensespring.com) **/
|
|
314
|
+
publicKey?: string,
|
|
315
|
+
/** override for License File filename (default is "License") */
|
|
316
|
+
filename?: string,
|
|
317
|
+
/** override for License File path (default is current directory) */
|
|
318
|
+
filePath?: string,
|
|
319
|
+
/** override for License File encryption key */
|
|
320
|
+
fileKey?: string,
|
|
321
|
+
/** override for license grace period duration in hours (default is 24) */
|
|
322
|
+
gracePeriod?: number,
|
|
323
|
+
/** override for License File guard file (default is false) */
|
|
324
|
+
isGuardFileEnabled?: boolean,
|
|
325
|
+
/** override for Hardware ID calculation method (default is 0, for more info see "Hardware ID" section) */
|
|
326
|
+
hardwareIDMethod?: number,
|
|
327
|
+
}
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Methods
|
|
331
|
+
|
|
332
|
+
Methods that take a `Managed` License identificator are the same as in License API, except that `product` and `hardware_id` do not have to be specified in the payload as they are provided by the License Manager object.
|
|
333
|
+
|
|
334
|
+
#### Check License
|
|
335
|
+
[https://docs.licensespring.com/license-api/check](https://docs.licensespring.com/license-api/check)
|
|
336
|
+
|
|
337
|
+
```javascript
|
|
338
|
+
checkLicense(payload: Managed<LicenseIdentificator>): Promise<LicenseResponse>
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
#### Activate License Online
|
|
342
|
+
|
|
343
|
+
[https://docs.licensespring.com/license-api/activation-deactivation/activation](https://docs.licensespring.com/license-api/activation-deactivation/activation)
|
|
344
|
+
|
|
345
|
+
```javascript
|
|
346
|
+
activateLicense(payload: Managed<LicenseIdentificatorWithVariables>): Promise<LicenseResponse>
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
#### Deactivate License Online
|
|
350
|
+
|
|
351
|
+
[https://docs.licensespring.com/license-api/activation-deactivation/deactivation](https://docs.licensespring.com/license-api/activation-deactivation/deactivation)
|
|
352
|
+
|
|
353
|
+
```javascript
|
|
354
|
+
deactivateLicense(payload: Managed<LicenseIdentificator>): Promise<boolean>
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
#### Activate License Offline
|
|
358
|
+
|
|
359
|
+
[https://docs.licensespring.com/license-api/activation-deactivation/offline-activation](https://docs.licensespring.com/license-api/activation-deactivation/offline-activation)
|
|
360
|
+
|
|
361
|
+
```javascript
|
|
362
|
+
activateOffline(payload: Managed<LicenseIdentificatorOfflineWithVariables>): Promise<LicenseResponseOffline>
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
#### Deactivate License Offline
|
|
366
|
+
|
|
367
|
+
[https://docs.licensespring.com/license-api/activation-deactivation/offline-deactivation](https://docs.licensespring.com/license-api/activation-deactivation/offline-deactivation)
|
|
368
|
+
|
|
369
|
+
```javascript
|
|
370
|
+
deactivateOffline(payload: Managed<LicenseIdentificator>): Promise<boolean>
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
#### Get Trial License Key
|
|
374
|
+
|
|
375
|
+
[https://docs.licensespring.com/license-api/trial-key](https://docs.licensespring.com/license-api/trial-key)
|
|
376
|
+
|
|
377
|
+
```javascript
|
|
378
|
+
getTrialKey(payload: Managed<TrialKeyPayload>): Promise<LicenseTrialResponse>
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
#### List Licenses for a User
|
|
382
|
+
|
|
383
|
+
[https://docs.licensespring.com/license-api/user-licenses](https://docs.licensespring.com/license-api/user-licenses)
|
|
384
|
+
|
|
385
|
+
```javascript
|
|
386
|
+
getUserLicenses(payload: Managed<GetUserLicensesPayload>): Promise<LicenseResponse[]>
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
#### List License Users for a Customer
|
|
390
|
+
|
|
391
|
+
[https://docs.licensespring.com/license-api/customer-license-users](https://docs.licensespring.com/license-api/customer-license-users)
|
|
392
|
+
|
|
393
|
+
```javascript
|
|
394
|
+
getCustomerLicenseUsers(payload: Managed<GetCustomerLicensesPayload>): Promise<CustomerLicenseUsersResponse>
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
#### Check License Feature
|
|
398
|
+
|
|
399
|
+
[https://docs.licensespring.com/license-api/license-feature-check](https://docs.licensespring.com/license-api/license-feature-check)
|
|
400
|
+
|
|
401
|
+
```javascript
|
|
402
|
+
checkLicenseFeature(payload: Managed<LicenseIdentificatorAndFeature>): Promise<LicenseFeatureResponse>
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
#### Add License Consumption
|
|
406
|
+
|
|
407
|
+
[https://docs.licensespring.com/license-api/consumption/add](https://docs.licensespring.com/license-api/consumption/add)
|
|
408
|
+
|
|
409
|
+
```javascript
|
|
410
|
+
addConsumption(payload: Managed<LicenseIdentificatorAddConsumptions>): Promise<LicenseConsumptionsResponse>
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
#### Add License Feature Consumption
|
|
414
|
+
|
|
415
|
+
[https://docs.licensespring.com/license-api/consumption/add-feature](https://docs.licensespring.com/license-api/consumption/add-feature)
|
|
416
|
+
|
|
417
|
+
```javascript
|
|
418
|
+
addFeatureConsumption(payload: Managed<LicenseIdentificatorAddFeatureConsumptions>): Promise<LicenseFeatureConsumptionResponse>
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
#### Product Details
|
|
422
|
+
|
|
423
|
+
[https://docs.licensespring.com/license-api/product-details](https://docs.licensespring.com/license-api/product-details)
|
|
424
|
+
|
|
425
|
+
```javascript
|
|
426
|
+
getProductDetails(payload: Managed<ProductDetailsPayload>): Promise<ProductDetailsResponse>
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
#### Get Device Variables
|
|
430
|
+
|
|
431
|
+
[https://docs.licensespring.com/license-api/device-variables/get](https://docs.licensespring.com/license-api/device-variables/get)
|
|
432
|
+
|
|
433
|
+
```javascript
|
|
434
|
+
getDeviceVariables(payload: Managed<LicenseIdentificator>): Promise<DeviceVariable[]>
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
#### Track Device Variables
|
|
438
|
+
|
|
439
|
+
[https://docs.licensespring.com/license-api/device-variables/track](https://docs.licensespring.com/license-api/device-variables/track)
|
|
440
|
+
|
|
441
|
+
```javascript
|
|
442
|
+
trackDeviceVariables(payload: Managed<LicenseIdentificatorWithVariables>): Promise<DeviceVariable[]>
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
#### Borrow Floating License
|
|
446
|
+
|
|
447
|
+
[https://docs.licensespring.com/license-api/floating/license/borrow](https://docs.licensespring.com/license-api/floating/license/borrow)
|
|
448
|
+
|
|
449
|
+
```javascript
|
|
450
|
+
floatingBorrow(payload: Managed<LicenseIdentificatorWithBorrowedUntil>): Promise<LicenseBorrowResponse>
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
#### Release Floating License
|
|
454
|
+
|
|
455
|
+
[https://docs.licensespring.com/license-api/floating/license/release](https://docs.licensespring.com/license-api/floating/license/release)
|
|
456
|
+
|
|
457
|
+
```javascript
|
|
458
|
+
floatingRelease(payload: Managed<LicenseIdentificator>): Promise<boolean>
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
#### Release Floating Feature
|
|
462
|
+
|
|
463
|
+
[https://docs.licensespring.com/license-api/floating/feature/release](https://docs.licensespring.com/license-api/floating/feature/release)
|
|
464
|
+
|
|
465
|
+
```javascript
|
|
466
|
+
featureRelease(payload: Managed<LicenseIdentificatorAndFeature>): Promise<boolean>
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
#### Change User Password
|
|
470
|
+
|
|
471
|
+
[https://docs.licensespring.com/license-api/change-password](https://docs.licensespring.com/license-api/change-password)
|
|
472
|
+
|
|
473
|
+
```javascript
|
|
474
|
+
changePassword(payload: PasswordChangePayload): Promise<boolean>
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
#### List Product Versions for License
|
|
478
|
+
|
|
479
|
+
[https://docs.licensespring.com/license-api/versions](https://docs.licensespring.com/license-api/versions)
|
|
480
|
+
|
|
481
|
+
```javascript
|
|
482
|
+
getVersions(payload: Managed<LicenseIdentificator>): Promise<VersionsResponse>
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
#### Product Installation File Info for License
|
|
486
|
+
|
|
487
|
+
[https://docs.licensespring.com/license-api/installation-file](https://docs.licensespring.com/license-api/installation-file)
|
|
488
|
+
|
|
489
|
+
```javascript
|
|
490
|
+
getInstallationFile(payload: Managed<LicenseIdentificatorWithInstallation>): Promise<InstallationFileResponse>
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
#### Get Single Sign On URL
|
|
494
|
+
|
|
495
|
+
[https://docs.licensespring.com/license-api/sso-url](https://docs.licensespring.com/license-api/sso-url)
|
|
496
|
+
|
|
497
|
+
```javascript
|
|
498
|
+
getSSOUrl(payload: SSOURLParams): Promise<{ url: string }>
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
#### Get Air Gap Activation Code
|
|
502
|
+
|
|
503
|
+
[https://docs.licensespring.com/license-entitlements/activation-types/air-gapped](https://docs.licensespring.com/license-entitlements/activation-types/air-gapped)
|
|
504
|
+
|
|
505
|
+
```javascript
|
|
506
|
+
getAirGapActivationCode(initializationCode: string, licenseKey: string)
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
#### Activate Air-Gapped License
|
|
510
|
+
|
|
511
|
+
Performs `verifyConfirmationCode` and activates Air-Gapped License:
|
|
512
|
+
```javascript
|
|
513
|
+
activateAirGapLicense(confirmationCode: string, licenseKey: string, policyFilePath: string, policyID: string)
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
#### Is License Valid
|
|
517
|
+
|
|
518
|
+
Checks if License is enabled, active and not expired:
|
|
519
|
+
```javascript
|
|
520
|
+
isValid(license: LicenseResponse): boolean
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
#### Maintenance Days Remaining
|
|
524
|
+
|
|
525
|
+
Returns days remaining in maintenance period:
|
|
526
|
+
```javascript
|
|
527
|
+
maintenanceDaysRemaining(license: LicenseResponse): number
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
#### Validity Days Remaining
|
|
531
|
+
|
|
532
|
+
Returns days remaining in license validity period:
|
|
533
|
+
```javascript
|
|
534
|
+
daysRemaining(license: LicenseResponse): number
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
#### Load License File
|
|
538
|
+
|
|
539
|
+
See [License File](#license-file)
|
|
540
|
+
|
|
541
|
+
```javascript
|
|
542
|
+
loadLicense(): License
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
#### Check License File For Corruption
|
|
546
|
+
|
|
547
|
+
```javascript
|
|
548
|
+
isLicenseFileCorrupted(): boolean
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
#### Clear Local Storage
|
|
552
|
+
|
|
553
|
+
```javascript
|
|
554
|
+
clearLocalStorage(): void
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
## License File
|
|
558
|
+
|
|
559
|
+
For more info see our docs: [https://docs.licensespring.com/sdks/tutorials/best-practices/local-license-file](https://docs.licensespring.com/sdks/tutorials/best-practices/local-license-file) and [https://docs.licensespring.com/sdks/python/licensefile](https://docs.licensespring.com/sdks/python/licensefile)
|
|
560
|
+
|
|
561
|
+
To load a local license file, create an instance of `LicenseManager` and call the method `loadLicense`:
|
|
562
|
+
```javascript
|
|
563
|
+
const licenseFile = licenseManager.loadLicense();
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
The License class provides an interface for working with the License File.
|
|
567
|
+
|
|
568
|
+
### Methods
|
|
569
|
+
|
|
570
|
+
#### Get Feature Data
|
|
571
|
+
```javascript
|
|
572
|
+
public featureData(featureCode: string): ProductFeature
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
#### Check License Status
|
|
576
|
+
Throws an exception if the license is disabled, inactive or expired
|
|
577
|
+
```javascript
|
|
578
|
+
checkLicenseStatus(): void
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
#### Perform Full License Check
|
|
582
|
+
Checks License status and saves to local license file
|
|
583
|
+
```javascript
|
|
584
|
+
check(includeExpiredFeatures: boolean = false): Promise<LicenseResponse>
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
#### Get Air-Gap License Deactivation Code
|
|
588
|
+
```javascript
|
|
589
|
+
getDeactivationCode(initializationCode: string): string
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
#### Deactivate Air-Gap License
|
|
593
|
+
```javascript
|
|
594
|
+
deactivateAirGap(confirmationCode: string): void
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
#### Deactivate License
|
|
598
|
+
Deactivates a License, updates local license file. Optionally deletes license file
|
|
599
|
+
```javascript
|
|
600
|
+
deactivate(deleteLicense: boolean = false): Promise<boolean>
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
#### Local License Check
|
|
604
|
+
Performs a local check using the local license file. Throws an exception if license is not valid
|
|
605
|
+
```javascript
|
|
606
|
+
localCheck(): Promise<true>
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
#### Change Password
|
|
610
|
+
Performs password change for user associated to License
|
|
611
|
+
```javascript
|
|
612
|
+
changePassword(oldPassword: string, newPassword: string): Promise<boolean>
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
#### Add Local Consumption
|
|
616
|
+
Adds a License consumption to the local license data
|
|
617
|
+
```javascript
|
|
618
|
+
addLocalConsumption(consumptions: number = 1)
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
#### Add Local Feature Consumption
|
|
622
|
+
Adds a License feature consumption to the local license data
|
|
623
|
+
```javascript
|
|
624
|
+
addLocalFeatureConsumption(featureCode: string, consumptions: number = 1)
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
#### Sync License Feature Consumption
|
|
628
|
+
Sends a feature consumption request to the server and updates local data
|
|
629
|
+
```javascript
|
|
630
|
+
syncFeatureConsumption(feature: { code: string, local_consumption: number }): Promise<boolean>
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
#### Sync License Consumption
|
|
634
|
+
Syncs local consumptions to server
|
|
635
|
+
```javascript
|
|
636
|
+
syncConsumption(overages: number = -1): Promise<boolean>
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
#### Borrow Floating License
|
|
640
|
+
```javascript
|
|
641
|
+
floatingBorrow(borrowUntil: string, password?: string): Promise<boolean>
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
#### Release Floating License
|
|
645
|
+
```javascript
|
|
646
|
+
floatingRelease(): Promise<boolean>
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
#### Check Feature Status
|
|
650
|
+
Checks License Feature status, throws exception if not active
|
|
651
|
+
```javascript
|
|
652
|
+
checkFeature(featureCode: string): Promise<void>
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
#### Release Borrowed Feature
|
|
656
|
+
```javascript
|
|
657
|
+
releaseFeature(featureCode: string): Promise<void>
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
#### Update Offline
|
|
661
|
+
```javascript
|
|
662
|
+
Update local cache from Offline License File (at given `path`). Optionally reset local consumption value.
|
|
663
|
+
public updateOffline(path: string, resetConsumption: boolean): boolean
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
#### Deactivate Offline License
|
|
667
|
+
```javascript
|
|
668
|
+
deactivateOffline(offlinePath: string): Promise<void>
|
|
669
|
+
```
|
|
670
|
+
|
|
671
|
+
#### Get Product Details
|
|
672
|
+
Retrieves Product Details from server
|
|
673
|
+
```javascript
|
|
674
|
+
productDetails(includeLatestVersion: boolean = false, includeCustomFields: boolean = false, includeExpiredFeatures: boolean = false): Promise<ProductDetailsResponse>
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
#### Get Product Details Local
|
|
678
|
+
Retrieves Product Details from local data
|
|
679
|
+
```javascript
|
|
680
|
+
get productDetailsLocal()
|
|
681
|
+
```
|
|
682
|
+
|
|
683
|
+
#### Set Device Variables Local
|
|
684
|
+
Set custom variables to local data
|
|
685
|
+
```javascript
|
|
686
|
+
setDeviceVariablesLocal(variables: { [key: string]: string|number }, save: boolean = true): void
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
#### Set Device Variables
|
|
690
|
+
Send locally stored variables to server. Optionally save to license file
|
|
691
|
+
```javascript
|
|
692
|
+
setDeviceVariables(save: boolean = false): Promise<void>
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
#### Get Device Variable Local
|
|
696
|
+
Get the value of a variable from local data
|
|
697
|
+
```javascript
|
|
698
|
+
getDeviceVariableLocal(variable: string)
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
#### Get Device Variables Local
|
|
702
|
+
Get all variables from local data
|
|
703
|
+
```javascript
|
|
704
|
+
getDeviceVariablesLocal()
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
#### Get Device Variables
|
|
708
|
+
```javascript
|
|
709
|
+
getDeviceVariables(): Promise<DeviceVariable[]>
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
### Getters
|
|
713
|
+
|
|
714
|
+
```javascript
|
|
715
|
+
get allowGraceSubscriptionPeriod()
|
|
716
|
+
get allowOverages()
|
|
717
|
+
get allowUnlimitedActivations()
|
|
718
|
+
get allowUnlimitedConsumptions()
|
|
719
|
+
get borrowUntil()
|
|
720
|
+
get consumptionPeriod()
|
|
721
|
+
get consumptionReset()
|
|
722
|
+
get customerInformation()
|
|
723
|
+
get customFields()
|
|
724
|
+
get daysRemaining()
|
|
725
|
+
get daysSinceLastCheck()
|
|
726
|
+
get expiryDate()
|
|
727
|
+
get features()
|
|
728
|
+
get floatingClientId()
|
|
729
|
+
get floatingEndDate()
|
|
730
|
+
get floatingInUseDevices()
|
|
731
|
+
get floatingTimeout()
|
|
732
|
+
get gracePeriod()
|
|
733
|
+
get gracePeriodHoursRemaining()
|
|
734
|
+
get id()
|
|
735
|
+
get isAirGapped()
|
|
736
|
+
get isBorrowed()
|
|
737
|
+
get isControlledByFloatingServer()
|
|
738
|
+
get isDeviceTransferAllowed()
|
|
739
|
+
get isDeviceTransferLimited()
|
|
740
|
+
get isExpired()
|
|
741
|
+
get isFloating()
|
|
742
|
+
get isFloatingExpired()
|
|
743
|
+
get isGracePeriod()
|
|
744
|
+
get isGracePeriodStarted()
|
|
745
|
+
get isMaintenancePeriodExpired()
|
|
746
|
+
get isSubcriptionGracePeriodStarted()
|
|
747
|
+
get isTrial()
|
|
748
|
+
get isValid()
|
|
749
|
+
get isValidityPeriodExpired()
|
|
750
|
+
get lastCheck()
|
|
751
|
+
get lastUsage()
|
|
752
|
+
get licenseActive()
|
|
753
|
+
get licenseEnabled()
|
|
754
|
+
get licenseKey()
|
|
755
|
+
get licenseType()
|
|
756
|
+
get licenseUser()
|
|
757
|
+
get localConsumptions()
|
|
758
|
+
get maintenanceDaysRemaining()
|
|
759
|
+
get maintenancePeriod()
|
|
760
|
+
get maxActivations()
|
|
761
|
+
get maxConsumptions()
|
|
762
|
+
get maxFloatingUsers()
|
|
763
|
+
get maxOverages()
|
|
764
|
+
get maxTransfers()
|
|
765
|
+
get metadata()
|
|
766
|
+
get policyID()
|
|
767
|
+
get preventVm()
|
|
768
|
+
get startDate()
|
|
769
|
+
get subscriptionGracePeriod()
|
|
770
|
+
get totalConsumptions()
|
|
771
|
+
get transferCount()
|
|
772
|
+
get validityPeriod()
|
|
773
|
+
get validityWithGracePeriod()
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
## Hardware ID
|
|
777
|
+
|
|
778
|
+
Both LicenseAPI and LicenseManager use the Hardware ID module to calculate a unique fingerprint for the local machine. The module provides multiple methods of determining the ID:
|
|
779
|
+
```typescript
|
|
780
|
+
export enum HardwareIdAlgorithm {
|
|
781
|
+
Default = 0,
|
|
782
|
+
WindowsHardwareFingerprintId = 1,
|
|
783
|
+
WindowsComputerSystemProductId = 2,
|
|
784
|
+
WindowsCryptographyId = 3,
|
|
785
|
+
LinuxMachineId = 4,
|
|
786
|
+
CloudPlatformsId = 5,
|
|
787
|
+
};
|
|
788
|
+
```
|
|
789
|
+
The default method (0) covers all cases and fallbacks. If you override the default method, the method used should be consistent accross your project. For both LicenseAPI and LicenseManager, this can be overriden globally by setting the required value in the config object when initializing the LicenseAPI/LicenseManager, e.g.:
|
|
790
|
+
|
|
791
|
+
```javascript
|
|
792
|
+
const licenseAPI = new LicenseAPI({
|
|
793
|
+
apiKey: '12345678-4bfe-4e3a-8737-757004d6294c',
|
|
794
|
+
sharedKey: 'eYuHrlajvIVTiSFIXpxpKhw78f4Ewy-00-12345678',
|
|
795
|
+
appName: 'js-sdk-test-1',
|
|
796
|
+
appVersion: '0.0.1',
|
|
797
|
+
hardwareIDMethod: 5,
|
|
798
|
+
});
|
|
799
|
+
```
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
## Types
|
|
803
|
+
|
|
804
|
+
The following are typescript definitions for all the types used in the SDK:
|
|
805
|
+
|
|
806
|
+
```typescript
|
|
807
|
+
export type LicensespringConfig = {
|
|
808
|
+
apiKey: string,
|
|
809
|
+
sharedKey: string,
|
|
810
|
+
apiPath: string,
|
|
811
|
+
publicKey: string,
|
|
812
|
+
productCode: string,
|
|
813
|
+
appName: string,
|
|
814
|
+
appVersion: string,
|
|
815
|
+
filePath: string,
|
|
816
|
+
filename: string,
|
|
817
|
+
gracePeriod: number,
|
|
818
|
+
fileKey: string,
|
|
819
|
+
airGapKey?: string,
|
|
820
|
+
isGuardFileEnabled: boolean,
|
|
821
|
+
hardwareIDMethod: number,
|
|
822
|
+
sdkVersion: string,
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
export type LicensespringAPIConfig = Omit<LicensespringConfig, 'productCode'>;
|
|
826
|
+
|
|
827
|
+
export type LicensespringConfigDef = Omit<LicensespringConfig, 'apiPath'|'publicKey'|'filename'|'filePath'|'gracePeriod'|'fileKey'|'isGuardFileEnabled'|'hardwareIDMethod'|'sdkVersion'> & {
|
|
828
|
+
apiPath?: string,
|
|
829
|
+
publicKey?: string,
|
|
830
|
+
filename?: string,
|
|
831
|
+
filePath?: string,
|
|
832
|
+
gracePeriod?: number,
|
|
833
|
+
fileKey?: string,
|
|
834
|
+
isGuardFileEnabled?: boolean,
|
|
835
|
+
hardwareIDMethod?: number,
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
export type LicensespringAPIConfigDef = Omit<LicensespringAPIConfig, 'apiPath'|'publicKey'|'filename'|'filePath'|'gracePeriod'|'fileKey'|'isGuardFileEnabled'|'hardwareIDMethod'|'sdkVersion'> & {
|
|
839
|
+
apiPath?: string,
|
|
840
|
+
publicKey?: string,
|
|
841
|
+
filename?: string,
|
|
842
|
+
filePath?: string,
|
|
843
|
+
gracePeriod?: number,
|
|
844
|
+
fileKey?: string,
|
|
845
|
+
isGuardFileEnabled?: boolean,
|
|
846
|
+
hardwareIDMethod?: number,
|
|
847
|
+
};
|
|
848
|
+
|
|
849
|
+
export type LicensespringFloatingConfig = {
|
|
850
|
+
apiPath: string,
|
|
851
|
+
appVersion: string,
|
|
852
|
+
hardwareIDMethod: number,
|
|
853
|
+
sdkVersion: string,
|
|
854
|
+
};
|
|
855
|
+
|
|
856
|
+
export type LicensespringFloatingConfigDef = Omit<LicensespringFloatingConfig, 'hardwareIDMethod'|'sdkVersion'> & {
|
|
857
|
+
hardwareIDMethod?: number,
|
|
858
|
+
};
|
|
859
|
+
|
|
860
|
+
type LicenseIdentificatorKeyBased = {
|
|
861
|
+
license_key: string,
|
|
862
|
+
};
|
|
863
|
+
|
|
864
|
+
type LicenseIdentificatorUserBased = {
|
|
865
|
+
username: string,
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
type LicenseActivationIdentificatorUserBased = {
|
|
869
|
+
username: string,
|
|
870
|
+
password: string,
|
|
871
|
+
};
|
|
872
|
+
|
|
873
|
+
type LicenseIdentificatorUserSSOBased = ({
|
|
874
|
+
id_token: string,
|
|
875
|
+
} | {
|
|
876
|
+
code: string,
|
|
877
|
+
}) & {
|
|
878
|
+
customer_account_code: string,
|
|
879
|
+
};
|
|
880
|
+
|
|
881
|
+
export type SSOURLParams = {
|
|
882
|
+
product: string,
|
|
883
|
+
type: 'token'|'code',
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
type LicenseIdentificatiorRequired = {
|
|
887
|
+
hardware_id: string,
|
|
888
|
+
product: string,
|
|
889
|
+
bundle_code?: string,
|
|
890
|
+
license_id?: number,
|
|
891
|
+
};
|
|
892
|
+
|
|
893
|
+
export type LicenseActivationIdentificatorWithVariables = LicenseActivationIdentificator & { variables?: Dictionary<string> };
|
|
894
|
+
export type LicenseActivationIdentificatorOfflineWithVariables = LicenseActivationIdentificator & OfflineActivationRequest & { variables?: Dictionary<string> };
|
|
895
|
+
|
|
896
|
+
export type LicenseIdentificatorWithVariables = LicenseIdentificator & { variables?: Dictionary<string> };
|
|
897
|
+
|
|
898
|
+
export type LicenseIdentificatorOfflineWithVariables = LicenseIdentificator & OfflineActivationRequest & { variables?: Dictionary<string> };
|
|
899
|
+
|
|
900
|
+
export type TrialKeyPayload = { email: string, product: string, hardware_id: string };
|
|
901
|
+
|
|
902
|
+
export type GetUserLicensesPayload = { username: string, password: string, product: string };
|
|
903
|
+
|
|
904
|
+
export type GetCustomerLicensesPayload = { customer: string, product: string };
|
|
905
|
+
|
|
906
|
+
export type LicenseIdentificatorAndFeature = LicenseIdentificator & { feature: string };
|
|
907
|
+
|
|
908
|
+
export type LicenseIdentificatorAddConsumptions = LicenseIdentificator & { consumptions: number };
|
|
909
|
+
|
|
910
|
+
export type LicenseIdentificatorAddFeatureConsumptions = LicenseIdentificator & { feature: string, consumptions: number };
|
|
911
|
+
|
|
912
|
+
export type ProductDetailsPayload = {
|
|
913
|
+
product: string,
|
|
914
|
+
/** @defaultValue false */
|
|
915
|
+
include_expired_features?: boolean,
|
|
916
|
+
/** @defaultValue false */
|
|
917
|
+
include_latest_version?: boolean,
|
|
918
|
+
/** @defaultValue false */
|
|
919
|
+
include_custom_fields?: boolean,
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
export type LicenseIdentificatorWithBorrowedUntil = LicenseIdentificator & { borrowed_until: DateInputString };
|
|
923
|
+
|
|
924
|
+
export type PasswordChangePayload = { username: string, password: string, new_password: string };
|
|
925
|
+
|
|
926
|
+
export type LicenseIdentificatorWithInstallation = LicenseIdentificator & { env: string, channel: string, version: string };
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* @type {LicenseIdentificator}
|
|
930
|
+
*
|
|
931
|
+
* An object that identifies a License using either a license-key, user credentials or single sign-on credentials.
|
|
932
|
+
* Optionally can include a `license_id` property to force a specific license is being selected.
|
|
933
|
+
*/
|
|
934
|
+
export type LicenseIdentificator = (
|
|
935
|
+
XOR<LicenseIdentificatorKeyBased, LicenseIdentificatorUserBased>
|
|
936
|
+
) & LicenseIdentificatiorRequired;
|
|
937
|
+
|
|
938
|
+
export type LicenseActivationIdentificator = (
|
|
939
|
+
XOR<LicenseIdentificatorKeyBased, LicenseActivationIdentificatorUserBased, LicenseIdentificatorUserSSOBased>
|
|
940
|
+
) & LicenseIdentificatiorRequired;
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* @type {LicenseUser}
|
|
944
|
+
*
|
|
945
|
+
* An object describing a User associated to a specific license
|
|
946
|
+
*/
|
|
947
|
+
export type LicenseUser = {
|
|
948
|
+
id: number,
|
|
949
|
+
email: string,
|
|
950
|
+
first_name: string,
|
|
951
|
+
last_name: string,
|
|
952
|
+
phone_number: string,
|
|
953
|
+
is_initial_password: boolean,
|
|
954
|
+
allow_unlimited_activations: boolean,
|
|
955
|
+
max_activations: number,
|
|
956
|
+
total_activations: number,
|
|
957
|
+
};
|
|
958
|
+
|
|
959
|
+
/**
|
|
960
|
+
* @type {ProductDetails}
|
|
961
|
+
*
|
|
962
|
+
* An object describing the basic properties of a Product
|
|
963
|
+
*/
|
|
964
|
+
export type ProductDetails = {
|
|
965
|
+
product_id: number,
|
|
966
|
+
product_name: string,
|
|
967
|
+
short_code: string,
|
|
968
|
+
authorization_method: 'license-key' | 'user',
|
|
969
|
+
metadata: JSON,
|
|
970
|
+
};
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* @type {Customer}
|
|
974
|
+
*
|
|
975
|
+
* An object describing a Customer
|
|
976
|
+
*/
|
|
977
|
+
export type Customer = {
|
|
978
|
+
email: string,
|
|
979
|
+
company_name: string,
|
|
980
|
+
reference: string,
|
|
981
|
+
phone: string,
|
|
982
|
+
first_name: string,
|
|
983
|
+
last_name: string,
|
|
984
|
+
city: string,
|
|
985
|
+
postcode: string,
|
|
986
|
+
state: string,
|
|
987
|
+
country: string,
|
|
988
|
+
address: string,
|
|
989
|
+
customer_account: string|null,
|
|
990
|
+
metadata: JSON,
|
|
991
|
+
};
|
|
992
|
+
|
|
993
|
+
/**
|
|
994
|
+
* @type {CustomField}
|
|
995
|
+
*
|
|
996
|
+
* An object describing a Custom Field. These are key-value pairs assigned to a Product and inherited by that product's Licenses. They can be overriden on the License level
|
|
997
|
+
*/
|
|
998
|
+
export type CustomField = {
|
|
999
|
+
name: string,
|
|
1000
|
+
data_type: 'numer' | 'text' | 'date/time',
|
|
1001
|
+
value: string,
|
|
1002
|
+
};
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* @type {ProductFeature}
|
|
1006
|
+
*
|
|
1007
|
+
* An object describing a Product Feature. These are custom attributes assigned to a Product and inherited by that product's Licenses
|
|
1008
|
+
*/
|
|
1009
|
+
export type ProductFeature = {
|
|
1010
|
+
id: number,
|
|
1011
|
+
code: string,
|
|
1012
|
+
name: string,
|
|
1013
|
+
expiry_date: string,
|
|
1014
|
+
metadata: JSON,
|
|
1015
|
+
is_floating_cloud: boolean,
|
|
1016
|
+
} & XOR<{
|
|
1017
|
+
feature_type: 'activation',
|
|
1018
|
+
}, {
|
|
1019
|
+
feature_type: 'consumption',
|
|
1020
|
+
max_consumption: number,
|
|
1021
|
+
allow_unlimited_consumptions: boolean,
|
|
1022
|
+
total_consumptions: number,
|
|
1023
|
+
allow_overages: number,
|
|
1024
|
+
max_overages: number,
|
|
1025
|
+
reset_consumption: boolean,
|
|
1026
|
+
consumption_period: string | null,
|
|
1027
|
+
}> & XOR<{
|
|
1028
|
+
is_floating: false
|
|
1029
|
+
}, {
|
|
1030
|
+
is_floating: true,
|
|
1031
|
+
floating_users: number,
|
|
1032
|
+
floating_timeout?: number,
|
|
1033
|
+
}>;
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* @type {LicenseType}
|
|
1037
|
+
*
|
|
1038
|
+
* Declares the type of License which is always one of the following:
|
|
1039
|
+
*
|
|
1040
|
+
* - *perpetual*: A perpetual license does not expire. The `is_expired` field on such a license will always be `false`.
|
|
1041
|
+
* Note that a perpetual *trial* license (`is_trial` flag is set to `true`) does have an `validity_period`, which refers to the end of the trial period.
|
|
1042
|
+
*
|
|
1043
|
+
* - *time-limited*: Has a `validity_period` set as a calendar date. After the date has passed, the `is_expired` flag will be set to `true`.
|
|
1044
|
+
*
|
|
1045
|
+
* - *subscription*: Uses an external source of truth such as a 3rd party service to determine the state of the License.
|
|
1046
|
+
*
|
|
1047
|
+
* - *consumption*: Permits usage metering. These licenses set a value the vendor wishes to meter, and then record the times that resource has been used.
|
|
1048
|
+
* Includes the following properties: `max_consumptions`, `total_consumptions`, `allow_unlimited_consumptions`, `allow_overages`, `max_overages`, `reset_consumption` and `consumption_period`.
|
|
1049
|
+
*
|
|
1050
|
+
*/
|
|
1051
|
+
export type LicenseType = 'perpetual' | 'time-limited' | 'consumption' | 'subscription';
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* @type {LicenseResponse}
|
|
1055
|
+
*
|
|
1056
|
+
* The License object received as a response when checking or activating a License. Includes a set of common properties and additional ones which may or may not appear depending on `license_type`, `is_trial`, `is_floating`/`is_floating_cloud` and Product `authorization_method` (key-based vs. user based).
|
|
1057
|
+
*/
|
|
1058
|
+
export type LicenseResponse = {
|
|
1059
|
+
id: number;
|
|
1060
|
+
allow_grace_period: boolean,
|
|
1061
|
+
allow_overages: boolean,
|
|
1062
|
+
allow_unlimited_activations: boolean,
|
|
1063
|
+
borrowed_until: string | null,
|
|
1064
|
+
can_borrow: boolean,
|
|
1065
|
+
channel: string,
|
|
1066
|
+
device_id: number,
|
|
1067
|
+
enable_maintenance_period: boolean
|
|
1068
|
+
environment: string,
|
|
1069
|
+
eula_link: string,
|
|
1070
|
+
floating_timeout: number,
|
|
1071
|
+
grace_period: number,
|
|
1072
|
+
hash_md5: string,
|
|
1073
|
+
installation_file: string,
|
|
1074
|
+
is_air_gapped: boolean,
|
|
1075
|
+
is_borrowed: boolean,
|
|
1076
|
+
is_expired: boolean,
|
|
1077
|
+
is_hardware_key_auth: boolean,
|
|
1078
|
+
license_active: boolean,
|
|
1079
|
+
license_enabled: boolean,
|
|
1080
|
+
license_signature: string,
|
|
1081
|
+
license_type: LicenseType,
|
|
1082
|
+
maintenance_period: string | null,
|
|
1083
|
+
max_activations: number,
|
|
1084
|
+
max_borrow_time: number,
|
|
1085
|
+
max_license_users: number,
|
|
1086
|
+
max_overages: number,
|
|
1087
|
+
max_transfers: number,
|
|
1088
|
+
order_store_id: string,
|
|
1089
|
+
prevent_vm: boolean,
|
|
1090
|
+
release_date: string,
|
|
1091
|
+
release_notes_link: string,
|
|
1092
|
+
requires_version: string,
|
|
1093
|
+
size: string,
|
|
1094
|
+
start_date: string | null,
|
|
1095
|
+
times_activated: number,
|
|
1096
|
+
transfer_count: number,
|
|
1097
|
+
validity_period: DateISO8601UTC | null,
|
|
1098
|
+
version: string,
|
|
1099
|
+
product_features: ProductFeature[],
|
|
1100
|
+
custom_fields: CustomField[],
|
|
1101
|
+
customer: Customer,
|
|
1102
|
+
product_details: ProductDetails,
|
|
1103
|
+
metadata: JSON,
|
|
1104
|
+
}
|
|
1105
|
+
& XOR<{
|
|
1106
|
+
license_key: string,
|
|
1107
|
+
}, {
|
|
1108
|
+
user: LicenseUser,
|
|
1109
|
+
}>
|
|
1110
|
+
& XOR<({
|
|
1111
|
+
is_floating: true,
|
|
1112
|
+
is_floating_cloud: boolean,
|
|
1113
|
+
floating_in_use_devices: number,
|
|
1114
|
+
} | {
|
|
1115
|
+
is_floating: boolean,
|
|
1116
|
+
is_floating_cloud: true,
|
|
1117
|
+
floating_in_use_devices: number,
|
|
1118
|
+
}) & {
|
|
1119
|
+
floating_users: number,
|
|
1120
|
+
floating_timeout: number,
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
is_floating_cloud: false,
|
|
1124
|
+
is_floating: false,
|
|
1125
|
+
}>
|
|
1126
|
+
& XOR<{
|
|
1127
|
+
is_trial: false,
|
|
1128
|
+
}, {
|
|
1129
|
+
is_trial: true,
|
|
1130
|
+
trial_days: number,
|
|
1131
|
+
}>
|
|
1132
|
+
& XOR<{
|
|
1133
|
+
license_type: 'consumption',
|
|
1134
|
+
max_consumptions: number,
|
|
1135
|
+
total_consumptions: number,
|
|
1136
|
+
allow_unlimited_consumptions: boolean,
|
|
1137
|
+
allow_overages: boolean,
|
|
1138
|
+
max_overages: number,
|
|
1139
|
+
reset_consumption: boolean,
|
|
1140
|
+
consumption_period: DateISO8601UTC | null,
|
|
1141
|
+
},
|
|
1142
|
+
{}
|
|
1143
|
+
>;
|
|
1144
|
+
|
|
1145
|
+
/**
|
|
1146
|
+
* @type {LicenseResponseOffline}
|
|
1147
|
+
*
|
|
1148
|
+
* The License object received as a response when activating a License using the Offline method.
|
|
1149
|
+
* This type is equal to LicenseResponse with the addition of the `license_signature_v2` property.
|
|
1150
|
+
*/
|
|
1151
|
+
export type LicenseResponseOffline = LicenseResponse & {
|
|
1152
|
+
license_signature_v2: string,
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
export type LicenseFilePayload = LicenseResponseOffline & {
|
|
1156
|
+
offline_signature: string,
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
export type OfflineActivationRequest = {
|
|
1160
|
+
prefix?: string;
|
|
1161
|
+
os_ver?: string;
|
|
1162
|
+
sdk_build_version?: string;
|
|
1163
|
+
hostname?: string;
|
|
1164
|
+
ip?: string;
|
|
1165
|
+
external_ip?: string;
|
|
1166
|
+
app_ver?: string;
|
|
1167
|
+
mac_address?: string;
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
export type DeviceVariable = {
|
|
1171
|
+
id: number,
|
|
1172
|
+
device_id: number,
|
|
1173
|
+
created_at: DateISO8601UTC,
|
|
1174
|
+
variable: string,
|
|
1175
|
+
value: string,
|
|
1176
|
+
};
|
|
1177
|
+
|
|
1178
|
+
type LicenseTrialExisting = {
|
|
1179
|
+
};
|
|
1180
|
+
|
|
1181
|
+
type LicenseTrialNewCommon = {
|
|
1182
|
+
license_key: string,
|
|
1183
|
+
id: number,
|
|
1184
|
+
order_id: number,
|
|
1185
|
+
product_id: number,
|
|
1186
|
+
max_license_users: number,
|
|
1187
|
+
max_activations: number,
|
|
1188
|
+
times_activated: number,
|
|
1189
|
+
is_trial: true,
|
|
1190
|
+
active: boolean,
|
|
1191
|
+
enabled: boolean,
|
|
1192
|
+
max_transfers: number,
|
|
1193
|
+
trial_days: number,
|
|
1194
|
+
maintenance_duration: DateISO8601UTC | null,
|
|
1195
|
+
validity_period: DateISO8601UTC | null,
|
|
1196
|
+
enable_maintenance_period: boolean,
|
|
1197
|
+
prevent_vm: boolean,
|
|
1198
|
+
is_hardware_key_auth: boolean,
|
|
1199
|
+
license_user: string,
|
|
1200
|
+
initial_password: string,
|
|
1201
|
+
metadata: JSON,
|
|
1202
|
+
created_at: number,
|
|
1203
|
+
updated_at: number,
|
|
1204
|
+
LicenseProductFeatures: LicenseProductFeature[],
|
|
1205
|
+
LicenseCustomFields: {
|
|
1206
|
+
product_custom_field_id: number,
|
|
1207
|
+
value: string
|
|
1208
|
+
}[],
|
|
1209
|
+
};
|
|
1210
|
+
|
|
1211
|
+
type LicenseTrialNew = LicenseTrialNewCommon
|
|
1212
|
+
& (XOR<
|
|
1213
|
+
{
|
|
1214
|
+
is_floating_cloud: true,
|
|
1215
|
+
floating_users: number,
|
|
1216
|
+
floating_timeout: number,
|
|
1217
|
+
},
|
|
1218
|
+
{}
|
|
1219
|
+
>)
|
|
1220
|
+
& (XOR<
|
|
1221
|
+
{
|
|
1222
|
+
license_type: 'consumption',
|
|
1223
|
+
allow_overages: boolean,
|
|
1224
|
+
max_overages: number,
|
|
1225
|
+
max_consumptions: number,
|
|
1226
|
+
valid_duration: null,
|
|
1227
|
+
consumption_period: string | null,
|
|
1228
|
+
reset_consumption: boolean,
|
|
1229
|
+
},
|
|
1230
|
+
XOR<
|
|
1231
|
+
{
|
|
1232
|
+
license_type: 'subscription',
|
|
1233
|
+
grace_period: number,
|
|
1234
|
+
allow_grace_period: boolean,
|
|
1235
|
+
},
|
|
1236
|
+
{
|
|
1237
|
+
license_type: 'perpetual' | 'time-limited',
|
|
1238
|
+
}
|
|
1239
|
+
>
|
|
1240
|
+
>
|
|
1241
|
+
);
|
|
1242
|
+
|
|
1243
|
+
export type LicenseTrialResponse = (LicenseTrialNew | LicenseTrialExisting) & {
|
|
1244
|
+
license_type: LicenseType,
|
|
1245
|
+
is_trial: boolean,
|
|
1246
|
+
/** Username */
|
|
1247
|
+
license_user: string,
|
|
1248
|
+
};
|
|
1249
|
+
|
|
1250
|
+
type CustomerLicenseUser = {
|
|
1251
|
+
email: string,
|
|
1252
|
+
is_active: boolean,
|
|
1253
|
+
first_name: string,
|
|
1254
|
+
last_name: string,
|
|
1255
|
+
phone_number: string,
|
|
1256
|
+
is_initial_password: boolean,
|
|
1257
|
+
initial_password: string,
|
|
1258
|
+
max_activations: number,
|
|
1259
|
+
total_activations: number,
|
|
1260
|
+
license_id: number,
|
|
1261
|
+
order_id: number,
|
|
1262
|
+
order_store_id: string,
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
export type CustomerLicenseUsersResponse = {
|
|
1266
|
+
customer: {
|
|
1267
|
+
email: string | null,
|
|
1268
|
+
first_name: string | null,
|
|
1269
|
+
last_name: string | null,
|
|
1270
|
+
company_name: string | null,
|
|
1271
|
+
phone: string | null,
|
|
1272
|
+
reference: string | null,
|
|
1273
|
+
address: string | null,
|
|
1274
|
+
postcode: string | null,
|
|
1275
|
+
city: string | null,
|
|
1276
|
+
country: string | null,
|
|
1277
|
+
state: string | null,
|
|
1278
|
+
customer_account: null | {
|
|
1279
|
+
id: string,
|
|
1280
|
+
name: string,
|
|
1281
|
+
code: string,
|
|
1282
|
+
},
|
|
1283
|
+
metadata: JSON,
|
|
1284
|
+
},
|
|
1285
|
+
users: CustomerLicenseUser[]
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1288
|
+
export type LicenseFeatureResponse = {
|
|
1289
|
+
id: number,
|
|
1290
|
+
code: string,
|
|
1291
|
+
name: string,
|
|
1292
|
+
floating_timeout: number | null,
|
|
1293
|
+
floating_users: number | null,
|
|
1294
|
+
feature_type: 'activation' | 'consumption'
|
|
1295
|
+
expiry_date: DateISO8601UTC | null,
|
|
1296
|
+
metadata: JSON,
|
|
1297
|
+
is_floating: boolean,
|
|
1298
|
+
is_floating_cloud: boolean,
|
|
1299
|
+
floating_in_use_devices: number,
|
|
1300
|
+
license_id: number,
|
|
1301
|
+
};
|
|
1302
|
+
|
|
1303
|
+
export type LicenseProductFeature = {
|
|
1304
|
+
id: number,
|
|
1305
|
+
product_feature_id: number,
|
|
1306
|
+
max_consumption: number,
|
|
1307
|
+
allow_overages: boolean,
|
|
1308
|
+
max_overages: number,
|
|
1309
|
+
reset_consumption: number,
|
|
1310
|
+
consumption_period: string | null,
|
|
1311
|
+
expiry_date: DateISO8601UTC | null,
|
|
1312
|
+
is_floating: boolean,
|
|
1313
|
+
is_floating_cloud: boolean,
|
|
1314
|
+
metadata: JSON,
|
|
1315
|
+
} & XOR<({ is_floating: true } | { is_floating_cloud: true }) & {
|
|
1316
|
+
floating_timeout: number,
|
|
1317
|
+
floating_users: number,
|
|
1318
|
+
},
|
|
1319
|
+
{}>;
|
|
1320
|
+
|
|
1321
|
+
export type LicenseConsumptionsResponse = {
|
|
1322
|
+
id: number,
|
|
1323
|
+
max_consumptions: number,
|
|
1324
|
+
total_consumptions: number,
|
|
1325
|
+
allow_unlimited_consumptions: boolean,
|
|
1326
|
+
allow_negative_consumptions: boolean,
|
|
1327
|
+
allow_overages: boolean,
|
|
1328
|
+
max_overages: number,
|
|
1329
|
+
reset_consumption: boolean,
|
|
1330
|
+
consumption_period: string | null,
|
|
1331
|
+
};
|
|
1332
|
+
|
|
1333
|
+
export type LicenseFeatureConsumptionResponse = {
|
|
1334
|
+
total_consumptions: number,
|
|
1335
|
+
is_floating: boolean,
|
|
1336
|
+
is_floating_cloud: boolean,
|
|
1337
|
+
floating_timeout: number,
|
|
1338
|
+
floating_users: number,
|
|
1339
|
+
};
|
|
1340
|
+
|
|
1341
|
+
export type ProductDetailsResponse = ProductDetails & {
|
|
1342
|
+
floating_timeout: number,
|
|
1343
|
+
max_overages: number,
|
|
1344
|
+
trial_days: number,
|
|
1345
|
+
allow_overages: boolean,
|
|
1346
|
+
allow_trial: boolean,
|
|
1347
|
+
prevent_vm: boolean,
|
|
1348
|
+
custom_fields: {
|
|
1349
|
+
id: number,
|
|
1350
|
+
name: string,
|
|
1351
|
+
default_value: string,
|
|
1352
|
+
}[],
|
|
1353
|
+
latest_version: null | (InstallationFileBase & {
|
|
1354
|
+
id: number,
|
|
1355
|
+
product_id: number,
|
|
1356
|
+
enabled: boolean,
|
|
1357
|
+
created_at: DateISO8601UTC,
|
|
1358
|
+
updated_at: DateISO8601UTC,
|
|
1359
|
+
full_link: string | null,
|
|
1360
|
+
filename: string | null,
|
|
1361
|
+
})
|
|
1362
|
+
};
|
|
1363
|
+
|
|
1364
|
+
export type LicenseBorrowResponse = {
|
|
1365
|
+
license_id: number,
|
|
1366
|
+
device_id: number,
|
|
1367
|
+
borrowed_until: DateInputString,
|
|
1368
|
+
max_borrow_time: number,
|
|
1369
|
+
};
|
|
1370
|
+
|
|
1371
|
+
type InstallationFileBase = {
|
|
1372
|
+
version: string | null,
|
|
1373
|
+
environment: string | null,
|
|
1374
|
+
hash_md5: string | null,
|
|
1375
|
+
eula_link: string | null,
|
|
1376
|
+
release_notes_link: string | null,
|
|
1377
|
+
size: string | null,
|
|
1378
|
+
requires_version: string | null,
|
|
1379
|
+
channel: string | null,
|
|
1380
|
+
release_date: DateISO8601UTC | null,
|
|
1381
|
+
};
|
|
1382
|
+
|
|
1383
|
+
export type InstallationFileResponse = InstallationFileBase & {
|
|
1384
|
+
installation_file: string | null
|
|
1385
|
+
};
|
|
1386
|
+
|
|
1387
|
+
export type VersionsResponse = {
|
|
1388
|
+
version: string,
|
|
1389
|
+
release_date: DateISO8601UTC,
|
|
1390
|
+
}[];
|
|
1391
|
+
|
|
1392
|
+
export type LicenseDataMethod = 'check_license'
|
|
1393
|
+
|'activate_license'
|
|
1394
|
+
|'activate_license_offline'
|
|
1395
|
+
|'activate_air_gap'
|
|
1396
|
+
|'update_license_offline'
|
|
1397
|
+
|'product_details'
|
|
1398
|
+
|'device_variables'
|
|
1399
|
+
|'normal'
|
|
1400
|
+
|'license_consumption'
|
|
1401
|
+
|'feature_consumption'
|
|
1402
|
+
|'register_feature'
|
|
1403
|
+
|'floating_server_register'
|
|
1404
|
+
;
|
|
1405
|
+
|
|
1406
|
+
export enum HardwareIdAlgorithm {
|
|
1407
|
+
Default = 0,
|
|
1408
|
+
WindowsHardwareFingerprintId = 1,
|
|
1409
|
+
WindowsComputerSystemProductId = 2,
|
|
1410
|
+
WindowsCryptographyId = 3,
|
|
1411
|
+
LinuxMachineId = 4,
|
|
1412
|
+
CloudPlatformsId = 5,
|
|
1413
|
+
};
|
|
1414
|
+
|
|
1415
|
+
/** Date string in ISO 8601 format (always in UTC timezone) with optional separators and optional time component, e.g.:
|
|
1416
|
+
*
|
|
1417
|
+
* "2024-09-27T23:30:48.016Z"
|
|
1418
|
+
*
|
|
1419
|
+
* "2024-09-27 23:30:48.016"
|
|
1420
|
+
*
|
|
1421
|
+
* "2024-09-27 23:30:48"
|
|
1422
|
+
*
|
|
1423
|
+
* "2024-09-27 23:30"
|
|
1424
|
+
*
|
|
1425
|
+
* "2024-09-27"
|
|
1426
|
+
*
|
|
1427
|
+
*/
|
|
1428
|
+
export type DateInputString = string;
|
|
1429
|
+
|
|
1430
|
+
/** Date string in full ISO 8601 format, e.g. "2024-09-27T23:30:48.016Z". Note: this is always in UTC timezone */
|
|
1431
|
+
export type DateISO8601UTC = string;
|
|
1432
|
+
|
|
1433
|
+
/** Date string in RFC 7231 format, e.g. "Fri, 27 Sep 2024 23:30:48 GMT". Note: this is always in GMT timezone */
|
|
1434
|
+
export type DateRFC7231 = string;
|
|
1435
|
+
|
|
1436
|
+
export type Managed<T> = Omit<T, 'product' | 'hardware_id'>;
|
|
1437
|
+
|
|
1438
|
+
type ListProps<T> = { [K in keyof T]: T[K] } & {};
|
|
1439
|
+
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
|
|
1440
|
+
type EvalIfIs<T, U> = unknown extends T ? never : U;
|
|
1441
|
+
type XOR<A, B, C = unknown, D = unknown, E = unknown, F = unknown, G = unknown, H = unknown> =
|
|
1442
|
+
ListProps<
|
|
1443
|
+
(Without<B & C & D & E & F & G & H, A> & A)
|
|
1444
|
+
| (Without<A & C & D & E & F & G & H, B> & B)
|
|
1445
|
+
| EvalIfIs<C, Without<A & B & D & E & F & G & H, C> & C>
|
|
1446
|
+
| EvalIfIs<D, Without<A & B & C & E & F & G & H, D> & D>
|
|
1447
|
+
| EvalIfIs<E, Without<A & B & C & D & F & G & H, E> & E>
|
|
1448
|
+
| EvalIfIs<F, Without<A & B & C & D & E & G & H, F> & F>
|
|
1449
|
+
| EvalIfIs<G, Without<A & B & C & D & E & F & H, G> & G>
|
|
1450
|
+
| EvalIfIs<H, Without<A & B & C & D & E & F & G, H> & H>
|
|
1451
|
+
>;
|
|
1452
|
+
```
|