@moonbase.sh/storefront-api 0.4.43 → 0.4.45

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 CHANGED
@@ -55,7 +55,7 @@ __export(index_exports, {
55
55
  TokenStore: () => TokenStore,
56
56
  objectToQuery: () => objectToQuery,
57
57
  problemDetailsSchema: () => problemDetailsSchema,
58
- schemas: () => schemas_exports3,
58
+ schemas: () => schemas_exports11,
59
59
  utmToObject: () => utmToObject
60
60
  });
61
61
  module.exports = __toCommonJS(index_exports);
@@ -64,9 +64,21 @@ module.exports = __toCommonJS(index_exports);
64
64
  var import_zod5 = require("zod");
65
65
 
66
66
  // src/activationRequests/schemas.ts
67
+ var schemas_exports3 = {};
68
+ __export(schemas_exports3, {
69
+ activationRequestSchema: () => activationRequestSchema
70
+ });
67
71
  var import_zod4 = require("zod");
68
72
 
69
73
  // src/storefront/schemas.ts
74
+ var schemas_exports2 = {};
75
+ __export(schemas_exports2, {
76
+ offerConditionSchema: () => offerConditionSchema,
77
+ storefrontBundleSchema: () => storefrontBundleSchema,
78
+ storefrontOfferSchema: () => storefrontOfferSchema,
79
+ storefrontProductSchema: () => storefrontProductSchema,
80
+ storefrontSchema: () => storefrontSchema
81
+ });
70
82
  var import_zod3 = require("zod");
71
83
 
72
84
  // src/globalSchemas.ts
@@ -156,6 +168,12 @@ function quantifiable(itemSchema) {
156
168
  }
157
169
 
158
170
  // src/inventory/products/schemas.ts
171
+ var schemas_exports = {};
172
+ __export(schemas_exports, {
173
+ downloadSchema: () => downloadSchema,
174
+ manifestSchema: () => manifestSchema,
175
+ productSummarySchema: () => productSummarySchema
176
+ });
159
177
  var import_zod2 = require("zod");
160
178
 
161
179
  // src/inventory/products/models.ts
@@ -407,8 +425,8 @@ async function handleResponseProblem(response, logger) {
407
425
  }
408
426
 
409
427
  // src/identity/schemas.ts
