@moonbase.sh/api 0.1.109 → 0.1.110
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/dist/index.cjs +12 -3
- package/dist/index.d.cts +87 -1
- package/dist/index.d.ts +87 -1
- package/dist/index.js +12 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -100,13 +100,17 @@ var ActivationMethod = /* @__PURE__ */ ((ActivationMethod2) => {
|
|
|
100
100
|
// src/licenses/schemas.ts
|
|
101
101
|
var licenseSchema = import_zod2.z.object({
|
|
102
102
|
id: import_zod2.z.string(),
|
|
103
|
+
productId: import_zod2.z.string(),
|
|
104
|
+
ownerId: import_zod2.z.string(),
|
|
103
105
|
status: import_zod2.z.nativeEnum(LicenseStatus),
|
|
104
106
|
activeNumberOfActivations: import_zod2.z.number(),
|
|
105
|
-
maxNumberOfActivations: import_zod2.z.number()
|
|
107
|
+
maxNumberOfActivations: import_zod2.z.number(),
|
|
108
|
+
offlineActivationsAllowed: import_zod2.z.boolean()
|
|
106
109
|
});
|
|
107
110
|
var licenseActivationSchema = import_zod2.z.object({
|
|
108
111
|
id: import_zod2.z.string(),
|
|
109
112
|
name: import_zod2.z.string(),
|
|
113
|
+
signature: import_zod2.z.string(),
|
|
110
114
|
status: import_zod2.z.nativeEnum(ActivationStatus),
|
|
111
115
|
activationMethod: import_zod2.z.nativeEnum(ActivationMethod),
|
|
112
116
|
lastValidatedAt: import_zod2.z.coerce.date(),
|
|
@@ -149,6 +153,9 @@ var TrialStatus = /* @__PURE__ */ ((TrialStatus2) => {
|
|
|
149
153
|
// src/trials/schemas.ts
|
|
150
154
|
var trialSchema = import_zod4.z.object({
|
|
151
155
|
id: import_zod4.z.string(),
|
|
156
|
+
productId: import_zod4.z.string(),
|
|
157
|
+
deviceName: import_zod4.z.string(),
|
|
158
|
+
deviceSignature: import_zod4.z.string(),
|
|
152
159
|
status: import_zod4.z.nativeEnum(TrialStatus),
|
|
153
160
|
expiresAt: import_zod4.z.coerce.date(),
|
|
154
161
|
lastValidatedAt: import_zod4.z.coerce.date(),
|
|
@@ -166,6 +173,8 @@ var ActivationRequestStatus = /* @__PURE__ */ ((ActivationRequestStatus2) => {
|
|
|
166
173
|
// src/activationRequests/schemas.ts
|
|
167
174
|
var activationRequestSchema = import_zod5.z.object({
|
|
168
175
|
id: import_zod5.z.string(),
|
|
176
|
+
deviceName: import_zod5.z.string(),
|
|
177
|
+
deviceSignature: import_zod5.z.string(),
|
|
169
178
|
status: import_zod5.z.nativeEnum(ActivationRequestStatus),
|
|
170
179
|
product: productSchema,
|
|
171
180
|
activation: licenseActivationSchema.optional(),
|
|
@@ -182,8 +191,8 @@ var ActivationRequestEndpoints = class {
|
|
|
182
191
|
const response = await this.api.fetch(`/api/activations/${requestId}`);
|
|
183
192
|
return activationRequestSchema.parse(response.data);
|
|
184
193
|
}
|
|
185
|
-
async request(productId) {
|
|
186
|
-
const response = await this.api.fetch(`/api/activations/${productId}/request
|
|
194
|
+
async request(productId, target) {
|
|
195
|
+
const response = await this.api.fetch(`/api/activations/${productId}/request`, "POST", target);
|
|
187
196
|
return activationRequestSchema.parse(response.data);
|
|
188
197
|
}
|
|
189
198
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -15,6 +15,8 @@ declare class MoonbaseApi {
|
|
|
15
15
|
|
|
16
16
|
declare const activationRequestSchema: z.ZodObject<{
|
|
17
17
|
id: z.ZodString;
|
|
18
|
+
deviceName: z.ZodString;
|
|
19
|
+
deviceSignature: z.ZodString;
|
|
18
20
|
status: z.ZodNativeEnum<typeof ActivationRequestStatus>;
|
|
19
21
|
product: z.ZodObject<{
|
|
20
22
|
id: z.ZodString;
|
|
@@ -50,52 +52,73 @@ declare const activationRequestSchema: z.ZodObject<{
|
|
|
50
52
|
activation: z.ZodOptional<z.ZodObject<{
|
|
51
53
|
id: z.ZodString;
|
|
52
54
|
name: z.ZodString;
|
|
55
|
+
signature: z.ZodString;
|
|
53
56
|
status: z.ZodNativeEnum<typeof ActivationStatus>;
|
|
54
57
|
activationMethod: z.ZodNativeEnum<typeof ActivationMethod>;
|
|
55
58
|
lastValidatedAt: z.ZodDate;
|
|
56
59
|
license: z.ZodObject<{
|
|
57
60
|
id: z.ZodString;
|
|
61
|
+
productId: z.ZodString;
|
|
62
|
+
ownerId: z.ZodString;
|
|
58
63
|
status: z.ZodNativeEnum<typeof LicenseStatus>;
|
|
59
64
|
activeNumberOfActivations: z.ZodNumber;
|
|
60
65
|
maxNumberOfActivations: z.ZodNumber;
|
|
66
|
+
offlineActivationsAllowed: z.ZodBoolean;
|
|
61
67
|
}, "strip", z.ZodTypeAny, {
|
|
62
68
|
status: LicenseStatus;
|
|
63
69
|
id: string;
|
|
70
|
+
productId: string;
|
|
71
|
+
ownerId: string;
|
|
64
72
|
activeNumberOfActivations: number;
|
|
65
73
|
maxNumberOfActivations: number;
|
|
74
|
+
offlineActivationsAllowed: boolean;
|
|
66
75
|
}, {
|
|
67
76
|
status: LicenseStatus;
|
|
68
77
|
id: string;
|
|
78
|
+
productId: string;
|
|
79
|
+
ownerId: string;
|
|
69
80
|
activeNumberOfActivations: number;
|
|
70
81
|
maxNumberOfActivations: number;
|
|
82
|
+
offlineActivationsAllowed: boolean;
|
|
71
83
|
}>;
|
|
72
84
|
}, "strip", z.ZodTypeAny, {
|
|
73
85
|
status: ActivationStatus;
|
|
74
86
|
id: string;
|
|
75
87
|
name: string;
|
|
88
|
+
signature: string;
|
|
76
89
|
activationMethod: ActivationMethod;
|
|
77
90
|
lastValidatedAt: Date;
|
|
78
91
|
license: {
|
|
79
92
|
status: LicenseStatus;
|
|
80
93
|
id: string;
|
|
94
|
+
productId: string;
|
|
95
|
+
ownerId: string;
|
|
81
96
|
activeNumberOfActivations: number;
|
|
82
97
|
maxNumberOfActivations: number;
|
|
98
|
+
offlineActivationsAllowed: boolean;
|
|
83
99
|
};
|
|
84
100
|
}, {
|
|
85
101
|
status: ActivationStatus;
|
|
86
102
|
id: string;
|
|
87
103
|
name: string;
|
|
104
|
+
signature: string;
|
|
88
105
|
activationMethod: ActivationMethod;
|
|
89
106
|
lastValidatedAt: Date;
|
|
90
107
|
license: {
|
|
91
108
|
status: LicenseStatus;
|
|
92
109
|
id: string;
|
|
110
|
+
productId: string;
|
|
111
|
+
ownerId: string;
|
|
93
112
|
activeNumberOfActivations: number;
|
|
94
113
|
maxNumberOfActivations: number;
|
|
114
|
+
offlineActivationsAllowed: boolean;
|
|
95
115
|
};
|
|
96
116
|
}>>;
|
|
97
117
|
trial: z.ZodOptional<z.ZodObject<{
|
|
98
118
|
id: z.ZodString;
|
|
119
|
+
productId: z.ZodString;
|
|
120
|
+
deviceName: z.ZodString;
|
|
121
|
+
deviceSignature: z.ZodString;
|
|
99
122
|
status: z.ZodNativeEnum<typeof TrialStatus>;
|
|
100
123
|
expiresAt: z.ZodDate;
|
|
101
124
|
lastValidatedAt: z.ZodDate;
|
|
@@ -103,13 +126,19 @@ declare const activationRequestSchema: z.ZodObject<{
|
|
|
103
126
|
}, "strip", z.ZodTypeAny, {
|
|
104
127
|
status: TrialStatus;
|
|
105
128
|
id: string;
|
|
129
|
+
productId: string;
|
|
106
130
|
lastValidatedAt: Date;
|
|
131
|
+
deviceName: string;
|
|
132
|
+
deviceSignature: string;
|
|
107
133
|
expiresAt: Date;
|
|
108
134
|
ownerId?: string | undefined;
|
|
109
135
|
}, {
|
|
110
136
|
status: TrialStatus;
|
|
111
137
|
id: string;
|
|
138
|
+
productId: string;
|
|
112
139
|
lastValidatedAt: Date;
|
|
140
|
+
deviceName: string;
|
|
141
|
+
deviceSignature: string;
|
|
113
142
|
expiresAt: Date;
|
|
114
143
|
ownerId?: string | undefined;
|
|
115
144
|
}>>;
|
|
@@ -204,6 +233,8 @@ declare const activationRequestSchema: z.ZodObject<{
|
|
|
204
233
|
}, "strip", z.ZodTypeAny, {
|
|
205
234
|
status: ActivationRequestStatus;
|
|
206
235
|
id: string;
|
|
236
|
+
deviceName: string;
|
|
237
|
+
deviceSignature: string;
|
|
207
238
|
product: {
|
|
208
239
|
status: ProductStatus;
|
|
209
240
|
id: string;
|
|
@@ -219,19 +250,26 @@ declare const activationRequestSchema: z.ZodObject<{
|
|
|
219
250
|
status: ActivationStatus;
|
|
220
251
|
id: string;
|
|
221
252
|
name: string;
|
|
253
|
+
signature: string;
|
|
222
254
|
activationMethod: ActivationMethod;
|
|
223
255
|
lastValidatedAt: Date;
|
|
224
256
|
license: {
|
|
225
257
|
status: LicenseStatus;
|
|
226
258
|
id: string;
|
|
259
|
+
productId: string;
|
|
260
|
+
ownerId: string;
|
|
227
261
|
activeNumberOfActivations: number;
|
|
228
262
|
maxNumberOfActivations: number;
|
|
263
|
+
offlineActivationsAllowed: boolean;
|
|
229
264
|
};
|
|
230
265
|
} | undefined;
|
|
231
266
|
trial?: {
|
|
232
267
|
status: TrialStatus;
|
|
233
268
|
id: string;
|
|
269
|
+
productId: string;
|
|
234
270
|
lastValidatedAt: Date;
|
|
271
|
+
deviceName: string;
|
|
272
|
+
deviceSignature: string;
|
|
235
273
|
expiresAt: Date;
|
|
236
274
|
ownerId?: string | undefined;
|
|
237
275
|
} | undefined;
|
|
@@ -262,6 +300,8 @@ declare const activationRequestSchema: z.ZodObject<{
|
|
|
262
300
|
}, {
|
|
263
301
|
status: ActivationRequestStatus;
|
|
264
302
|
id: string;
|
|
303
|
+
deviceName: string;
|
|
304
|
+
deviceSignature: string;
|
|
265
305
|
product: {
|
|
266
306
|
status: ProductStatus;
|
|
267
307
|
id: string;
|
|
@@ -277,19 +317,26 @@ declare const activationRequestSchema: z.ZodObject<{
|
|
|
277
317
|
status: ActivationStatus;
|
|
278
318
|
id: string;
|
|
279
319
|
name: string;
|
|
320
|
+
signature: string;
|
|
280
321
|
activationMethod: ActivationMethod;
|
|
281
322
|
lastValidatedAt: Date;
|
|
282
323
|
license: {
|
|
283
324
|
status: LicenseStatus;
|
|
284
325
|
id: string;
|
|
326
|
+
productId: string;
|
|
327
|
+
ownerId: string;
|
|
285
328
|
activeNumberOfActivations: number;
|
|
286
329
|
maxNumberOfActivations: number;
|
|
330
|
+
offlineActivationsAllowed: boolean;
|
|
287
331
|
};
|
|
288
332
|
} | undefined;
|
|
289
333
|
trial?: {
|
|
290
334
|
status: TrialStatus;
|
|
291
335
|
id: string;
|
|
336
|
+
productId: string;
|
|
292
337
|
lastValidatedAt: Date;
|
|
338
|
+
deviceName: string;
|
|
339
|
+
deviceSignature: string;
|
|
293
340
|
expiresAt: Date;
|
|
294
341
|
ownerId?: string | undefined;
|
|
295
342
|
} | undefined;
|
|
@@ -330,7 +377,10 @@ declare class ActivationRequestEndpoints {
|
|
|
330
377
|
private api;
|
|
331
378
|
constructor(api: MoonbaseApi);
|
|
332
379
|
get(requestId: string): Promise<ActivationRequest>;
|
|
333
|
-
request(productId: string
|
|
380
|
+
request(productId: string, target: {
|
|
381
|
+
deviceName: string;
|
|
382
|
+
deviceSignature: string;
|
|
383
|
+
}): Promise<ActivationRequest>;
|
|
334
384
|
}
|
|
335
385
|
|
|
336
386
|
declare const customerSchema: z.ZodObject<{
|
|
@@ -432,65 +482,92 @@ declare class CustomerEndpoints {
|
|
|
432
482
|
|
|
433
483
|
declare const licenseSchema: z.ZodObject<{
|
|
434
484
|
id: z.ZodString;
|
|
485
|
+
productId: z.ZodString;
|
|
486
|
+
ownerId: z.ZodString;
|
|
435
487
|
status: z.ZodNativeEnum<typeof LicenseStatus>;
|
|
436
488
|
activeNumberOfActivations: z.ZodNumber;
|
|
437
489
|
maxNumberOfActivations: z.ZodNumber;
|
|
490
|
+
offlineActivationsAllowed: z.ZodBoolean;
|
|
438
491
|
}, "strip", z.ZodTypeAny, {
|
|
439
492
|
status: LicenseStatus;
|
|
440
493
|
id: string;
|
|
494
|
+
productId: string;
|
|
495
|
+
ownerId: string;
|
|
441
496
|
activeNumberOfActivations: number;
|
|
442
497
|
maxNumberOfActivations: number;
|
|
498
|
+
offlineActivationsAllowed: boolean;
|
|
443
499
|
}, {
|
|
444
500
|
status: LicenseStatus;
|
|
445
501
|
id: string;
|
|
502
|
+
productId: string;
|
|
503
|
+
ownerId: string;
|
|
446
504
|
activeNumberOfActivations: number;
|
|
447
505
|
maxNumberOfActivations: number;
|
|
506
|
+
offlineActivationsAllowed: boolean;
|
|
448
507
|
}>;
|
|
449
508
|
declare const licenseActivationSchema: z.ZodObject<{
|
|
450
509
|
id: z.ZodString;
|
|
451
510
|
name: z.ZodString;
|
|
511
|
+
signature: z.ZodString;
|
|
452
512
|
status: z.ZodNativeEnum<typeof ActivationStatus>;
|
|
453
513
|
activationMethod: z.ZodNativeEnum<typeof ActivationMethod>;
|
|
454
514
|
lastValidatedAt: z.ZodDate;
|
|
455
515
|
license: z.ZodObject<{
|
|
456
516
|
id: z.ZodString;
|
|
517
|
+
productId: z.ZodString;
|
|
518
|
+
ownerId: z.ZodString;
|
|
457
519
|
status: z.ZodNativeEnum<typeof LicenseStatus>;
|
|
458
520
|
activeNumberOfActivations: z.ZodNumber;
|
|
459
521
|
maxNumberOfActivations: z.ZodNumber;
|
|
522
|
+
offlineActivationsAllowed: z.ZodBoolean;
|
|
460
523
|
}, "strip", z.ZodTypeAny, {
|
|
461
524
|
status: LicenseStatus;
|
|
462
525
|
id: string;
|
|
526
|
+
productId: string;
|
|
527
|
+
ownerId: string;
|
|
463
528
|
activeNumberOfActivations: number;
|
|
464
529
|
maxNumberOfActivations: number;
|
|
530
|
+
offlineActivationsAllowed: boolean;
|
|
465
531
|
}, {
|
|
466
532
|
status: LicenseStatus;
|
|
467
533
|
id: string;
|
|
534
|
+
productId: string;
|
|
535
|
+
ownerId: string;
|
|
468
536
|
activeNumberOfActivations: number;
|
|
469
537
|
maxNumberOfActivations: number;
|
|
538
|
+
offlineActivationsAllowed: boolean;
|
|
470
539
|
}>;
|
|
471
540
|
}, "strip", z.ZodTypeAny, {
|
|
472
541
|
status: ActivationStatus;
|
|
473
542
|
id: string;
|
|
474
543
|
name: string;
|
|
544
|
+
signature: string;
|
|
475
545
|
activationMethod: ActivationMethod;
|
|
476
546
|
lastValidatedAt: Date;
|
|
477
547
|
license: {
|
|
478
548
|
status: LicenseStatus;
|
|
479
549
|
id: string;
|
|
550
|
+
productId: string;
|
|
551
|
+
ownerId: string;
|
|
480
552
|
activeNumberOfActivations: number;
|
|
481
553
|
maxNumberOfActivations: number;
|
|
554
|
+
offlineActivationsAllowed: boolean;
|
|
482
555
|
};
|
|
483
556
|
}, {
|
|
484
557
|
status: ActivationStatus;
|
|
485
558
|
id: string;
|
|
486
559
|
name: string;
|
|
560
|
+
signature: string;
|
|
487
561
|
activationMethod: ActivationMethod;
|
|
488
562
|
lastValidatedAt: Date;
|
|
489
563
|
license: {
|
|
490
564
|
status: LicenseStatus;
|
|
491
565
|
id: string;
|
|
566
|
+
productId: string;
|
|
567
|
+
ownerId: string;
|
|
492
568
|
activeNumberOfActivations: number;
|
|
493
569
|
maxNumberOfActivations: number;
|
|
570
|
+
offlineActivationsAllowed: boolean;
|
|
494
571
|
};
|
|
495
572
|
}>;
|
|
496
573
|
|
|
@@ -655,6 +732,9 @@ declare class ProductEndpoints {
|
|
|
655
732
|
|
|
656
733
|
declare const trialSchema: z.ZodObject<{
|
|
657
734
|
id: z.ZodString;
|
|
735
|
+
productId: z.ZodString;
|
|
736
|
+
deviceName: z.ZodString;
|
|
737
|
+
deviceSignature: z.ZodString;
|
|
658
738
|
status: z.ZodNativeEnum<typeof TrialStatus>;
|
|
659
739
|
expiresAt: z.ZodDate;
|
|
660
740
|
lastValidatedAt: z.ZodDate;
|
|
@@ -662,13 +742,19 @@ declare const trialSchema: z.ZodObject<{
|
|
|
662
742
|
}, "strip", z.ZodTypeAny, {
|
|
663
743
|
status: TrialStatus;
|
|
664
744
|
id: string;
|
|
745
|
+
productId: string;
|
|
665
746
|
lastValidatedAt: Date;
|
|
747
|
+
deviceName: string;
|
|
748
|
+
deviceSignature: string;
|
|
666
749
|
expiresAt: Date;
|
|
667
750
|
ownerId?: string | undefined;
|
|
668
751
|
}, {
|
|
669
752
|
status: TrialStatus;
|
|
670
753
|
id: string;
|
|
754
|
+
productId: string;
|
|
671
755
|
lastValidatedAt: Date;
|
|
756
|
+
deviceName: string;
|
|
757
|
+
deviceSignature: string;
|
|
672
758
|
expiresAt: Date;
|
|
673
759
|
ownerId?: string | undefined;
|
|
674
760
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ declare class MoonbaseApi {
|
|
|
15
15
|
|
|
16
16
|
declare const activationRequestSchema: z.ZodObject<{
|
|
17
17
|
id: z.ZodString;
|
|
18
|
+
deviceName: z.ZodString;
|
|
19
|
+
deviceSignature: z.ZodString;
|
|
18
20
|
status: z.ZodNativeEnum<typeof ActivationRequestStatus>;
|
|
19
21
|
product: z.ZodObject<{
|
|
20
22
|
id: z.ZodString;
|
|
@@ -50,52 +52,73 @@ declare const activationRequestSchema: z.ZodObject<{
|
|
|
50
52
|
activation: z.ZodOptional<z.ZodObject<{
|
|
51
53
|
id: z.ZodString;
|
|
52
54
|
name: z.ZodString;
|
|
55
|
+
signature: z.ZodString;
|
|
53
56
|
status: z.ZodNativeEnum<typeof ActivationStatus>;
|
|
54
57
|
activationMethod: z.ZodNativeEnum<typeof ActivationMethod>;
|
|
55
58
|
lastValidatedAt: z.ZodDate;
|
|
56
59
|
license: z.ZodObject<{
|
|
57
60
|
id: z.ZodString;
|
|
61
|
+
productId: z.ZodString;
|
|
62
|
+
ownerId: z.ZodString;
|
|
58
63
|
status: z.ZodNativeEnum<typeof LicenseStatus>;
|
|
59
64
|
activeNumberOfActivations: z.ZodNumber;
|
|
60
65
|
maxNumberOfActivations: z.ZodNumber;
|
|
66
|
+
offlineActivationsAllowed: z.ZodBoolean;
|
|
61
67
|
}, "strip", z.ZodTypeAny, {
|
|
62
68
|
status: LicenseStatus;
|
|
63
69
|
id: string;
|
|
70
|
+
productId: string;
|
|
71
|
+
ownerId: string;
|
|
64
72
|
activeNumberOfActivations: number;
|
|
65
73
|
maxNumberOfActivations: number;
|
|
74
|
+
offlineActivationsAllowed: boolean;
|
|
66
75
|
}, {
|
|
67
76
|
status: LicenseStatus;
|
|
68
77
|
id: string;
|
|
78
|
+
productId: string;
|
|
79
|
+
ownerId: string;
|
|
69
80
|
activeNumberOfActivations: number;
|
|
70
81
|
maxNumberOfActivations: number;
|
|
82
|
+
offlineActivationsAllowed: boolean;
|
|
71
83
|
}>;
|
|
72
84
|
}, "strip", z.ZodTypeAny, {
|
|
73
85
|
status: ActivationStatus;
|
|
74
86
|
id: string;
|
|
75
87
|
name: string;
|
|
88
|
+
signature: string;
|
|
76
89
|
activationMethod: ActivationMethod;
|
|
77
90
|
lastValidatedAt: Date;
|
|
78
91
|
license: {
|
|
79
92
|
status: LicenseStatus;
|
|
80
93
|
id: string;
|
|
94
|
+
productId: string;
|
|
95
|
+
ownerId: string;
|
|
81
96
|
activeNumberOfActivations: number;
|
|
82
97
|
maxNumberOfActivations: number;
|
|
98
|
+
offlineActivationsAllowed: boolean;
|
|
83
99
|
};
|
|
84
100
|
}, {
|
|
85
101
|
status: ActivationStatus;
|
|
86
102
|
id: string;
|
|
87
103
|
name: string;
|
|
104
|
+
signature: string;
|
|
88
105
|
activationMethod: ActivationMethod;
|
|
89
106
|
lastValidatedAt: Date;
|
|
90
107
|
license: {
|
|
91
108
|
status: LicenseStatus;
|
|
92
109
|
id: string;
|
|
110
|
+
productId: string;
|
|
111
|
+
ownerId: string;
|
|
93
112
|
activeNumberOfActivations: number;
|
|
94
113
|
maxNumberOfActivations: number;
|
|
114
|
+
offlineActivationsAllowed: boolean;
|
|
95
115
|
};
|
|
96
116
|
}>>;
|
|
97
117
|
trial: z.ZodOptional<z.ZodObject<{
|
|
98
118
|
id: z.ZodString;
|
|
119
|
+
productId: z.ZodString;
|
|
120
|
+
deviceName: z.ZodString;
|
|
121
|
+
deviceSignature: z.ZodString;
|
|
99
122
|
status: z.ZodNativeEnum<typeof TrialStatus>;
|
|
100
123
|
expiresAt: z.ZodDate;
|
|
101
124
|
lastValidatedAt: z.ZodDate;
|
|
@@ -103,13 +126,19 @@ declare const activationRequestSchema: z.ZodObject<{
|
|
|
103
126
|
}, "strip", z.ZodTypeAny, {
|
|
104
127
|
status: TrialStatus;
|
|
105
128
|
id: string;
|
|
129
|
+
productId: string;
|
|
106
130
|
lastValidatedAt: Date;
|
|
131
|
+
deviceName: string;
|
|
132
|
+
deviceSignature: string;
|
|
107
133
|
expiresAt: Date;
|
|
108
134
|
ownerId?: string | undefined;
|
|
109
135
|
}, {
|
|
110
136
|
status: TrialStatus;
|
|
111
137
|
id: string;
|
|
138
|
+
productId: string;
|
|
112
139
|
lastValidatedAt: Date;
|
|
140
|
+
deviceName: string;
|
|
141
|
+
deviceSignature: string;
|
|
113
142
|
expiresAt: Date;
|
|
114
143
|
ownerId?: string | undefined;
|
|
115
144
|
}>>;
|
|
@@ -204,6 +233,8 @@ declare const activationRequestSchema: z.ZodObject<{
|
|
|
204
233
|
}, "strip", z.ZodTypeAny, {
|
|
205
234
|
status: ActivationRequestStatus;
|
|
206
235
|
id: string;
|
|
236
|
+
deviceName: string;
|
|
237
|
+
deviceSignature: string;
|
|
207
238
|
product: {
|
|
208
239
|
status: ProductStatus;
|
|
209
240
|
id: string;
|
|
@@ -219,19 +250,26 @@ declare const activationRequestSchema: z.ZodObject<{
|
|
|
219
250
|
status: ActivationStatus;
|
|
220
251
|
id: string;
|
|
221
252
|
name: string;
|
|
253
|
+
signature: string;
|
|
222
254
|
activationMethod: ActivationMethod;
|
|
223
255
|
lastValidatedAt: Date;
|
|
224
256
|
license: {
|
|
225
257
|
status: LicenseStatus;
|
|
226
258
|
id: string;
|
|
259
|
+
productId: string;
|
|
260
|
+
ownerId: string;
|
|
227
261
|
activeNumberOfActivations: number;
|
|
228
262
|
maxNumberOfActivations: number;
|
|
263
|
+
offlineActivationsAllowed: boolean;
|
|
229
264
|
};
|
|
230
265
|
} | undefined;
|
|
231
266
|
trial?: {
|
|
232
267
|
status: TrialStatus;
|
|
233
268
|
id: string;
|
|
269
|
+
productId: string;
|
|
234
270
|
lastValidatedAt: Date;
|
|
271
|
+
deviceName: string;
|
|
272
|
+
deviceSignature: string;
|
|
235
273
|
expiresAt: Date;
|
|
236
274
|
ownerId?: string | undefined;
|
|
237
275
|
} | undefined;
|
|
@@ -262,6 +300,8 @@ declare const activationRequestSchema: z.ZodObject<{
|
|
|
262
300
|
}, {
|
|
263
301
|
status: ActivationRequestStatus;
|
|
264
302
|
id: string;
|
|
303
|
+
deviceName: string;
|
|
304
|
+
deviceSignature: string;
|
|
265
305
|
product: {
|
|
266
306
|
status: ProductStatus;
|
|
267
307
|
id: string;
|
|
@@ -277,19 +317,26 @@ declare const activationRequestSchema: z.ZodObject<{
|
|
|
277
317
|
status: ActivationStatus;
|
|
278
318
|
id: string;
|
|
279
319
|
name: string;
|
|
320
|
+
signature: string;
|
|
280
321
|
activationMethod: ActivationMethod;
|
|
281
322
|
lastValidatedAt: Date;
|
|
282
323
|
license: {
|
|
283
324
|
status: LicenseStatus;
|
|
284
325
|
id: string;
|
|
326
|
+
productId: string;
|
|
327
|
+
ownerId: string;
|
|
285
328
|
activeNumberOfActivations: number;
|
|
286
329
|
maxNumberOfActivations: number;
|
|
330
|
+
offlineActivationsAllowed: boolean;
|
|
287
331
|
};
|
|
288
332
|
} | undefined;
|
|
289
333
|
trial?: {
|
|
290
334
|
status: TrialStatus;
|
|
291
335
|
id: string;
|
|
336
|
+
productId: string;
|
|
292
337
|
lastValidatedAt: Date;
|
|
338
|
+
deviceName: string;
|
|
339
|
+
deviceSignature: string;
|
|
293
340
|
expiresAt: Date;
|
|
294
341
|
ownerId?: string | undefined;
|
|
295
342
|
} | undefined;
|
|
@@ -330,7 +377,10 @@ declare class ActivationRequestEndpoints {
|
|
|
330
377
|
private api;
|
|
331
378
|
constructor(api: MoonbaseApi);
|
|
332
379
|
get(requestId: string): Promise<ActivationRequest>;
|
|
333
|
-
request(productId: string
|
|
380
|
+
request(productId: string, target: {
|
|
381
|
+
deviceName: string;
|
|
382
|
+
deviceSignature: string;
|
|
383
|
+
}): Promise<ActivationRequest>;
|
|
334
384
|
}
|
|
335
385
|
|
|
336
386
|
declare const customerSchema: z.ZodObject<{
|
|
@@ -432,65 +482,92 @@ declare class CustomerEndpoints {
|
|
|
432
482
|
|
|
433
483
|
declare const licenseSchema: z.ZodObject<{
|
|
434
484
|
id: z.ZodString;
|
|
485
|
+
productId: z.ZodString;
|
|
486
|
+
ownerId: z.ZodString;
|
|
435
487
|
status: z.ZodNativeEnum<typeof LicenseStatus>;
|
|
436
488
|
activeNumberOfActivations: z.ZodNumber;
|
|
437
489
|
maxNumberOfActivations: z.ZodNumber;
|
|
490
|
+
offlineActivationsAllowed: z.ZodBoolean;
|
|
438
491
|
}, "strip", z.ZodTypeAny, {
|
|
439
492
|
status: LicenseStatus;
|
|
440
493
|
id: string;
|
|
494
|
+
productId: string;
|
|
495
|
+
ownerId: string;
|
|
441
496
|
activeNumberOfActivations: number;
|
|
442
497
|
maxNumberOfActivations: number;
|
|
498
|
+
offlineActivationsAllowed: boolean;
|
|
443
499
|
}, {
|
|
444
500
|
status: LicenseStatus;
|
|
445
501
|
id: string;
|
|
502
|
+
productId: string;
|
|
503
|
+
ownerId: string;
|
|
446
504
|
activeNumberOfActivations: number;
|
|
447
505
|
maxNumberOfActivations: number;
|
|
506
|
+
offlineActivationsAllowed: boolean;
|
|
448
507
|
}>;
|
|
449
508
|
declare const licenseActivationSchema: z.ZodObject<{
|
|
450
509
|
id: z.ZodString;
|
|
451
510
|
name: z.ZodString;
|
|
511
|
+
signature: z.ZodString;
|
|
452
512
|
status: z.ZodNativeEnum<typeof ActivationStatus>;
|
|
453
513
|
activationMethod: z.ZodNativeEnum<typeof ActivationMethod>;
|
|
454
514
|
lastValidatedAt: z.ZodDate;
|
|
455
515
|
license: z.ZodObject<{
|
|
456
516
|
id: z.ZodString;
|
|
517
|
+
productId: z.ZodString;
|
|
518
|
+
ownerId: z.ZodString;
|
|
457
519
|
status: z.ZodNativeEnum<typeof LicenseStatus>;
|
|
458
520
|
activeNumberOfActivations: z.ZodNumber;
|
|
459
521
|
maxNumberOfActivations: z.ZodNumber;
|
|
522
|
+
offlineActivationsAllowed: z.ZodBoolean;
|
|
460
523
|
}, "strip", z.ZodTypeAny, {
|
|
461
524
|
status: LicenseStatus;
|
|
462
525
|
id: string;
|
|
526
|
+
productId: string;
|
|
527
|
+
ownerId: string;
|
|
463
528
|
activeNumberOfActivations: number;
|
|
464
529
|
maxNumberOfActivations: number;
|
|
530
|
+
offlineActivationsAllowed: boolean;
|
|
465
531
|
}, {
|
|
466
532
|
status: LicenseStatus;
|
|
467
533
|
id: string;
|
|
534
|
+
productId: string;
|
|
535
|
+
ownerId: string;
|
|
468
536
|
activeNumberOfActivations: number;
|
|
469
537
|
maxNumberOfActivations: number;
|
|
538
|
+
offlineActivationsAllowed: boolean;
|
|
470
539
|
}>;
|
|
471
540
|
}, "strip", z.ZodTypeAny, {
|
|
472
541
|
status: ActivationStatus;
|
|
473
542
|
id: string;
|
|
474
543
|
name: string;
|
|
544
|
+
signature: string;
|
|
475
545
|
activationMethod: ActivationMethod;
|
|
476
546
|
lastValidatedAt: Date;
|
|
477
547
|
license: {
|
|
478
548
|
status: LicenseStatus;
|
|
479
549
|
id: string;
|
|
550
|
+
productId: string;
|
|
551
|
+
ownerId: string;
|
|
480
552
|
activeNumberOfActivations: number;
|
|
481
553
|
maxNumberOfActivations: number;
|
|
554
|
+
offlineActivationsAllowed: boolean;
|
|
482
555
|
};
|
|
483
556
|
}, {
|
|
484
557
|
status: ActivationStatus;
|
|
485
558
|
id: string;
|
|
486
559
|
name: string;
|
|
560
|
+
signature: string;
|
|
487
561
|
activationMethod: ActivationMethod;
|
|
488
562
|
lastValidatedAt: Date;
|
|
489
563
|
license: {
|
|
490
564
|
status: LicenseStatus;
|
|
491
565
|
id: string;
|
|
566
|
+
productId: string;
|
|
567
|
+
ownerId: string;
|
|
492
568
|
activeNumberOfActivations: number;
|
|
493
569
|
maxNumberOfActivations: number;
|
|
570
|
+
offlineActivationsAllowed: boolean;
|
|
494
571
|
};
|
|
495
572
|
}>;
|
|
496
573
|
|
|
@@ -655,6 +732,9 @@ declare class ProductEndpoints {
|
|
|
655
732
|
|
|
656
733
|
declare const trialSchema: z.ZodObject<{
|
|
657
734
|
id: z.ZodString;
|
|
735
|
+
productId: z.ZodString;
|
|
736
|
+
deviceName: z.ZodString;
|
|
737
|
+
deviceSignature: z.ZodString;
|
|
658
738
|
status: z.ZodNativeEnum<typeof TrialStatus>;
|
|
659
739
|
expiresAt: z.ZodDate;
|
|
660
740
|
lastValidatedAt: z.ZodDate;
|
|
@@ -662,13 +742,19 @@ declare const trialSchema: z.ZodObject<{
|
|
|
662
742
|
}, "strip", z.ZodTypeAny, {
|
|
663
743
|
status: TrialStatus;
|
|
664
744
|
id: string;
|
|
745
|
+
productId: string;
|
|
665
746
|
lastValidatedAt: Date;
|
|
747
|
+
deviceName: string;
|
|
748
|
+
deviceSignature: string;
|
|
666
749
|
expiresAt: Date;
|
|
667
750
|
ownerId?: string | undefined;
|
|
668
751
|
}, {
|
|
669
752
|
status: TrialStatus;
|
|
670
753
|
id: string;
|
|
754
|
+
productId: string;
|
|
671
755
|
lastValidatedAt: Date;
|
|
756
|
+
deviceName: string;
|
|
757
|
+
deviceSignature: string;
|
|
672
758
|
expiresAt: Date;
|
|
673
759
|
ownerId?: string | undefined;
|
|
674
760
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -54,13 +54,17 @@ var ActivationMethod = /* @__PURE__ */ ((ActivationMethod2) => {
|
|
|
54
54
|
// src/licenses/schemas.ts
|
|
55
55
|
var licenseSchema = z2.object({
|
|
56
56
|
id: z2.string(),
|
|
57
|
+
productId: z2.string(),
|
|
58
|
+
ownerId: z2.string(),
|
|
57
59
|
status: z2.nativeEnum(LicenseStatus),
|
|
58
60
|
activeNumberOfActivations: z2.number(),
|
|
59
|
-
maxNumberOfActivations: z2.number()
|
|
61
|
+
maxNumberOfActivations: z2.number(),
|
|
62
|
+
offlineActivationsAllowed: z2.boolean()
|
|
60
63
|
});
|
|
61
64
|
var licenseActivationSchema = z2.object({
|
|
62
65
|
id: z2.string(),
|
|
63
66
|
name: z2.string(),
|
|
67
|
+
signature: z2.string(),
|
|
64
68
|
status: z2.nativeEnum(ActivationStatus),
|
|
65
69
|
activationMethod: z2.nativeEnum(ActivationMethod),
|
|
66
70
|
lastValidatedAt: z2.coerce.date(),
|
|
@@ -103,6 +107,9 @@ var TrialStatus = /* @__PURE__ */ ((TrialStatus2) => {
|
|
|
103
107
|
// src/trials/schemas.ts
|
|
104
108
|
var trialSchema = z4.object({
|
|
105
109
|
id: z4.string(),
|
|
110
|
+
productId: z4.string(),
|
|
111
|
+
deviceName: z4.string(),
|
|
112
|
+
deviceSignature: z4.string(),
|
|
106
113
|
status: z4.nativeEnum(TrialStatus),
|
|
107
114
|
expiresAt: z4.coerce.date(),
|
|
108
115
|
lastValidatedAt: z4.coerce.date(),
|
|
@@ -120,6 +127,8 @@ var ActivationRequestStatus = /* @__PURE__ */ ((ActivationRequestStatus2) => {
|
|
|
120
127
|
// src/activationRequests/schemas.ts
|
|
121
128
|
var activationRequestSchema = z5.object({
|
|
122
129
|
id: z5.string(),
|
|
130
|
+
deviceName: z5.string(),
|
|
131
|
+
deviceSignature: z5.string(),
|
|
123
132
|
status: z5.nativeEnum(ActivationRequestStatus),
|
|
124
133
|
product: productSchema,
|
|
125
134
|
activation: licenseActivationSchema.optional(),
|
|
@@ -136,8 +145,8 @@ var ActivationRequestEndpoints = class {
|
|
|
136
145
|
const response = await this.api.fetch(`/api/activations/${requestId}`);
|
|
137
146
|
return activationRequestSchema.parse(response.data);
|
|
138
147
|
}
|
|
139
|
-
async request(productId) {
|
|
140
|
-
const response = await this.api.fetch(`/api/activations/${productId}/request
|
|
148
|
+
async request(productId, target) {
|
|
149
|
+
const response = await this.api.fetch(`/api/activations/${productId}/request`, "POST", target);
|
|
141
150
|
return activationRequestSchema.parse(response.data);
|
|
142
151
|
}
|
|
143
152
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/api",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.110",
|
|
5
5
|
"description": "Package to let you integrate backends with Moonbase.sh as payment and delivery provider",
|
|
6
6
|
"author": "Tobias Lønnerød Madsen <m@dsen.tv>",
|
|
7
7
|
"license": "MIT",
|