@licensespring/node-sdk 1.1.18 → 1.1.19-alpha

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.
@@ -1,4 +1,5 @@
1
1
  import { AxiosProxyConfig } from 'axios';
2
+ import { ActivateOfflineResponse, ConsumptionPeriod } from './response-types';
2
3
  export type JSONType = string | number | boolean | null | JSONObject | JSONArray;
3
4
  export interface JSONObject {
4
5
  [key: string]: JSONType;
@@ -169,19 +170,28 @@ export type ProductFeature = {
169
170
  floating_timeout?: number;
170
171
  }>;
171
172
  export type LicenseType = 'perpetual' | 'time-limited' | 'consumption' | 'subscription';
172
- export type LicenseResponse = {
173
+ export type LicenseFilePayload = ActivateOfflineResponse & {
174
+ offline_signature: string;
175
+ };
176
+ export type LicenseData = {
173
177
  id: number;
174
178
  allow_grace_period: boolean;
175
- allow_overages: boolean;
179
+ allow_overages?: boolean;
176
180
  allow_unlimited_activations: boolean;
181
+ allow_unlimited_consumptions?: boolean;
177
182
  borrowed_until: string | null;
178
183
  can_borrow: boolean;
179
184
  channel: string;
185
+ consumption_period?: ConsumptionPeriod;
186
+ custom_fields: CustomField[];
187
+ customer: Customer;
180
188
  device_id: number;
181
189
  enable_maintenance_period: boolean;
182
190
  environment: string;
183
191
  eula_link: string;
192
+ floating_in_use_devices?: number;
184
193
  floating_timeout: number;
194
+ floating_users?: number;
185
195
  grace_period: number;
186
196
  hardware_id: string;
187
197
  hash_md5: string;
@@ -189,7 +199,10 @@ export type LicenseResponse = {
189
199
  is_air_gapped: boolean;
190
200
  is_borrowed: boolean;
191
201
  is_expired: boolean;
202
+ is_floating_cloud: boolean;
203
+ is_floating: boolean;
192
204
  is_hardware_key_auth: boolean;
205
+ is_trial: boolean;
193
206
  license_active: boolean;
194
207
  license_enabled: boolean;
195
208
  license_signature: string;
@@ -197,64 +210,32 @@ export type LicenseResponse = {
197
210
  maintenance_period: string | null;
198
211
  max_activations: number;
199
212
  max_borrow_time: number;
213
+ max_consumptions?: number;
200
214
  max_license_users: number;
201
- max_overages: number;
215
+ max_overages?: number;
202
216
  max_transfers?: number;
217
+ metadata: JSON;
203
218
  order_store_id: string;
204
219
  prevent_vm: boolean;
220
+ product_details: ProductDetails;
221
+ product_features: ProductFeature[];
205
222
  release_date: string;
206
223
  release_notes_link: string;
207
224
  requires_version: string;
225
+ reset_consumption?: boolean;
208
226
  size: string;
209
227
  start_date: string | null;
210
228
  times_activated: number;
229
+ total_consumptions?: number;
211
230
  transfer_count: number;
231
+ trial_days?: number;
212
232
  validity_period: DateISO8601UTC | null;
213
233
  version: string;
214
- product_features: ProductFeature[];
215
- custom_fields: CustomField[];
216
- customer: Customer;
217
- product_details: ProductDetails;
218
- metadata: JSON;
219
- } & XOR<{
234
+ } & ({
220
235
  license_key: string;
221
- }, {
222
- user: LicenseUser;
223
- }> & XOR<({
224
- is_floating: true;
225
- is_floating_cloud: boolean;
226
- floating_in_use_devices: number;
227
236
  } | {
228
- is_floating: boolean;
229
- is_floating_cloud: true;
230
- floating_in_use_devices: number;
231
- }) & {
232
- floating_users: number;
233
- }, {
234
- is_floating_cloud: false;
235
- is_floating: false;
236
- }> & XOR<{
237
- is_trial: false;
238
- }, {
239
- is_trial: true;
240
- trial_days: number;
241
- }> & XOR<{
242
- license_type: 'consumption';
243
- max_consumptions: number;
244
- total_consumptions: number;
245
- allow_unlimited_consumptions: boolean;
246
- allow_overages: boolean;
247
- max_overages: number;
248
- reset_consumption: boolean;
249
- consumption_period: 'daily' | 'weekly' | 'monthly' | 'annually' | null;
250
- }, {}>;
251
- export type LicenseResponseOffline = LicenseResponse & {
252
- license_signature_v2: string;
253
- date: string;
254
- };
255
- export type LicenseFilePayload = LicenseResponseOffline & {
256
- offline_signature: string;
257
- };
237
+ user: LicenseUser;
238
+ });
258
239
  export type DeviceVariable = {
259
240
  id: number;
260
241
  device_id: number;
@@ -262,110 +243,6 @@ export type DeviceVariable = {
262
243
  variable: string;
263
244
  value: string;
264
245
  };
265
- type LicenseTrialExisting = {};
266
- type LicenseTrialNewCommon = {
267
- license_key: string;
268
- id: number;
269
- order_id: number;
270
- product_id: number;
271
- max_license_users: number;
272
- max_activations: number;
273
- times_activated: number;
274
- is_trial: true;
275
- active: boolean;
276
- enabled: boolean;
277
- max_transfers: number;
278
- trial_days: number;
279
- maintenance_duration: TimeLength | null;
280
- validity_period: DateISO8601UTC | null;
281
- enable_maintenance_period: boolean;
282
- prevent_vm: boolean;
283
- is_hardware_key_auth: boolean;
284
- license_user: string;
285
- initial_password: string;
286
- metadata: JSON;
287
- created_at: number;
288
- updated_at: number;
289
- LicenseProductFeatures: LicenseProductFeature[];
290
- LicenseCustomFields: {
291
- product_custom_field_id: number;
292
- value: string;
293
- }[];
294
- };
295
- type LicenseTrialNew = LicenseTrialNewCommon & (XOR<{
296
- is_floating_cloud: true;
297
- floating_users: number;
298
- floating_timeout: number;
299
- }, {}>) & (XOR<{
300
- license_type: 'consumption';
301
- allow_overages: boolean;
302
- max_overages: number;
303
- max_consumptions: number;
304
- valid_duration: null;
305
- consumption_period: 'daily' | 'weekly' | 'monthly' | 'annually' | null;
306
- reset_consumption: boolean;
307
- }, XOR<{
308
- license_type: 'subscription';
309
- grace_period: number;
310
- allow_grace_period: boolean;
311
- }, {
312
- license_type: 'perpetual' | 'time-limited';
313
- }>>);
314
- export type LicenseTrialResponse = (LicenseTrialNew | LicenseTrialExisting) & {
315
- license_type: LicenseType;
316
- is_trial: boolean;
317
- license_user: string;
318
- };
319
- type CustomerLicenseUser = {
320
- email: string;
321
- is_active: boolean;
322
- first_name: string;
323
- last_name: string;
324
- phone_number: string;
325
- is_initial_password: boolean;
326
- initial_password: string;
327
- max_activations: number;
328
- total_activations: number;
329
- license_id: number;
330
- order_id: number;
331
- order_store_id: string;
332
- };
333
- export type CustomerLicenseUsersResponse = {
334
- customer: {
335
- email: string | null;
336
- first_name: string | null;
337
- last_name: string | null;
338
- company_name: string | null;
339
- phone: string | null;
340
- reference: string | null;
341
- address: string | null;
342
- postcode: string | null;
343
- city: string | null;
344
- country: string | null;
345
- state: string | null;
346
- customer_account: null | {
347
- id: string;
348
- name: string;
349
- code: string;
350
- };
351
- metadata: JSON;
352
- };
353
- users: CustomerLicenseUser[];
354
- };
355
- export type LicenseFeatureResponse = {
356
- id: number;
357
- code: string;
358
- name: string;
359
- floating_timeout: number | null;
360
- floating_users: number | null;
361
- feature_type: 'activation' | 'consumption';
362
- expiry_date: DateISO8601UTC | null;
363
- metadata: JSON;
364
- is_floating: boolean;
365
- is_floating_cloud: boolean;
366
- floating_in_use_devices: number;
367
- license_id: number;
368
- };
369
246
  export type LicenseProductFeature = {
370
247
  id: number;
371
248
  product_feature_id: number;
@@ -386,77 +263,6 @@ export type LicenseProductFeature = {
386
263
  floating_timeout: number;
387
264
  floating_users: number;
388
265
  }, {}>;
389
- export type LicenseConsumptionsResponse = {
390
- id: number;
391
- max_consumptions: number;
392
- total_consumptions: number;
393
- allow_unlimited_consumptions: boolean;
394
- allow_negative_consumptions: boolean;
395
- allow_overages: boolean;
396
- max_overages: number;
397
- reset_consumption: boolean;
398
- consumption_period: 'daily' | 'weekly' | 'monthly' | 'annually' | null;
399
- };
400
- export type LicenseFeatureConsumptionResponse = {
401
- allow_negative_consumptions: boolean;
402
- allow_overages: boolean;
403
- allow_unlimited_consumptions: boolean;
404
- consumption_period: 'daily' | 'weekly' | 'monthly' | 'annually' | null;
405
- is_floating_cloud: boolean;
406
- is_floating: boolean;
407
- max_consumptions: number;
408
- max_overages: number;
409
- reset_consumption: boolean;
410
- total_consumptions: number;
411
- floating_timeout?: number | null;
412
- floating_users?: number;
413
- };
414
- export type ProductDetailsResponse = ProductDetails & {
415
- floating_timeout: number;
416
- max_overages: number;
417
- trial_days: number;
418
- allow_overages: boolean;
419
- allow_trial: boolean;
420
- prevent_vm: boolean;
421
- custom_fields: {
422
- id: number;
423
- name: string;
424
- default_value: string;
425
- }[];
426
- latest_version: null | (InstallationFileBase & {
427
- id: number;
428
- product_id: number;
429
- enabled: boolean;
430
- created_at: DateISO8601UTC;
431
- updated_at: DateISO8601UTC;
432
- full_link: string | null;
433
- filename: string | null;
434
- });
435
- };
436
- export type LicenseBorrowResponse = {
437
- license_id: number;
438
- device_id: number;
439
- borrowed_until: DateInputString;
440
- max_borrow_time: number;
441
- };
442
- type InstallationFileBase = {
443
- version: string | null;
444
- environment: string | null;
445
- hash_md5: string | null;
446
- eula_link: string | null;
447
- release_notes_link: string | null;
448
- size: string | null;
449
- requires_version: string | null;
450
- channel: string | null;
451
- release_date: DateISO8601UTC | null;
452
- };
453
- export type InstallationFileResponse = InstallationFileBase & {
454
- installation_file: string | null;
455
- };
456
- export type VersionsResponse = {
457
- version: string;
458
- release_date: DateISO8601UTC;
459
- }[];
460
266
  export type CreateOfflineActivationRequestPayload = {
461
267
  bundle_code?: string;
462
268
  hardware_id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAwqBA,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,mEAAW,CAAA;IACX,6GAAgC,CAAA;IAChC,iHAAkC,CAAA;IAClC,+FAAyB,CAAA;IACzB,iFAAkB,CAAA;IAClB,qFAAoB,CAAA;AACtB,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B;AAAA,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AA+aA,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,mEAAW,CAAA;IACX,6GAAgC,CAAA;IAChC,iHAAkC,CAAA;IAClC,+FAAyB,CAAA;IACzB,iFAAkB,CAAA;IAClB,qFAAoB,CAAA;AACtB,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B;AAAA,CAAC"}
@@ -49,7 +49,7 @@ class Watchdog {
49
49
  }
50
50
  }
51
51
  if (this.runningForFeatures) {
52
- const features = ((_a = this.license.features) === null || _a === void 0 ? void 0 : _a.map(feature => feature.code)) || [];
52
+ const features = ((_a = this.license.features) === null || _a === void 0 ? void 0 : _a.map((feature) => feature.code)) || [];
53
53
  for (const featureCode in features) {
54
54
  try {
55
55
  yield this.license.checkFeature(featureCode);
@@ -1 +1 @@
1
- {"version":3,"file":"watchdog.js","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,QAAQ;IASnB,YAAoB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;QAN5B,sBAAiB,GAAY,KAAK,CAAC;QACnC,uBAAkB,GAAY,KAAK,CAAC;QAGpC,aAAQ,GAAW,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAI1C,CAAC;IAED,eAAe,CAAC,QAAmB;QACjC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;QAChC,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,uBAAuB,CAAC,QAAsC;QAC5D,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC/B,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;QACjC,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,cAAc;QACZ,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACjC,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,eAAe;QACb,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAClC,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAEa,MAAM;;;YAElB,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;gBAC3B,IAAI,CAAC;oBACH,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;gBAE7B,CAAC;gBAAC,OAAO,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C,OAAO,CAAC,IAAI,CAAC,KAAI,EAAE,CAAC;gBAC/F,KAAK,MAAM,WAAW,IAAI,QAAQ,EAAE,CAAC;oBACnC,IAAI,CAAC;wBACH,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;oBAE/C,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,IAAI,CAAC,gBAAiB,CAAC,WAAW,CAAC,CAAC;oBACtC,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;KAAA;IAEO,UAAU;QAChB,IAAI,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACtD,IAAI,IAAI,CAAC,eAAe,IAAI,SAAS,EAAE,CAAC;gBACtC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;gBACpC,IAAI,CAAC,eAAe,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC5E,CAAC;QACH,CAAC;IACH,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxD,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACpC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QACnC,CAAC;IACH,CAAC;CACF;AA5ED,4BA4EC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licensespring/node-sdk",
3
- "version": "1.1.18",
3
+ "version": "1.1.19-alpha",
4
4
  "main": "dist/src/index.js",
5
5
  "modules": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",