410
- var schemas_exports = {};
411
- __export(schemas_exports, {
428
+ var schemas_exports4 = {};
429
+ __export(schemas_exports4, {
412
430
  addressSchema: () => addressSchema,
413
431
  communicationPreferencesSchema: () => communicationPreferencesSchema,
414
432
  identitySchema: () => identitySchema,
@@ -567,6 +585,11 @@ var IdentityEndpoints = class {
567
585
  var import_zod9 = require("zod");
568
586
 
569
587
  // src/inventory/licenses/schemas.ts
588
+ var schemas_exports5 = {};
589
+ __export(schemas_exports5, {
590
+ activationSchema: () => activationSchema,
591
+ licenseSchema: () => licenseSchema
592
+ });
570
593
  var import_zod8 = require("zod");
571
594
 
572
595
  // src/inventory/licenses/models.ts
@@ -811,6 +834,11 @@ var MoonbaseApi = class {
811
834
  var import_zod13 = require("zod");
812
835
 
813
836
  // src/inventory/subscriptions/schemas.ts
837
+ var schemas_exports7 = {};
838
+ __export(schemas_exports7, {
839
+ milestoneProgressSchema: () => milestoneProgressSchema,
840
+ subscriptionSchema: () => subscriptionSchema
841
+ });
814
842
  var import_zod12 = require("zod");
815
843
 
816
844
  // src/inventory/subscriptions/models.ts
@@ -823,8 +851,8 @@ var SubscriptionStatus = /* @__PURE__ */ ((SubscriptionStatus2) => {
823
851
  })(SubscriptionStatus || {});
824
852
 
825
853
  // src/orders/schemas.ts
826
- var schemas_exports2 = {};
827
- __export(schemas_exports2, {
854
+ var schemas_exports6 = {};
855
+ __export(schemas_exports6, {
828
856
  completedOrderSchema: () => completedOrderSchema,
829
857
  openBundleLineItem: () => openBundleLineItem,
830
858
  openOrderLineItem: () => openOrderLineItem,
@@ -1098,6 +1126,10 @@ var OrderEndpoints = class {
1098
1126
  const response = await this.api.fetch(`/api/customer/orders/${orderId}/billing-details`, openOrderSchema, { method: "DELETE" });
1099
1127
  return response.data;
1100
1128
  }
1129
+ async addCouponCode(orderId, code) {
1130
+ const response = await this.api.fetch(`/api/customer/orders/${orderId}/coupon?code=${encodeURIComponent(code)}`, openOrderSchema, { method: "PATCH" });
1131
+ return response.data;
1132
+ }
1101
1133
  };
1102
1134
 
1103
1135
  // src/storefront/endpoints.ts
@@ -1280,6 +1312,10 @@ _TokenStore.storageKey = "moonbase_auth";
1280
1312
  var TokenStore = _TokenStore;
1281
1313
 
1282
1314
  // src/vendor/schemas.ts
1315
+ var schemas_exports8 = {};
1316
+ __export(schemas_exports8, {
1317
+ vendorSchema: () => vendorSchema
1318
+ });
1283
1319
  var import_zod14 = require("zod");
1284
1320
  var vendorSchema = import_zod14.z.object({
1285
1321
  id: import_zod14.z.string(),
@@ -1299,6 +1335,10 @@ var VendorEndpoints = class {
1299
1335
  };
1300
1336
 
1301
1337
  // src/vouchers/schemas.ts
1338
+ var schemas_exports9 = {};
1339
+ __export(schemas_exports9, {
1340
+ voucherSchema: () => voucherSchema
1341
+ });
1302
1342
  var import_zod15 = require("zod");
1303
1343
  var voucherSchema = import_zod15.z.object({
1304
1344
  id: import_zod15.z.string(),
@@ -1358,10 +1398,23 @@ var ConsoleLogger = class {
1358
1398
  };
1359
1399
 
1360
1400
  // src/schemas.ts
1361
- var schemas_exports3 = {};
1362
- __export(schemas_exports3, {
1363
- identity: () => schemas_exports,
1364
- orders: () => schemas_exports2
1401
+ var schemas_exports11 = {};
1402
+ __export(schemas_exports11, {
1403
+ activationRequests: () => schemas_exports3,
1404
+ identity: () => schemas_exports4,
1405
+ inventory: () => schemas_exports10,
1406
+ orders: () => schemas_exports6,
1407
+ storefront: () => schemas_exports2,
1408
+ vendor: () => schemas_exports8,
1409
+ vouchers: () => schemas_exports9
1410
+ });
1411
+
1412
+ // src/inventory/schemas.ts
1413
+ var schemas_exports10 = {};
1414
+ __export(schemas_exports10, {
1415
+ licenses: () => schemas_exports5,
1416
+ products: () => schemas_exports,
1417
+ subscriptions: () => schemas_exports7
1365
1418
  });
1366
1419
 
1367
1420
  // src/utils/discount.ts
package/dist/index.d.cts CHANGED
@@ -866,6 +866,11 @@ declare const activationRequestSchema: z.ZodObject<{
866
866
  } | undefined;
867
867
  }>;
868
868
 
869
+ declare const schemas$a_activationRequestSchema: typeof activationRequestSchema;
870
+ declare namespace schemas$a {
871
+ export { schemas$a_activationRequestSchema as activationRequestSchema };
872
+ }
873
+
869
874
  declare enum ActivationRequestFulfillmentType {
870
875
  License = "License",
871
876
  Trial = "Trial"
@@ -1107,13 +1112,13 @@ declare const userAccountConfirmedSchema: z.ZodObject<{
1107
1112
  resetPasswordToken: string | null;
1108
1113
  }>;
1109
1114
 
1110
- declare const schemas$2_addressSchema: typeof addressSchema;
1111
- declare const schemas$2_communicationPreferencesSchema: typeof communicationPreferencesSchema;
1112
- declare const schemas$2_identitySchema: typeof identitySchema;
1113
- declare const schemas$2_userAccountConfirmedSchema: typeof userAccountConfirmedSchema;
1114
- declare const schemas$2_userSchema: typeof userSchema;
1115
- declare namespace schemas$2 {
1116
- export { schemas$2_addressSchema as addressSchema, schemas$2_communicationPreferencesSchema as communicationPreferencesSchema, schemas$2_identitySchema as identitySchema, schemas$2_userAccountConfirmedSchema as userAccountConfirmedSchema, schemas$2_userSchema as userSchema };
1115
+ declare const schemas$9_addressSchema: typeof addressSchema;
1116
+ declare const schemas$9_communicationPreferencesSchema: typeof communicationPreferencesSchema;
1117
+ declare const schemas$9_identitySchema: typeof identitySchema;
1118
+ declare const schemas$9_userAccountConfirmedSchema: typeof userAccountConfirmedSchema;
1119
+ declare const schemas$9_userSchema: typeof userSchema;
1120
+ declare namespace schemas$9 {
1121
+ export { schemas$9_addressSchema as addressSchema, schemas$9_communicationPreferencesSchema as communicationPreferencesSchema, schemas$9_identitySchema as identitySchema, schemas$9_userAccountConfirmedSchema as userAccountConfirmedSchema, schemas$9_userSchema as userSchema };
1117
1122
  }
1118
1123
 
1119
1124
  type CommunicationPreferences = z.infer<typeof communicationPreferencesSchema>;
@@ -1427,6 +1432,12 @@ declare const activationSchema: z.ZodObject<{
1427
1432
  lastValidatedAt: Date | null;
1428
1433
  }>;
1429
1434
 
1435
+ declare const schemas$8_activationSchema: typeof activationSchema;
1436
+ declare const schemas$8_licenseSchema: typeof licenseSchema;
1437
+ declare namespace schemas$8 {
1438
+ export { schemas$8_activationSchema as activationSchema, schemas$8_licenseSchema as licenseSchema };
1439
+ }
1440
+
1430
1441
  declare enum LicenseStatus {
1431
1442
  Active = "Active",
1432
1443
  Revoked = "Revoked"
@@ -1958,6 +1969,13 @@ declare const productSummarySchema: z.ZodObject<{
1958
1969
  }[] | undefined;
1959
1970
  }>;
1960
1971
 
1972
+ declare const schemas$7_downloadSchema: typeof downloadSchema;
1973
+ declare const schemas$7_manifestSchema: typeof manifestSchema;
1974
+ declare const schemas$7_productSummarySchema: typeof productSummarySchema;
1975
+ declare namespace schemas$7 {
1976
+ export { schemas$7_downloadSchema as downloadSchema, schemas$7_manifestSchema as manifestSchema, schemas$7_productSummarySchema as productSummarySchema };
1977
+ }
1978
+
1961
1979
  declare enum Platform {
1962
1980
  Universal = "Universal",
1963
1981
  Windows = "Windows",
@@ -5296,6 +5314,12 @@ declare const subscriptionSchema: z.ZodObject<{
5296
5314
  embeddedUpdatePaymentUrl?: string | undefined;
5297
5315
  }>;
5298
5316
 
5317
+ declare const schemas$6_milestoneProgressSchema: typeof milestoneProgressSchema;
5318
+ declare const schemas$6_subscriptionSchema: typeof subscriptionSchema;
5319
+ declare namespace schemas$6 {
5320
+ export { schemas$6_milestoneProgressSchema as milestoneProgressSchema, schemas$6_subscriptionSchema as subscriptionSchema };
5321
+ }
5322
+
5299
5323
  declare enum SubscriptionStatus {
5300
5324
  Active = "Active",
5301
5325
  Expired = "Expired",
@@ -18240,15 +18264,15 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
18240
18264
  };
18241
18265
  }>]>;
18242
18266
 
18243
- declare const schemas$1_completedOrderSchema: typeof completedOrderSchema;
18244
- declare const schemas$1_openBundleLineItem: typeof openBundleLineItem;
18245
- declare const schemas$1_openOrderLineItem: typeof openOrderLineItem;
18246
- declare const schemas$1_openOrderSchema: typeof openOrderSchema;
18247
- declare const schemas$1_openProductLineItem: typeof openProductLineItem;
18248
- declare const schemas$1_orderSchema: typeof orderSchema;
18249
- declare const schemas$1_orderTotalSchema: typeof orderTotalSchema;
18250
- declare namespace schemas$1 {
18251
- 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, schemas$1_orderTotalSchema as orderTotalSchema };
18267
+ declare const schemas$5_completedOrderSchema: typeof completedOrderSchema;
18268
+ declare const schemas$5_openBundleLineItem: typeof openBundleLineItem;
18269
+ declare const schemas$5_openOrderLineItem: typeof openOrderLineItem;
18270
+ declare const schemas$5_openOrderSchema: typeof openOrderSchema;
18271
+ declare const schemas$5_openProductLineItem: typeof openProductLineItem;
18272
+ declare const schemas$5_orderSchema: typeof orderSchema;
18273
+ declare const schemas$5_orderTotalSchema: typeof orderTotalSchema;
18274
+ declare namespace schemas$5 {
18275
+ export { schemas$5_completedOrderSchema as completedOrderSchema, schemas$5_openBundleLineItem as openBundleLineItem, schemas$5_openOrderLineItem as openOrderLineItem, schemas$5_openOrderSchema as openOrderSchema, schemas$5_openProductLineItem as openProductLineItem, schemas$5_orderSchema as orderSchema, schemas$5_orderTotalSchema as orderTotalSchema };
18252
18276
  }
18253
18277
 
18254
18278
  declare enum OrderStatus {
@@ -19376,6 +19400,7 @@ declare class OrderEndpoints {
19376
19400
  address?: Address | null;
19377
19401
  }): Promise<OpenOrder>;
19378
19402
  removeBillingDetails(orderId: string): Promise<OpenOrder>;
19403
+ addCouponCode(orderId: string, code: string): Promise<OpenOrder>;
19379
19404
  }
19380
19405
 
19381
19406
  declare class StorefrontEndpoints {
@@ -19958,6 +19983,11 @@ declare const vendorSchema: z.ZodObject<{
19958
19983
  logoUrl: string | null;
19959
19984
  }>;
19960
19985
 
19986
+ declare const schemas$4_vendorSchema: typeof vendorSchema;
19987
+ declare namespace schemas$4 {
19988
+ export { schemas$4_vendorSchema as vendorSchema };
19989
+ }
19990
+
19961
19991
  type Vendor = z.infer<typeof vendorSchema>;
19962
19992
 
19963
19993
  declare class VendorEndpoints {
@@ -22830,6 +22860,11 @@ declare const voucherSchema: z.ZodObject<{
22830
22860
  }[];
22831
22861
  }>;
22832
22862
 
22863
+ declare const schemas$3_voucherSchema: typeof voucherSchema;
22864
+ declare namespace schemas$3 {
22865
+ export { schemas$3_voucherSchema as voucherSchema };
22866
+ }
22867
+
22833
22868
  type Voucher = z.infer<typeof voucherSchema>;
22834
22869
 
22835
22870
  declare class VoucherEndpoints {
@@ -22860,8 +22895,8 @@ declare class InMemoryStore implements IStore {
22860
22895
  listen<TItem>(key: string, callback: (item: TItem | null) => void): void;
22861
22896
  }
22862
22897
 
22863
- declare namespace schemas {
22864
- export { schemas$2 as identity, schemas$1 as orders };
22898
+ declare namespace schemas$2 {
22899
+ export { schemas$8 as licenses, schemas$7 as products, schemas$6 as subscriptions };
22865
22900
  }
22866
22901
 
22867
22902
  declare const storefrontProductSchema: z.ZodObject<{
@@ -32296,6 +32331,19 @@ declare const storefrontSchema: z.ZodObject<{
32296
32331
  }[] | undefined;
32297
32332
  }>;
32298
32333
 
32334
+ declare const schemas$1_offerConditionSchema: typeof offerConditionSchema;
32335
+ declare const schemas$1_storefrontBundleSchema: typeof storefrontBundleSchema;
32336
+ declare const schemas$1_storefrontOfferSchema: typeof storefrontOfferSchema;
32337
+ declare const schemas$1_storefrontProductSchema: typeof storefrontProductSchema;
32338
+ declare const schemas$1_storefrontSchema: typeof storefrontSchema;
32339
+ declare namespace schemas$1 {
32340
+ export { schemas$1_offerConditionSchema as offerConditionSchema, schemas$1_storefrontBundleSchema as storefrontBundleSchema, schemas$1_storefrontOfferSchema as storefrontOfferSchema, schemas$1_storefrontProductSchema as storefrontProductSchema, schemas$1_storefrontSchema as storefrontSchema };
32341
+ }
32342
+
32343
+ declare namespace schemas {
32344
+ export { schemas$a as activationRequests, schemas$9 as identity, schemas$2 as inventory, schemas$5 as orders, schemas$1 as storefront, schemas$4 as vendor, schemas$3 as vouchers };
32345
+ }
32346
+
32299
32347
  type StorefrontProduct = z.infer<typeof storefrontProductSchema>;
32300
32348
  type StorefrontBundle = z.infer<typeof storefrontBundleSchema>;
32301
32349
  type OfferCondition = z.infer<typeof offerConditionSchema>;
package/dist/index.d.ts CHANGED
@@ -866,6 +866,11 @@ declare const activationRequestSchema: z.ZodObject<{
866
866
  } | undefined;
867
867
  }>;
868
868
 
869
+ declare const schemas$a_activationRequestSchema: typeof activationRequestSchema;
870
+ declare namespace schemas$a {
871
+ export { schemas$a_activationRequestSchema as activationRequestSchema };
872
+ }
873
+
869
874
  declare enum ActivationRequestFulfillmentType {
870
875
  License = "License",
871
876
  Trial = "Trial"
@@ -1107,13 +1112,13 @@ declare const userAccountConfirmedSchema: z.ZodObject<{
1107
1112
  resetPasswordToken: string | null;
1108
1113
  }>;
1109
1114
 
1110
- declare const schemas$2_addressSchema: typeof addressSchema;
1111
- declare const schemas$2_communicationPreferencesSchema: typeof communicationPreferencesSchema;
1112
- declare const schemas$2_identitySchema: typeof identitySchema;
1113
- declare const schemas$2_userAccountConfirmedSchema: typeof userAccountConfirmedSchema;
1114
- declare const schemas$2_userSchema: typeof userSchema;
1115
- declare namespace schemas$2 {
1116
- export { schemas$2_addressSchema as addressSchema, schemas$2_communicationPreferencesSchema as communicationPreferencesSchema, schemas$2_identitySchema as identitySchema, schemas$2_userAccountConfirmedSchema as userAccountConfirmedSchema, schemas$2_userSchema as userSchema };
1115
+ declare const schemas$9_addressSchema: typeof addressSchema;
1116
+ declare const schemas$9_communicationPreferencesSchema: typeof communicationPreferencesSchema;
1117
+ declare const schemas$9_identitySchema: typeof identitySchema;
1118
+ declare const schemas$9_userAccountConfirmedSchema: typeof userAccountConfirmedSchema;
1119
+ declare const schemas$9_userSchema: typeof userSchema;
1120
+ declare namespace schemas$9 {
1121
+ export { schemas$9_addressSchema as addressSchema, schemas$9_communicationPreferencesSchema as communicationPreferencesSchema, schemas$9_identitySchema as identitySchema, schemas$9_userAccountConfirmedSchema as userAccountConfirmedSchema, schemas$9_userSchema as userSchema };
1117
1122
  }
1118
1123
 
1119
1124
  type CommunicationPreferences = z.infer<typeof communicationPreferencesSchema>;
@@ -1427,6 +1432,12 @@ declare const activationSchema: z.ZodObject<{
1427
1432
  lastValidatedAt: Date | null;
1428
1433
  }>;
1429
1434
 
1435
+ declare const schemas$8_activationSchema: typeof activationSchema;
1436
+ declare const schemas$8_licenseSchema: typeof licenseSchema;
1437
+ declare namespace schemas$8 {
1438
+ export { schemas$8_activationSchema as activationSchema, schemas$8_licenseSchema as licenseSchema };
1439
+ }
1440
+
1430
1441
  declare enum LicenseStatus {
1431
1442
  Active = "Active",
1432
1443
  Revoked = "Revoked"
@@ -1958,6 +1969,13 @@ declare const productSummarySchema: z.ZodObject<{
1958
1969
  }[] | undefined;
1959
1970
  }>;
1960
1971
 
1972
+ declare const schemas$7_downloadSchema: typeof downloadSchema;
1973
+ declare const schemas$7_manifestSchema: typeof manifestSchema;
1974
+ declare const schemas$7_productSummarySchema: typeof productSummarySchema;
1975
+ declare namespace schemas$7 {
1976
+ export { schemas$7_downloadSchema as downloadSchema, schemas$7_manifestSchema as manifestSchema, schemas$7_productSummarySchema as productSummarySchema };
1977
+ }
1978
+
1961
1979
  declare enum Platform {
1962
1980
  Universal = "Universal",
1963
1981
  Windows = "Windows",
@@ -5296,6 +5314,12 @@ declare const subscriptionSchema: z.ZodObject<{
5296
5314
  embeddedUpdatePaymentUrl?: string | undefined;
5297
5315
  }>;
5298
5316
 
5317
+ declare const schemas$6_milestoneProgressSchema: typeof milestoneProgressSchema;
5318
+ declare const schemas$6_subscriptionSchema: typeof subscriptionSchema;
5319
+ declare namespace schemas$6 {
5320
+ export { schemas$6_milestoneProgressSchema as milestoneProgressSchema, schemas$6_subscriptionSchema as subscriptionSchema };
5321
+ }
5322
+
5299
5323
  declare enum SubscriptionStatus {
5300
5324
  Active = "Active",
5301
5325
  Expired = "Expired",
@@ -18240,15 +18264,15 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
18240
18264
  };
18241
18265
  }>]>;
18242
18266
 
18243
- declare const schemas$1_completedOrderSchema: typeof completedOrderSchema;
18244
- declare const schemas$1_openBundleLineItem: typeof openBundleLineItem;
18245
- declare const schemas$1_openOrderLineItem: typeof openOrderLineItem;
18246
- declare const schemas$1_openOrderSchema: typeof openOrderSchema;
18247
- declare const schemas$1_openProductLineItem: typeof openProductLineItem;
18248
- declare const schemas$1_orderSchema: typeof orderSchema;
18249
- declare const schemas$1_orderTotalSchema: typeof orderTotalSchema;
18250
- declare namespace schemas$1 {
18251
- 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, schemas$1_orderTotalSchema as orderTotalSchema };
18267
+ declare const schemas$5_completedOrderSchema: typeof completedOrderSchema;
18268
+ declare const schemas$5_openBundleLineItem: typeof openBundleLineItem;
18269
+ declare const schemas$5_openOrderLineItem: typeof openOrderLineItem;
18270
+ declare const schemas$5_openOrderSchema: typeof openOrderSchema;
18271
+ declare const schemas$5_openProductLineItem: typeof openProductLineItem;
18272
+ declare const schemas$5_orderSchema: typeof orderSchema;
18273
+ declare const schemas$5_orderTotalSchema: typeof orderTotalSchema;
18274
+ declare namespace schemas$5 {
18275
+ export { schemas$5_completedOrderSchema as completedOrderSchema, schemas$5_openBundleLineItem as openBundleLineItem, schemas$5_openOrderLineItem as openOrderLineItem, schemas$5_openOrderSchema as openOrderSchema, schemas$5_openProductLineItem as openProductLineItem, schemas$5_orderSchema as orderSchema, schemas$5_orderTotalSchema as orderTotalSchema };
18252
18276
  }
18253
18277
 
18254
18278
  declare enum OrderStatus {
@@ -19376,6 +19400,7 @@ declare class OrderEndpoints {
19376
19400
  address?: Address | null;
19377
19401
  }): Promise<OpenOrder>;
19378
19402
  removeBillingDetails(orderId: string): Promise<OpenOrder>;
19403
+ addCouponCode(orderId: string, code: string): Promise<OpenOrder>;
19379
19404
  }
19380
19405
 
19381
19406
  declare class StorefrontEndpoints {
@@ -19958,6 +19983,11 @@ declare const vendorSchema: z.ZodObject<{
19958
19983
  logoUrl: string | null;
19959
19984
  }>;
19960
19985
 
19986
+ declare const schemas$4_vendorSchema: typeof vendorSchema;
19987
+ declare namespace schemas$4 {
19988
+ export { schemas$4_vendorSchema as vendorSchema };
19989
+ }
19990
+
19961
19991
  type Vendor = z.infer<typeof vendorSchema>;
19962
19992
 
19963
19993
  declare class VendorEndpoints {
@@ -22830,6 +22860,11 @@ declare const voucherSchema: z.ZodObject<{
22830
22860
  }[];
22831
22861
  }>;
22832
22862
 
22863
+ declare const schemas$3_voucherSchema: typeof voucherSchema;
22864
+ declare namespace schemas$3 {
22865
+ export { schemas$3_voucherSchema as voucherSchema };
22866
+ }
22867
+
22833
22868
  type Voucher = z.infer<typeof voucherSchema>;
22834
22869
 
22835
22870
  declare class VoucherEndpoints {
@@ -22860,8 +22895,8 @@ declare class InMemoryStore implements IStore {
22860
22895
  listen<TItem>(key: string, callback: (item: TItem | null) => void): void;
22861
22896
  }
22862
22897
 
22863
- declare namespace schemas {
22864
- export { schemas$2 as identity, schemas$1 as orders };
22898
+ declare namespace schemas$2 {
22899
+ export { schemas$8 as licenses, schemas$7 as products, schemas$6 as subscriptions };
22865
22900
  }
22866
22901
 
22867
22902
  declare const storefrontProductSchema: z.ZodObject<{
@@ -32296,6 +32331,19 @@ declare const storefrontSchema: z.ZodObject<{
32296
32331
  }[] | undefined;
32297
32332
  }>;
32298
32333
 
32334
+ declare const schemas$1_offerConditionSchema: typeof offerConditionSchema;
32335
+ declare const schemas$1_storefrontBundleSchema: typeof storefrontBundleSchema;
32336
+ declare const schemas$1_storefrontOfferSchema: typeof storefrontOfferSchema;
32337
+ declare const schemas$1_storefrontProductSchema: typeof storefrontProductSchema;
32338
+ declare const schemas$1_storefrontSchema: typeof storefrontSchema;
32339
+ declare namespace schemas$1 {
32340
+ export { schemas$1_offerConditionSchema as offerConditionSchema, schemas$1_storefrontBundleSchema as storefrontBundleSchema, schemas$1_storefrontOfferSchema as storefrontOfferSchema, schemas$1_storefrontProductSchema as storefrontProductSchema, schemas$1_storefrontSchema as storefrontSchema };
32341
+ }
32342
+
32343
+ declare namespace schemas {
32344
+ export { schemas$a as activationRequests, schemas$9 as identity, schemas$2 as inventory, schemas$5 as orders, schemas$1 as storefront, schemas$4 as vendor, schemas$3 as vouchers };
32345
+ }
32346
+
32299
32347
  type StorefrontProduct = z.infer<typeof storefrontProductSchema>;
32300
32348
  type StorefrontBundle = z.infer<typeof storefrontBundleSchema>;
32301
32349
  type OfferCondition = z.infer<typeof offerConditionSchema>;
package/dist/index.js CHANGED
@@ -8,9 +8,21 @@ var __export = (target, all) => {
8
8
  import { z as z5 } from "zod";
9
9
 
10
10
  // src/activationRequests/schemas.ts
11
+ var schemas_exports3 = {};
12
+ __export(schemas_exports3, {
13
+ activationRequestSchema: () => activationRequestSchema
14
+ });
11
15
  import { z as z4 } from "zod";
12
16
 
13
17
  // src/storefront/schemas.ts
18
+ var schemas_exports2 = {};
19
+ __export(schemas_exports2, {
20
+ offerConditionSchema: () => offerConditionSchema,
21
+ storefrontBundleSchema: () => storefrontBundleSchema,
22
+ storefrontOfferSchema: () => storefrontOfferSchema,
23
+ storefrontProductSchema: () => storefrontProductSchema,
24
+ storefrontSchema: () => storefrontSchema
25
+ });
14
26
  import { z as z3 } from "zod";
15
27
 
16
28
  // src/globalSchemas.ts
@@ -100,6 +112,12 @@ function quantifiable(itemSchema) {
100
112
  }
101
113
 
102
114
  // src/inventory/products/schemas.ts
115
+ var schemas_exports = {};
116
+ __export(schemas_exports, {
117
+ downloadSchema: () => downloadSchema,
118
+ manifestSchema: () => manifestSchema,
119
+ productSummarySchema: () => productSummarySchema
120
+ });
103
121
  import { z as z2 } from "zod";
104
122
 
105
123
  // src/inventory/products/models.ts
@@ -351,8 +369,8 @@ async function handleResponseProblem(response, logger) {
351
369
  }
352
370
 
353
371
  // src/identity/schemas.ts
354
- var schemas_exports = {};
355
- __export(schemas_exports, {
372
+ var schemas_exports4 = {};
373
+ __export(schemas_exports4, {
356
374
  addressSchema: () => addressSchema,
357
375
  communicationPreferencesSchema: () => communicationPreferencesSchema,
358
376
  identitySchema: () => identitySchema,
@@ -511,6 +529,11 @@ var IdentityEndpoints = class {
511
529
  import { z as z9 } from "zod";
512
530
 
513
531
  // src/inventory/licenses/schemas.ts
532
+ var schemas_exports5 = {};
533
+ __export(schemas_exports5, {
534
+ activationSchema: () => activationSchema,
535
+ licenseSchema: () => licenseSchema
536
+ });
514
537
  import { z as z8 } from "zod";
515
538
 
516
539
  // src/inventory/licenses/models.ts
@@ -755,6 +778,11 @@ var MoonbaseApi = class {
755
778
  import { z as z13 } from "zod";
756
779
 
757
780
  // src/inventory/subscriptions/schemas.ts
781
+ var schemas_exports7 = {};
782
+ __export(schemas_exports7, {
783
+ milestoneProgressSchema: () => milestoneProgressSchema,
784
+ subscriptionSchema: () => subscriptionSchema
785
+ });
758
786
  import { z as z12 } from "zod";
759
787
 
760
788
  // src/inventory/subscriptions/models.ts
@@ -767,8 +795,8 @@ var SubscriptionStatus = /* @__PURE__ */ ((SubscriptionStatus2) => {
767
795
  })(SubscriptionStatus || {});
768
796
 
769
797
  // src/orders/schemas.ts
770
- var schemas_exports2 = {};
771
- __export(schemas_exports2, {
798
+ var schemas_exports6 = {};
799
+ __export(schemas_exports6, {
772
800
  completedOrderSchema: () => completedOrderSchema,
773
801
  openBundleLineItem: () => openBundleLineItem,
774
802
  openOrderLineItem: () => openOrderLineItem,
@@ -1042,6 +1070,10 @@ var OrderEndpoints = class {
1042
1070
  const response = await this.api.fetch(`/api/customer/orders/${orderId}/billing-details`, openOrderSchema, { method: "DELETE" });
1043
1071
  return response.data;
1044
1072
  }
1073
+ async addCouponCode(orderId, code) {
1074
+ const response = await this.api.fetch(`/api/customer/orders/${orderId}/coupon?code=${encodeURIComponent(code)}`, openOrderSchema, { method: "PATCH" });
1075
+ return response.data;
1076
+ }
1045
1077
  };
1046
1078
 
1047
1079
  // src/storefront/endpoints.ts
@@ -1224,6 +1256,10 @@ _TokenStore.storageKey = "moonbase_auth";
1224
1256
  var TokenStore = _TokenStore;
1225
1257
 
1226
1258
  // src/vendor/schemas.ts
1259
+ var schemas_exports8 = {};
1260
+ __export(schemas_exports8, {
1261
+ vendorSchema: () => vendorSchema
1262
+ });
1227
1263
  import { z as z14 } from "zod";
1228
1264
  var vendorSchema = z14.object({
1229
1265
  id: z14.string(),
@@ -1243,6 +1279,10 @@ var VendorEndpoints = class {
1243
1279
  };
1244
1280
 
1245
1281
  // src/vouchers/schemas.ts
1282
+ var schemas_exports9 = {};
1283
+ __export(schemas_exports9, {
1284
+ voucherSchema: () => voucherSchema
1285
+ });
1246
1286
  import { z as z15 } from "zod";
1247
1287
  var voucherSchema = z15.object({
1248
1288
  id: z15.string(),
@@ -1302,10 +1342,23 @@ var ConsoleLogger = class {
1302
1342
  };
1303
1343
 
1304
1344
  // src/schemas.ts
1305
- var schemas_exports3 = {};
1306
- __export(schemas_exports3, {
1307
- identity: () => schemas_exports,
1308
- orders: () => schemas_exports2
1345
+ var schemas_exports11 = {};
1346
+ __export(schemas_exports11, {
1347
+ activationRequests: () => schemas_exports3,
1348
+ identity: () => schemas_exports4,
1349
+ inventory: () => schemas_exports10,
1350
+ orders: () => schemas_exports6,
1351
+ storefront: () => schemas_exports2,
1352
+ vendor: () => schemas_exports8,
1353
+ vouchers: () => schemas_exports9
1354
+ });
1355
+
1356
+ // src/inventory/schemas.ts
1357
+ var schemas_exports10 = {};
1358
+ __export(schemas_exports10, {
1359
+ licenses: () => schemas_exports5,
1360
+ products: () => schemas_exports,
1361
+ subscriptions: () => schemas_exports7
1309
1362
  });
1310
1363
 
1311
1364
  // src/utils/discount.ts
@@ -1407,6 +1460,6 @@ export {
1407
1460
  TokenStore,
1408
1461
  objectToQuery,
1409
1462
  problemDetailsSchema,
1410
- schemas_exports3 as schemas,
1463
+ schemas_exports11 as schemas,
1411
1464
  utmToObject
1412
1465
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/storefront-api",
3
3
  "type": "module",
4
- "version": "0.4.43",
4
+ "version": "0.4.45",
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",