@moonbase.sh/storefront-api 0.2.30 → 0.2.32
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 +23 -1
- package/dist/index.d.cts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +28 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -41,6 +41,7 @@ __export(src_exports, {
|
|
|
41
41
|
NotFoundError: () => NotFoundError,
|
|
42
42
|
OrderStatus: () => OrderStatus,
|
|
43
43
|
Platform: () => Platform,
|
|
44
|
+
schemas: () => schemas_exports2,
|
|
44
45
|
utmToObject: () => utmToObject
|
|
45
46
|
});
|
|
46
47
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -234,18 +235,21 @@ var NotAuthorizedError = class extends Error {
|
|
|
234
235
|
constructor() {
|
|
235
236
|
super();
|
|
236
237
|
this.name = "NotAuthorizedError";
|
|
238
|
+
this.message = "Not allowed";
|
|
237
239
|
}
|
|
238
240
|
};
|
|
239
241
|
var NotAuthenticatedError = class extends Error {
|
|
240
242
|
constructor() {
|
|
241
243
|
super();
|
|
242
244
|
this.name = "NotAuthenticatedError";
|
|
245
|
+
this.message = "Not authenticated";
|
|
243
246
|
}
|
|
244
247
|
};
|
|
245
248
|
var NotFoundError = class extends Error {
|
|
246
|
-
constructor() {
|
|
249
|
+
constructor(message) {
|
|
247
250
|
super();
|
|
248
251
|
this.name = "NotFoundError";
|
|
252
|
+
this.message = message != null ? message : "Not found";
|
|
249
253
|
}
|
|
250
254
|
};
|
|
251
255
|
var MoonbaseError = class extends Error {
|
|
@@ -357,6 +361,8 @@ var IdentityEndpoints = class {
|
|
|
357
361
|
},
|
|
358
362
|
body: password
|
|
359
363
|
});
|
|
364
|
+
if (response.status === 404)
|
|
365
|
+
throw new NotFoundError("User not found");
|
|
360
366
|
if (response.status >= 400)
|
|
361
367
|
await handleResponseProblem(response);
|
|
362
368
|
const data = await response.json();
|
|
@@ -423,6 +429,15 @@ var IdentityEndpoints = class {
|
|
|
423
429
|
};
|
|
424
430
|
|
|
425
431
|
// src/orders/schemas.ts
|
|
432
|
+
var schemas_exports = {};
|
|
433
|
+
__export(schemas_exports, {
|
|
434
|
+
completedOrderSchema: () => completedOrderSchema,
|
|
435
|
+
openBundleLineItem: () => openBundleLineItem,
|
|
436
|
+
openOrderLineItem: () => openOrderLineItem,
|
|
437
|
+
openOrderSchema: () => openOrderSchema,
|
|
438
|
+
openProductLineItem: () => openProductLineItem,
|
|
439
|
+
orderSchema: () => orderSchema
|
|
440
|
+
});
|
|
426
441
|
var import_zod8 = require("zod");
|
|
427
442
|
|
|
428
443
|
// src/orders/models.ts
|
|
@@ -870,6 +885,12 @@ var InventoryEndpoints = class {
|
|
|
870
885
|
}
|
|
871
886
|
};
|
|
872
887
|
|
|
888
|
+
// src/schemas.ts
|
|
889
|
+
var schemas_exports2 = {};
|
|
890
|
+
__export(schemas_exports2, {
|
|
891
|
+
orders: () => schemas_exports
|
|
892
|
+
});
|
|
893
|
+
|
|
873
894
|
// src/index.ts
|
|
874
895
|
var MoonbaseClient = class {
|
|
875
896
|
constructor(configuration) {
|
|
@@ -898,5 +919,6 @@ var MoonbaseClient = class {
|
|
|
898
919
|
NotFoundError,
|
|
899
920
|
OrderStatus,
|
|
900
921
|
Platform,
|
|
922
|
+
schemas,
|
|
901
923
|
utmToObject
|
|
902
924
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -5521,6 +5521,16 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
|
5521
5521
|
};
|
|
5522
5522
|
}>]>;
|
|
5523
5523
|
|
|
5524
|
+
declare const schemas$1_completedOrderSchema: typeof completedOrderSchema;
|
|
5525
|
+
declare const schemas$1_openBundleLineItem: typeof openBundleLineItem;
|
|
5526
|
+
declare const schemas$1_openOrderLineItem: typeof openOrderLineItem;
|
|
5527
|
+
declare const schemas$1_openOrderSchema: typeof openOrderSchema;
|
|
5528
|
+
declare const schemas$1_openProductLineItem: typeof openProductLineItem;
|
|
5529
|
+
declare const schemas$1_orderSchema: typeof orderSchema;
|
|
5530
|
+
declare namespace schemas$1 {
|
|
5531
|
+
export { schemas$1_completedOrderSchema as completedOrderSchema, schemas$1_openBundleLineItem as openBundleLineItem, schemas$1_openOrderLineItem as openOrderLineItem, schemas$1_openOrderSchema as openOrderSchema, schemas$1_openProductLineItem as openProductLineItem, schemas$1_orderSchema as orderSchema };
|
|
5532
|
+
}
|
|
5533
|
+
|
|
5524
5534
|
declare enum OrderStatus {
|
|
5525
5535
|
Open = "Open",
|
|
5526
5536
|
PaymentProcessing = "PaymentProcessing",
|
|
@@ -10710,7 +10720,7 @@ declare class NotAuthenticatedError extends Error {
|
|
|
10710
10720
|
constructor();
|
|
10711
10721
|
}
|
|
10712
10722
|
declare class NotFoundError extends Error {
|
|
10713
|
-
constructor();
|
|
10723
|
+
constructor(message?: string);
|
|
10714
10724
|
}
|
|
10715
10725
|
declare class MoonbaseError extends Error {
|
|
10716
10726
|
readonly title: string;
|
|
@@ -10720,6 +10730,10 @@ declare class MoonbaseError extends Error {
|
|
|
10720
10730
|
constructor(title: string, detail: string | undefined, status: number, errors?: Record<string, string> | undefined);
|
|
10721
10731
|
}
|
|
10722
10732
|
|
|
10733
|
+
declare namespace schemas {
|
|
10734
|
+
export { schemas$1 as orders };
|
|
10735
|
+
}
|
|
10736
|
+
|
|
10723
10737
|
interface MoonbaseConfiguration {
|
|
10724
10738
|
endpoint: string;
|
|
10725
10739
|
}
|
|
@@ -10735,4 +10749,4 @@ declare class MoonbaseClient {
|
|
|
10735
10749
|
orders: OrderEndpoints;
|
|
10736
10750
|
}
|
|
10737
10751
|
|
|
10738
|
-
export { type Activation, ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Address, type BundleLineItem, type CommunicationPreferences, type CompletedOrder, type Discount, type Download, type License, LicenseStatus, type LineItem, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OpenOrder, type Order, OrderStatus, type OwnedProduct, type Page, Platform, type PricingVariation, type ProductLineItem, type Quantifiable, type Storefront, type StorefrontBundle, type StorefrontProduct, type UrchinTrackingModule, type User, type UserAccountConfirmed, type Voucher, utmToObject };
|
|
10752
|
+
export { type Activation, ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Address, type BundleLineItem, type CommunicationPreferences, type CompletedOrder, type Discount, type Download, type License, LicenseStatus, type LineItem, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OpenOrder, type Order, OrderStatus, type OwnedProduct, type Page, Platform, type PricingVariation, type ProductLineItem, type Quantifiable, type Storefront, type StorefrontBundle, type StorefrontProduct, type UrchinTrackingModule, type User, type UserAccountConfirmed, type Voucher, schemas, utmToObject };
|
package/dist/index.d.ts
CHANGED
|
@@ -5521,6 +5521,16 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
|
5521
5521
|
};
|
|
5522
5522
|
}>]>;
|
|
5523
5523
|
|
|
5524
|
+
declare const schemas$1_completedOrderSchema: typeof completedOrderSchema;
|
|
5525
|
+
declare const schemas$1_openBundleLineItem: typeof openBundleLineItem;
|
|
5526
|
+
declare const schemas$1_openOrderLineItem: typeof openOrderLineItem;
|
|
5527
|
+
declare const schemas$1_openOrderSchema: typeof openOrderSchema;
|
|
5528
|
+
declare const schemas$1_openProductLineItem: typeof openProductLineItem;
|
|
5529
|
+
declare const schemas$1_orderSchema: typeof orderSchema;
|
|
5530
|
+
declare namespace schemas$1 {
|
|
5531
|
+
export { schemas$1_completedOrderSchema as completedOrderSchema, schemas$1_openBundleLineItem as openBundleLineItem, schemas$1_openOrderLineItem as openOrderLineItem, schemas$1_openOrderSchema as openOrderSchema, schemas$1_openProductLineItem as openProductLineItem, schemas$1_orderSchema as orderSchema };
|
|
5532
|
+
}
|
|
5533
|
+
|
|
5524
5534
|
declare enum OrderStatus {
|
|
5525
5535
|
Open = "Open",
|
|
5526
5536
|
PaymentProcessing = "PaymentProcessing",
|
|
@@ -10710,7 +10720,7 @@ declare class NotAuthenticatedError extends Error {
|
|
|
10710
10720
|
constructor();
|
|
10711
10721
|
}
|
|
10712
10722
|
declare class NotFoundError extends Error {
|
|
10713
|
-
constructor();
|
|
10723
|
+
constructor(message?: string);
|
|
10714
10724
|
}
|
|
10715
10725
|
declare class MoonbaseError extends Error {
|
|
10716
10726
|
readonly title: string;
|
|
@@ -10720,6 +10730,10 @@ declare class MoonbaseError extends Error {
|
|
|
10720
10730
|
constructor(title: string, detail: string | undefined, status: number, errors?: Record<string, string> | undefined);
|
|
10721
10731
|
}
|
|
10722
10732
|
|
|
10733
|
+
declare namespace schemas {
|
|
10734
|
+
export { schemas$1 as orders };
|
|
10735
|
+
}
|
|
10736
|
+
|
|
10723
10737
|
interface MoonbaseConfiguration {
|
|
10724
10738
|
endpoint: string;
|
|
10725
10739
|
}
|
|
@@ -10735,4 +10749,4 @@ declare class MoonbaseClient {
|
|
|
10735
10749
|
orders: OrderEndpoints;
|
|
10736
10750
|
}
|
|
10737
10751
|
|
|
10738
|
-
export { type Activation, ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Address, type BundleLineItem, type CommunicationPreferences, type CompletedOrder, type Discount, type Download, type License, LicenseStatus, type LineItem, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OpenOrder, type Order, OrderStatus, type OwnedProduct, type Page, Platform, type PricingVariation, type ProductLineItem, type Quantifiable, type Storefront, type StorefrontBundle, type StorefrontProduct, type UrchinTrackingModule, type User, type UserAccountConfirmed, type Voucher, utmToObject };
|
|
10752
|
+
export { type Activation, ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Address, type BundleLineItem, type CommunicationPreferences, type CompletedOrder, type Discount, type Download, type License, LicenseStatus, type LineItem, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OpenOrder, type Order, OrderStatus, type OwnedProduct, type Page, Platform, type PricingVariation, type ProductLineItem, type Quantifiable, type Storefront, type StorefrontBundle, type StorefrontProduct, type UrchinTrackingModule, type User, type UserAccountConfirmed, type Voucher, schemas, utmToObject };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
1
7
|
// src/activationRequests/endpoints.ts
|
|
2
8
|
import { z as z5 } from "zod";
|
|
3
9
|
|
|
@@ -187,18 +193,21 @@ var NotAuthorizedError = class extends Error {
|
|
|
187
193
|
constructor() {
|
|
188
194
|
super();
|
|
189
195
|
this.name = "NotAuthorizedError";
|
|
196
|
+
this.message = "Not allowed";
|
|
190
197
|
}
|
|
191
198
|
};
|
|
192
199
|
var NotAuthenticatedError = class extends Error {
|
|
193
200
|
constructor() {
|
|
194
201
|
super();
|
|
195
202
|
this.name = "NotAuthenticatedError";
|
|
203
|
+
this.message = "Not authenticated";
|
|
196
204
|
}
|
|
197
205
|
};
|
|
198
206
|
var NotFoundError = class extends Error {
|
|
199
|
-
constructor() {
|
|
207
|
+
constructor(message) {
|
|
200
208
|
super();
|
|
201
209
|
this.name = "NotFoundError";
|
|
210
|
+
this.message = message != null ? message : "Not found";
|
|
202
211
|
}
|
|
203
212
|
};
|
|
204
213
|
var MoonbaseError = class extends Error {
|
|
@@ -310,6 +319,8 @@ var IdentityEndpoints = class {
|
|
|
310
319
|
},
|
|
311
320
|
body: password
|
|
312
321
|
});
|
|
322
|
+
if (response.status === 404)
|
|
323
|
+
throw new NotFoundError("User not found");
|
|
313
324
|
if (response.status >= 400)
|
|
314
325
|
await handleResponseProblem(response);
|
|
315
326
|
const data = await response.json();
|
|
@@ -376,6 +387,15 @@ var IdentityEndpoints = class {
|
|
|
376
387
|
};
|
|
377
388
|
|
|
378
389
|
// src/orders/schemas.ts
|
|
390
|
+
var schemas_exports = {};
|
|
391
|
+
__export(schemas_exports, {
|
|
392
|
+
completedOrderSchema: () => completedOrderSchema,
|
|
393
|
+
openBundleLineItem: () => openBundleLineItem,
|
|
394
|
+
openOrderLineItem: () => openOrderLineItem,
|
|
395
|
+
openOrderSchema: () => openOrderSchema,
|
|
396
|
+
openProductLineItem: () => openProductLineItem,
|
|
397
|
+
orderSchema: () => orderSchema
|
|
398
|
+
});
|
|
379
399
|
import { z as z8 } from "zod";
|
|
380
400
|
|
|
381
401
|
// src/orders/models.ts
|
|
@@ -823,6 +843,12 @@ var InventoryEndpoints = class {
|
|
|
823
843
|
}
|
|
824
844
|
};
|
|
825
845
|
|
|
846
|
+
// src/schemas.ts
|
|
847
|
+
var schemas_exports2 = {};
|
|
848
|
+
__export(schemas_exports2, {
|
|
849
|
+
orders: () => schemas_exports
|
|
850
|
+
});
|
|
851
|
+
|
|
826
852
|
// src/index.ts
|
|
827
853
|
var MoonbaseClient = class {
|
|
828
854
|
constructor(configuration) {
|
|
@@ -850,5 +876,6 @@ export {
|
|
|
850
876
|
NotFoundError,
|
|
851
877
|
OrderStatus,
|
|
852
878
|
Platform,
|
|
879
|
+
schemas_exports2 as schemas,
|
|
853
880
|
utmToObject
|
|
854
881
|
};
|
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.32",
|
|
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",
|