@moonbase.sh/storefront-api 0.2.35 → 0.2.36
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 +20 -20
- package/dist/index.js +20 -20
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -245,7 +245,7 @@ var ActivationRequestEndpoints = class {
|
|
|
245
245
|
try {
|
|
246
246
|
return activationRequestSchema.parse(response.data);
|
|
247
247
|
} catch (err) {
|
|
248
|
-
console.
|
|
248
|
+
console.warn("Could not fetch activation request", { requestId, response, err });
|
|
249
249
|
throw new MoonbaseError("Bad response", "Activation request could not be fetched", response.status);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
@@ -258,7 +258,7 @@ var ActivationRequestEndpoints = class {
|
|
|
258
258
|
try {
|
|
259
259
|
return activationRequestSchema.parse(response.data);
|
|
260
260
|
} catch (err) {
|
|
261
|
-
console.
|
|
261
|
+
console.warn("Could not fulfill license", { requestId, response, err });
|
|
262
262
|
throw new MoonbaseError("Bad response", "Activation request could not be fulfilled", response.status);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
@@ -267,7 +267,7 @@ var ActivationRequestEndpoints = class {
|
|
|
267
267
|
try {
|
|
268
268
|
return activationRequestSchema.parse(response.data);
|
|
269
269
|
} catch (err) {
|
|
270
|
-
console.
|
|
270
|
+
console.warn("Could not fulfill trial", { requestId, response, err });
|
|
271
271
|
throw new MoonbaseError("Bad response", "Activation request could not be fulfilled", response.status);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
@@ -276,7 +276,7 @@ var ActivationRequestEndpoints = class {
|
|
|
276
276
|
try {
|
|
277
277
|
return activationRequestSchema.parse(response.data);
|
|
278
278
|
} catch (err) {
|
|
279
|
-
console.
|
|
279
|
+
console.warn("Could not cancel activation request", { requestId, response, err });
|
|
280
280
|
throw new MoonbaseError("Bad response", "Activation request could not be cancelled", response.status);
|
|
281
281
|
}
|
|
282
282
|
}
|
|
@@ -314,7 +314,7 @@ async function handleResponseProblem(response) {
|
|
|
314
314
|
const json = await response.json();
|
|
315
315
|
problemDetails = problemDetailsSchema.parse(json);
|
|
316
316
|
} catch (err) {
|
|
317
|
-
console.
|
|
317
|
+
console.warn("Could not handle response", { response, err, content: await response.text() });
|
|
318
318
|
throw new Error("An unknown problem occurred");
|
|
319
319
|
}
|
|
320
320
|
throw new MoonbaseError(
|
|
@@ -370,7 +370,7 @@ var IdentityEndpoints = class {
|
|
|
370
370
|
try {
|
|
371
371
|
return userSchema.parse(response.data);
|
|
372
372
|
} catch (err) {
|
|
373
|
-
console.
|
|
373
|
+
console.warn("Could not fetch user", { response, err });
|
|
374
374
|
throw new MoonbaseError("Bad response", "Could not fetch user", response.status);
|
|
375
375
|
}
|
|
376
376
|
}
|
|
@@ -394,7 +394,7 @@ var IdentityEndpoints = class {
|
|
|
394
394
|
this.tokenStore.setUser(user);
|
|
395
395
|
return user;
|
|
396
396
|
} catch (err) {
|
|
397
|
-
console.
|
|
397
|
+
console.warn("Could not sign in user", { email, response, err });
|
|
398
398
|
throw new MoonbaseError("Bad response", "Could not sign in user", response.status);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
@@ -412,7 +412,7 @@ var IdentityEndpoints = class {
|
|
|
412
412
|
this.tokenStore.setUser(user);
|
|
413
413
|
return user;
|
|
414
414
|
} catch (err) {
|
|
415
|
-
console.
|
|
415
|
+
console.warn("Could not sign up user", { email, response, err });
|
|
416
416
|
throw new MoonbaseError("Bad response", "Could not sign up user", response.status);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
@@ -454,7 +454,7 @@ var IdentityEndpoints = class {
|
|
|
454
454
|
try {
|
|
455
455
|
return userAccountConfirmedSchema.parse(response.data);
|
|
456
456
|
} catch (err) {
|
|
457
|
-
console.
|
|
457
|
+
console.warn("Could not confirm user account", { email, code, response, err });
|
|
458
458
|
throw new MoonbaseError("Bad response", "Could not confirm user account", response.status);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
@@ -604,7 +604,7 @@ var OrderEndpoints = class {
|
|
|
604
604
|
try {
|
|
605
605
|
return openOrderSchema.parse(response.data);
|
|
606
606
|
} catch (err) {
|
|
607
|
-
console.
|
|
607
|
+
console.warn("Could not fetch order", { orderId: order.id, checkout, response, err });
|
|
608
608
|
throw new MoonbaseError("Bad response", "Could not fetch order", response.status);
|
|
609
609
|
}
|
|
610
610
|
}
|
|
@@ -636,7 +636,7 @@ var StorefrontEndpoints = class {
|
|
|
636
636
|
try {
|
|
637
637
|
return storefrontSchema.parse(response.data);
|
|
638
638
|
} catch (err) {
|
|
639
|
-
console.
|
|
639
|
+
console.warn("Could not fetch storefront", { response, err });
|
|
640
640
|
throw new MoonbaseError("Bad response", "Could not fetch storefront", response.status);
|
|
641
641
|
}
|
|
642
642
|
}
|
|
@@ -681,7 +681,7 @@ var MoonbaseApi = class {
|
|
|
681
681
|
status: response.status
|
|
682
682
|
};
|
|
683
683
|
} catch (err) {
|
|
684
|
-
console.
|
|
684
|
+
console.warn("Could not parse response", {
|
|
685
685
|
status: response.status,
|
|
686
686
|
content: await response.text(),
|
|
687
687
|
contentType: response.headers.get("Content-Type"),
|
|
@@ -828,7 +828,7 @@ var VoucherEndpoints = class {
|
|
|
828
828
|
try {
|
|
829
829
|
return voucherSchema.parse(response.data);
|
|
830
830
|
} catch (err) {
|
|
831
|
-
console.
|
|
831
|
+
console.warn("Could not redeem voucher", { response, err });
|
|
832
832
|
throw new MoonbaseError("Bad response", "Could not redeem voucher", response.status);
|
|
833
833
|
}
|
|
834
834
|
}
|
|
@@ -888,7 +888,7 @@ var ActivationEndpoints = class {
|
|
|
888
888
|
url: import_zod11.z.string().parse(response.headers.get("location"))
|
|
889
889
|
};
|
|
890
890
|
} catch (err) {
|
|
891
|
-
console.
|
|
891
|
+
console.warn("Could not activate product", { deviceToken, activationMethod, response, err });
|
|
892
892
|
throw new MoonbaseError("Bad response", "Product could not be activated", response.status);
|
|
893
893
|
}
|
|
894
894
|
}
|
|
@@ -904,7 +904,7 @@ var LicenseEndpoints = class {
|
|
|
904
904
|
try {
|
|
905
905
|
return paged(licenseSchema).parse(response.data);
|
|
906
906
|
} catch (err) {
|
|
907
|
-
console.
|
|
907
|
+
console.warn("Could not fetch licenses", { nextUrl, response, err });
|
|
908
908
|
throw new MoonbaseError("Bad response", "Licenses could not be fetched", response.status);
|
|
909
909
|
}
|
|
910
910
|
}
|
|
@@ -915,7 +915,7 @@ var LicenseEndpoints = class {
|
|
|
915
915
|
try {
|
|
916
916
|
return paged(activationSchema).parse(response.data);
|
|
917
917
|
} catch (err) {
|
|
918
|
-
console.
|
|
918
|
+
console.warn("Could not fetch license activations", { nextUrl, response, err });
|
|
919
919
|
throw new MoonbaseError("Bad response", "License activations could not be fetched", response.status);
|
|
920
920
|
}
|
|
921
921
|
}
|
|
@@ -935,7 +935,7 @@ var ProductEndpoints = class {
|
|
|
935
935
|
try {
|
|
936
936
|
return productSummarySchema.parse(response.data);
|
|
937
937
|
} catch (err) {
|
|
938
|
-
console.
|
|
938
|
+
console.warn("Could not fetch product", { productId, version, response, err });
|
|
939
939
|
throw new MoonbaseError("Bad response", "Product could not be fetched", response.status);
|
|
940
940
|
}
|
|
941
941
|
}
|
|
@@ -944,7 +944,7 @@ var ProductEndpoints = class {
|
|
|
944
944
|
try {
|
|
945
945
|
return paged(productSummarySchema).parse(response.data);
|
|
946
946
|
} catch (err) {
|
|
947
|
-
console.
|
|
947
|
+
console.warn("Could not fetch products", { nextUrl, response, err });
|
|
948
948
|
throw new MoonbaseError("Bad response", "Products could not be fetched", response.status);
|
|
949
949
|
}
|
|
950
950
|
}
|
|
@@ -953,7 +953,7 @@ var ProductEndpoints = class {
|
|
|
953
953
|
try {
|
|
954
954
|
return paged(licenseSchema).parse(response.data);
|
|
955
955
|
} catch (err) {
|
|
956
|
-
console.
|
|
956
|
+
console.warn("Could not fetch product licenses", { productId, nextUrl, response, err });
|
|
957
957
|
throw new MoonbaseError("Bad response", "Product licenses could not be fetched", response.status);
|
|
958
958
|
}
|
|
959
959
|
}
|
|
@@ -962,7 +962,7 @@ var ProductEndpoints = class {
|
|
|
962
962
|
try {
|
|
963
963
|
return paged(activationSchema).parse(response.data);
|
|
964
964
|
} catch (err) {
|
|
965
|
-
console.
|
|
965
|
+
console.warn("Could not fetch product activations", { productId, nextUrl, response, err });
|
|
966
966
|
throw new MoonbaseError("Bad response", "Product activations could not be fetched", response.status);
|
|
967
967
|
}
|
|
968
968
|
}
|
package/dist/index.js
CHANGED
|
@@ -203,7 +203,7 @@ var ActivationRequestEndpoints = class {
|
|
|
203
203
|
try {
|
|
204
204
|
return activationRequestSchema.parse(response.data);
|
|
205
205
|
} catch (err) {
|
|
206
|
-
console.
|
|
206
|
+
console.warn("Could not fetch activation request", { requestId, response, err });
|
|
207
207
|
throw new MoonbaseError("Bad response", "Activation request could not be fetched", response.status);
|
|
208
208
|
}
|
|
209
209
|
}
|
|
@@ -216,7 +216,7 @@ var ActivationRequestEndpoints = class {
|
|
|
216
216
|
try {
|
|
217
217
|
return activationRequestSchema.parse(response.data);
|
|
218
218
|
} catch (err) {
|
|
219
|
-
console.
|
|
219
|
+
console.warn("Could not fulfill license", { requestId, response, err });
|
|
220
220
|
throw new MoonbaseError("Bad response", "Activation request could not be fulfilled", response.status);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
@@ -225,7 +225,7 @@ var ActivationRequestEndpoints = class {
|
|
|
225
225
|
try {
|
|
226
226
|
return activationRequestSchema.parse(response.data);
|
|
227
227
|
} catch (err) {
|
|
228
|
-
console.
|
|
228
|
+
console.warn("Could not fulfill trial", { requestId, response, err });
|
|
229
229
|
throw new MoonbaseError("Bad response", "Activation request could not be fulfilled", response.status);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
@@ -234,7 +234,7 @@ var ActivationRequestEndpoints = class {
|
|
|
234
234
|
try {
|
|
235
235
|
return activationRequestSchema.parse(response.data);
|
|
236
236
|
} catch (err) {
|
|
237
|
-
console.
|
|
237
|
+
console.warn("Could not cancel activation request", { requestId, response, err });
|
|
238
238
|
throw new MoonbaseError("Bad response", "Activation request could not be cancelled", response.status);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
@@ -272,7 +272,7 @@ async function handleResponseProblem(response) {
|
|
|
272
272
|
const json = await response.json();
|
|
273
273
|
problemDetails = problemDetailsSchema.parse(json);
|
|
274
274
|
} catch (err) {
|
|
275
|
-
console.
|
|
275
|
+
console.warn("Could not handle response", { response, err, content: await response.text() });
|
|
276
276
|
throw new Error("An unknown problem occurred");
|
|
277
277
|
}
|
|
278
278
|
throw new MoonbaseError(
|
|
@@ -328,7 +328,7 @@ var IdentityEndpoints = class {
|
|
|
328
328
|
try {
|
|
329
329
|
return userSchema.parse(response.data);
|
|
330
330
|
} catch (err) {
|
|
331
|
-
console.
|
|
331
|
+
console.warn("Could not fetch user", { response, err });
|
|
332
332
|
throw new MoonbaseError("Bad response", "Could not fetch user", response.status);
|
|
333
333
|
}
|
|
334
334
|
}
|
|
@@ -352,7 +352,7 @@ var IdentityEndpoints = class {
|
|
|
352
352
|
this.tokenStore.setUser(user);
|
|
353
353
|
return user;
|
|
354
354
|
} catch (err) {
|
|
355
|
-
console.
|
|
355
|
+
console.warn("Could not sign in user", { email, response, err });
|
|
356
356
|
throw new MoonbaseError("Bad response", "Could not sign in user", response.status);
|
|
357
357
|
}
|
|
358
358
|
}
|
|
@@ -370,7 +370,7 @@ var IdentityEndpoints = class {
|
|
|
370
370
|
this.tokenStore.setUser(user);
|
|
371
371
|
return user;
|
|
372
372
|
} catch (err) {
|
|
373
|
-
console.
|
|
373
|
+
console.warn("Could not sign up user", { email, response, err });
|
|
374
374
|
throw new MoonbaseError("Bad response", "Could not sign up user", response.status);
|
|
375
375
|
}
|
|
376
376
|
}
|
|
@@ -412,7 +412,7 @@ var IdentityEndpoints = class {
|
|
|
412
412
|
try {
|
|
413
413
|
return userAccountConfirmedSchema.parse(response.data);
|
|
414
414
|
} catch (err) {
|
|
415
|
-
console.
|
|
415
|
+
console.warn("Could not confirm user account", { email, code, response, err });
|
|
416
416
|
throw new MoonbaseError("Bad response", "Could not confirm user account", response.status);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
@@ -562,7 +562,7 @@ var OrderEndpoints = class {
|
|
|
562
562
|
try {
|
|
563
563
|
return openOrderSchema.parse(response.data);
|
|
564
564
|
} catch (err) {
|
|
565
|
-
console.
|
|
565
|
+
console.warn("Could not fetch order", { orderId: order.id, checkout, response, err });
|
|
566
566
|
throw new MoonbaseError("Bad response", "Could not fetch order", response.status);
|
|
567
567
|
}
|
|
568
568
|
}
|
|
@@ -594,7 +594,7 @@ var StorefrontEndpoints = class {
|
|
|
594
594
|
try {
|
|
595
595
|
return storefrontSchema.parse(response.data);
|
|
596
596
|
} catch (err) {
|
|
597
|
-
console.
|
|
597
|
+
console.warn("Could not fetch storefront", { response, err });
|
|
598
598
|
throw new MoonbaseError("Bad response", "Could not fetch storefront", response.status);
|
|
599
599
|
}
|
|
600
600
|
}
|
|
@@ -639,7 +639,7 @@ var MoonbaseApi = class {
|
|
|
639
639
|
status: response.status
|
|
640
640
|
};
|
|
641
641
|
} catch (err) {
|
|
642
|
-
console.
|
|
642
|
+
console.warn("Could not parse response", {
|
|
643
643
|
status: response.status,
|
|
644
644
|
content: await response.text(),
|
|
645
645
|
contentType: response.headers.get("Content-Type"),
|
|
@@ -786,7 +786,7 @@ var VoucherEndpoints = class {
|
|
|
786
786
|
try {
|
|
787
787
|
return voucherSchema.parse(response.data);
|
|
788
788
|
} catch (err) {
|
|
789
|
-
console.
|
|
789
|
+
console.warn("Could not redeem voucher", { response, err });
|
|
790
790
|
throw new MoonbaseError("Bad response", "Could not redeem voucher", response.status);
|
|
791
791
|
}
|
|
792
792
|
}
|
|
@@ -846,7 +846,7 @@ var ActivationEndpoints = class {
|
|
|
846
846
|
url: z11.string().parse(response.headers.get("location"))
|
|
847
847
|
};
|
|
848
848
|
} catch (err) {
|
|
849
|
-
console.
|
|
849
|
+
console.warn("Could not activate product", { deviceToken, activationMethod, response, err });
|
|
850
850
|
throw new MoonbaseError("Bad response", "Product could not be activated", response.status);
|
|
851
851
|
}
|
|
852
852
|
}
|
|
@@ -862,7 +862,7 @@ var LicenseEndpoints = class {
|
|
|
862
862
|
try {
|
|
863
863
|
return paged(licenseSchema).parse(response.data);
|
|
864
864
|
} catch (err) {
|
|
865
|
-
console.
|
|
865
|
+
console.warn("Could not fetch licenses", { nextUrl, response, err });
|
|
866
866
|
throw new MoonbaseError("Bad response", "Licenses could not be fetched", response.status);
|
|
867
867
|
}
|
|
868
868
|
}
|
|
@@ -873,7 +873,7 @@ var LicenseEndpoints = class {
|
|
|
873
873
|
try {
|
|
874
874
|
return paged(activationSchema).parse(response.data);
|
|
875
875
|
} catch (err) {
|
|
876
|
-
console.
|
|
876
|
+
console.warn("Could not fetch license activations", { nextUrl, response, err });
|
|
877
877
|
throw new MoonbaseError("Bad response", "License activations could not be fetched", response.status);
|
|
878
878
|
}
|
|
879
879
|
}
|
|
@@ -893,7 +893,7 @@ var ProductEndpoints = class {
|
|
|
893
893
|
try {
|
|
894
894
|
return productSummarySchema.parse(response.data);
|
|
895
895
|
} catch (err) {
|
|
896
|
-
console.
|
|
896
|
+
console.warn("Could not fetch product", { productId, version, response, err });
|
|
897
897
|
throw new MoonbaseError("Bad response", "Product could not be fetched", response.status);
|
|
898
898
|
}
|
|
899
899
|
}
|
|
@@ -902,7 +902,7 @@ var ProductEndpoints = class {
|
|
|
902
902
|
try {
|
|
903
903
|
return paged(productSummarySchema).parse(response.data);
|
|
904
904
|
} catch (err) {
|
|
905
|
-
console.
|
|
905
|
+
console.warn("Could not fetch products", { nextUrl, response, err });
|
|
906
906
|
throw new MoonbaseError("Bad response", "Products could not be fetched", response.status);
|
|
907
907
|
}
|
|
908
908
|
}
|
|
@@ -911,7 +911,7 @@ var ProductEndpoints = class {
|
|
|
911
911
|
try {
|
|
912
912
|
return paged(licenseSchema).parse(response.data);
|
|
913
913
|
} catch (err) {
|
|
914
|
-
console.
|
|
914
|
+
console.warn("Could not fetch product licenses", { productId, nextUrl, response, err });
|
|
915
915
|
throw new MoonbaseError("Bad response", "Product licenses could not be fetched", response.status);
|
|
916
916
|
}
|
|
917
917
|
}
|
|
@@ -920,7 +920,7 @@ var ProductEndpoints = class {
|
|
|
920
920
|
try {
|
|
921
921
|
return paged(activationSchema).parse(response.data);
|
|
922
922
|
} catch (err) {
|
|
923
|
-
console.
|
|
923
|
+
console.warn("Could not fetch product activations", { productId, nextUrl, response, err });
|
|
924
924
|
throw new MoonbaseError("Bad response", "Product activations could not be fetched", response.status);
|
|
925
925
|
}
|
|
926
926
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/storefront-api",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.36",
|
|
5
5
|
"description": "Package to let you build storefronts with Moonbase.sh as payment and delivery provider",
|
|
6
6
|
"author": "Tobias Lønnerød Madsen <m@dsen.tv>",
|
|
7
7
|
"license": "MIT",
|