@moonbase.sh/storefront-api 0.4.19 → 0.4.23

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
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
30
  // src/index.ts
31
- var index_exports = {};
32
- __export(index_exports, {
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
33
  ActivationMethod: () => ActivationMethod,
34
34
  ActivationRequestFulfillmentType: () => ActivationRequestFulfillmentType,
35
35
  ActivationRequestStatus: () => ActivationRequestStatus,
@@ -54,7 +54,7 @@ __export(index_exports, {
54
54
  schemas: () => schemas_exports3,
55
55
  utmToObject: () => utmToObject
56
56
  });
57
- module.exports = __toCommonJS(index_exports);
57
+ module.exports = __toCommonJS(src_exports);
58
58
 
59
59
  // src/activationRequests/endpoints.ts
60
60
  var import_zod5 = require("zod");
@@ -416,6 +416,7 @@ var userSchema = import_zod7.z.object({
416
416
  communicationPreferences: communicationPreferencesSchema,
417
417
  ownedProducts: import_zod7.z.string().array().optional(),
418
418
  subscribedProducts: import_zod7.z.string().array().optional(),
419
+ confirmedAccount: import_zod7.z.boolean().optional(),
419
420
  hasProducts: import_zod7.z.boolean().nullish(),
420
421
  hasSubscriptions: import_zod7.z.boolean().nullish()
421
422
  });
@@ -906,6 +907,10 @@ var OrderEndpoints = class {
906
907
  );
907
908
  return response.data;
908
909
  }
910
+ async addBillingDetails(orderId, details) {
911
+ const response = await this.api.fetch(`/api/customer/orders/${orderId}/billing-details`, openOrderSchema, { method: "PATCH", body: details });
912
+ return response.data;
913
+ }
909
914
  async removeBillingDetails(orderId) {
910
915
  const response = await this.api.fetch(`/api/customer/orders/${orderId}/billing-details`, openOrderSchema, { method: "DELETE" });
911
916
  return response.data;
package/dist/index.d.cts CHANGED
@@ -952,6 +952,7 @@ declare const userSchema: z.ZodObject<{
952
952
  }>;
953
953
  ownedProducts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
954
954
  subscribedProducts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
955
+ confirmedAccount: z.ZodOptional<z.ZodBoolean>;
955
956
  hasProducts: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
956
957
  hasSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
957
958
  }, "strip", z.ZodTypeAny, {
@@ -972,6 +973,7 @@ declare const userSchema: z.ZodObject<{
972
973
  } | undefined;
973
974
  ownedProducts?: string[] | undefined;
974
975
  subscribedProducts?: string[] | undefined;
976
+ confirmedAccount?: boolean | undefined;
975
977
  hasProducts?: boolean | null | undefined;
976
978
  hasSubscriptions?: boolean | null | undefined;
977
979
  }, {
@@ -992,6 +994,7 @@ declare const userSchema: z.ZodObject<{
992
994
  } | undefined;
993
995
  ownedProducts?: string[] | undefined;
994
996
  subscribedProducts?: string[] | undefined;
997
+ confirmedAccount?: boolean | undefined;
995
998
  hasProducts?: boolean | null | undefined;
996
999
  hasSubscriptions?: boolean | null | undefined;
997
1000
  }>;
@@ -1031,6 +1034,7 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1031
1034
  }>;
1032
1035
  ownedProducts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1033
1036
  subscribedProducts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1037
+ confirmedAccount: z.ZodOptional<z.ZodBoolean>;
1034
1038
  hasProducts: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1035
1039
  hasSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1036
1040
  }, "strip", z.ZodTypeAny, {
@@ -1051,6 +1055,7 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1051
1055
  } | undefined;
1052
1056
  ownedProducts?: string[] | undefined;
1053
1057
  subscribedProducts?: string[] | undefined;
1058
+ confirmedAccount?: boolean | undefined;
1054
1059
  hasProducts?: boolean | null | undefined;
1055
1060
  hasSubscriptions?: boolean | null | undefined;
1056
1061
  }, {
@@ -1071,6 +1076,7 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1071
1076
  } | undefined;
1072
1077
  ownedProducts?: string[] | undefined;
1073
1078
  subscribedProducts?: string[] | undefined;
1079
+ confirmedAccount?: boolean | undefined;
1074
1080
  hasProducts?: boolean | null | undefined;
1075
1081
  hasSubscriptions?: boolean | null | undefined;
1076
1082
  }>, z.ZodObject<{
@@ -1144,6 +1150,7 @@ declare class IdentityEndpoints {
1144
1150
  } | undefined;
1145
1151
  ownedProducts?: string[] | undefined;
1146
1152
  subscribedProducts?: string[] | undefined;
1153
+ confirmedAccount?: boolean | undefined;
1147
1154
  hasProducts?: boolean | null | undefined;
1148
1155
  hasSubscriptions?: boolean | null | undefined;
1149
1156
  };
@@ -10169,7 +10176,7 @@ declare const completedOrderSchema: z.ZodObject<{
10169
10176
  taxId: string | null;
10170
10177
  };
10171
10178
  }>;
10172
- declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
10179
+ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.objectUtil.extendShape<{
10173
10180
  id: z.ZodString;
10174
10181
  currency: z.ZodString;
10175
10182
  total: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -11261,9 +11268,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
11261
11268
  }>, "many">;
11262
11269
  checkoutUrl: z.ZodOptional<z.ZodString>;
11263
11270
  embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
11264
- } & {
11271
+ }, {
11265
11272
  status: z.ZodLiteral<OrderStatus.Open>;
11266
- }, "strip", z.ZodTypeAny, {
11273
+ }>, "strip", z.ZodTypeAny, {
11267
11274
  id: string;
11268
11275
  status: OrderStatus.Open;
11269
11276
  currency: string;
@@ -11681,7 +11688,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
11681
11688
  } | null | undefined;
11682
11689
  checkoutUrl?: string | undefined;
11683
11690
  embeddedCheckoutUrl?: string | undefined;
11684
- }>, z.ZodObject<{
11691
+ }>, z.ZodObject<z.objectUtil.extendShape<{
11685
11692
  id: z.ZodString;
11686
11693
  currency: z.ZodString;
11687
11694
  total: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -12773,9 +12780,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
12773
12780
  }>, "many">;
12774
12781
  checkoutUrl: z.ZodOptional<z.ZodString>;
12775
12782
  embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
12776
- } & {
12783
+ }, {
12777
12784
  status: z.ZodLiteral<OrderStatus.PaymentProcessing>;
12778
- }, "strip", z.ZodTypeAny, {
12785
+ }>, "strip", z.ZodTypeAny, {
12779
12786
  id: string;
12780
12787
  status: OrderStatus.PaymentProcessing;
12781
12788
  currency: string;
@@ -13193,7 +13200,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
13193
13200
  } | null | undefined;
13194
13201
  checkoutUrl?: string | undefined;
13195
13202
  embeddedCheckoutUrl?: string | undefined;
13196
- }>, z.ZodObject<{
13203
+ }>, z.ZodObject<z.objectUtil.extendShape<{
13197
13204
  id: z.ZodString;
13198
13205
  currency: z.ZodString;
13199
13206
  total: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -14285,9 +14292,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
14285
14292
  }>, "many">;
14286
14293
  checkoutUrl: z.ZodOptional<z.ZodString>;
14287
14294
  embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
14288
- } & {
14295
+ }, {
14289
14296
  status: z.ZodLiteral<OrderStatus.Paid>;
14290
- }, "strip", z.ZodTypeAny, {
14297
+ }>, "strip", z.ZodTypeAny, {
14291
14298
  id: string;
14292
14299
  status: OrderStatus.Paid;
14293
14300
  currency: string;
@@ -14705,7 +14712,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
14705
14712
  } | null | undefined;
14706
14713
  checkoutUrl?: string | undefined;
14707
14714
  embeddedCheckoutUrl?: string | undefined;
14708
- }>, z.ZodObject<{
14715
+ }>, z.ZodObject<z.objectUtil.extendShape<{
14709
14716
  id: z.ZodString;
14710
14717
  currency: z.ZodString;
14711
14718
  total: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -15797,9 +15804,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
15797
15804
  }>, "many">;
15798
15805
  checkoutUrl: z.ZodOptional<z.ZodString>;
15799
15806
  embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
15800
- } & {
15807
+ }, {
15801
15808
  status: z.ZodLiteral<OrderStatus.Failed>;
15802
- }, "strip", z.ZodTypeAny, {
15809
+ }>, "strip", z.ZodTypeAny, {
15803
15810
  id: string;
15804
15811
  status: OrderStatus.Failed;
15805
15812
  currency: string;
@@ -18905,6 +18912,14 @@ declare class OrderEndpoints {
18905
18912
  }, checkout?: {
18906
18913
  returnUrl: string;
18907
18914
  }, utm?: UrchinTrackingModule): Promise<OpenOrder>;
18915
+ addBillingDetails(orderId: string, details: {
18916
+ name: string;
18917
+ email: string;
18918
+ businessName?: string | null;
18919
+ taxId?: string | null;
18920
+ phone?: string | null;
18921
+ address?: Address | null;
18922
+ }): Promise<OpenOrder>;
18908
18923
  removeBillingDetails(orderId: string): Promise<OpenOrder>;
18909
18924
  }
18910
18925
 
package/dist/index.d.ts CHANGED
@@ -952,6 +952,7 @@ declare const userSchema: z.ZodObject<{
952
952
  }>;
953
953
  ownedProducts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
954
954
  subscribedProducts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
955
+ confirmedAccount: z.ZodOptional<z.ZodBoolean>;
955
956
  hasProducts: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
956
957
  hasSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
957
958
  }, "strip", z.ZodTypeAny, {
@@ -972,6 +973,7 @@ declare const userSchema: z.ZodObject<{
972
973
  } | undefined;
973
974
  ownedProducts?: string[] | undefined;
974
975
  subscribedProducts?: string[] | undefined;
976
+ confirmedAccount?: boolean | undefined;
975
977
  hasProducts?: boolean | null | undefined;
976
978
  hasSubscriptions?: boolean | null | undefined;
977
979
  }, {
@@ -992,6 +994,7 @@ declare const userSchema: z.ZodObject<{
992
994
  } | undefined;
993
995
  ownedProducts?: string[] | undefined;
994
996
  subscribedProducts?: string[] | undefined;
997
+ confirmedAccount?: boolean | undefined;
995
998
  hasProducts?: boolean | null | undefined;
996
999
  hasSubscriptions?: boolean | null | undefined;
997
1000
  }>;
@@ -1031,6 +1034,7 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1031
1034
  }>;
1032
1035
  ownedProducts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1033
1036
  subscribedProducts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1037
+ confirmedAccount: z.ZodOptional<z.ZodBoolean>;
1034
1038
  hasProducts: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1035
1039
  hasSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1036
1040
  }, "strip", z.ZodTypeAny, {
@@ -1051,6 +1055,7 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1051
1055
  } | undefined;
1052
1056
  ownedProducts?: string[] | undefined;
1053
1057
  subscribedProducts?: string[] | undefined;
1058
+ confirmedAccount?: boolean | undefined;
1054
1059
  hasProducts?: boolean | null | undefined;
1055
1060
  hasSubscriptions?: boolean | null | undefined;
1056
1061
  }, {
@@ -1071,6 +1076,7 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1071
1076
  } | undefined;
1072
1077
  ownedProducts?: string[] | undefined;
1073
1078
  subscribedProducts?: string[] | undefined;
1079
+ confirmedAccount?: boolean | undefined;
1074
1080
  hasProducts?: boolean | null | undefined;
1075
1081
  hasSubscriptions?: boolean | null | undefined;
1076
1082
  }>, z.ZodObject<{
@@ -1144,6 +1150,7 @@ declare class IdentityEndpoints {
1144
1150
  } | undefined;
1145
1151
  ownedProducts?: string[] | undefined;
1146
1152
  subscribedProducts?: string[] | undefined;
1153
+ confirmedAccount?: boolean | undefined;
1147
1154
  hasProducts?: boolean | null | undefined;
1148
1155
  hasSubscriptions?: boolean | null | undefined;
1149
1156
  };
@@ -10169,7 +10176,7 @@ declare const completedOrderSchema: z.ZodObject<{
10169
10176
  taxId: string | null;
10170
10177
  };
10171
10178
  }>;
10172
- declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
10179
+ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.objectUtil.extendShape<{
10173
10180
  id: z.ZodString;
10174
10181
  currency: z.ZodString;
10175
10182
  total: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -11261,9 +11268,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
11261
11268
  }>, "many">;
11262
11269
  checkoutUrl: z.ZodOptional<z.ZodString>;
11263
11270
  embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
11264
- } & {
11271
+ }, {
11265
11272
  status: z.ZodLiteral<OrderStatus.Open>;
11266
- }, "strip", z.ZodTypeAny, {
11273
+ }>, "strip", z.ZodTypeAny, {
11267
11274
  id: string;
11268
11275
  status: OrderStatus.Open;
11269
11276
  currency: string;
@@ -11681,7 +11688,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
11681
11688
  } | null | undefined;
11682
11689
  checkoutUrl?: string | undefined;
11683
11690
  embeddedCheckoutUrl?: string | undefined;
11684
- }>, z.ZodObject<{
11691
+ }>, z.ZodObject<z.objectUtil.extendShape<{
11685
11692
  id: z.ZodString;
11686
11693
  currency: z.ZodString;
11687
11694
  total: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -12773,9 +12780,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
12773
12780
  }>, "many">;
12774
12781
  checkoutUrl: z.ZodOptional<z.ZodString>;
12775
12782
  embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
12776
- } & {
12783
+ }, {
12777
12784
  status: z.ZodLiteral<OrderStatus.PaymentProcessing>;
12778
- }, "strip", z.ZodTypeAny, {
12785
+ }>, "strip", z.ZodTypeAny, {
12779
12786
  id: string;
12780
12787
  status: OrderStatus.PaymentProcessing;
12781
12788
  currency: string;
@@ -13193,7 +13200,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
13193
13200
  } | null | undefined;
13194
13201
  checkoutUrl?: string | undefined;
13195
13202
  embeddedCheckoutUrl?: string | undefined;
13196
- }>, z.ZodObject<{
13203
+ }>, z.ZodObject<z.objectUtil.extendShape<{
13197
13204
  id: z.ZodString;
13198
13205
  currency: z.ZodString;
13199
13206
  total: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -14285,9 +14292,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
14285
14292
  }>, "many">;
14286
14293
  checkoutUrl: z.ZodOptional<z.ZodString>;
14287
14294
  embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
14288
- } & {
14295
+ }, {
14289
14296
  status: z.ZodLiteral<OrderStatus.Paid>;
14290
- }, "strip", z.ZodTypeAny, {
14297
+ }>, "strip", z.ZodTypeAny, {
14291
14298
  id: string;
14292
14299
  status: OrderStatus.Paid;
14293
14300
  currency: string;
@@ -14705,7 +14712,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
14705
14712
  } | null | undefined;
14706
14713
  checkoutUrl?: string | undefined;
14707
14714
  embeddedCheckoutUrl?: string | undefined;
14708
- }>, z.ZodObject<{
14715
+ }>, z.ZodObject<z.objectUtil.extendShape<{
14709
14716
  id: z.ZodString;
14710
14717
  currency: z.ZodString;
14711
14718
  total: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -15797,9 +15804,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
15797
15804
  }>, "many">;
15798
15805
  checkoutUrl: z.ZodOptional<z.ZodString>;
15799
15806
  embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
15800
- } & {
15807
+ }, {
15801
15808
  status: z.ZodLiteral<OrderStatus.Failed>;
15802
- }, "strip", z.ZodTypeAny, {
15809
+ }>, "strip", z.ZodTypeAny, {
15803
15810
  id: string;
15804
15811
  status: OrderStatus.Failed;
15805
15812
  currency: string;
@@ -18905,6 +18912,14 @@ declare class OrderEndpoints {
18905
18912
  }, checkout?: {
18906
18913
  returnUrl: string;
18907
18914
  }, utm?: UrchinTrackingModule): Promise<OpenOrder>;
18915
+ addBillingDetails(orderId: string, details: {
18916
+ name: string;
18917
+ email: string;
18918
+ businessName?: string | null;
18919
+ taxId?: string | null;
18920
+ phone?: string | null;
18921
+ address?: Address | null;
18922
+ }): Promise<OpenOrder>;
18908
18923
  removeBillingDetails(orderId: string): Promise<OpenOrder>;
18909
18924
  }
18910
18925
 
package/dist/index.js CHANGED
@@ -364,6 +364,7 @@ var userSchema = z7.object({
364
364
  communicationPreferences: communicationPreferencesSchema,
365
365
  ownedProducts: z7.string().array().optional(),
366
366
  subscribedProducts: z7.string().array().optional(),
367
+ confirmedAccount: z7.boolean().optional(),
367
368
  hasProducts: z7.boolean().nullish(),
368
369
  hasSubscriptions: z7.boolean().nullish()
369
370
  });
@@ -854,6 +855,10 @@ var OrderEndpoints = class {
854
855
  );
855
856
  return response.data;
856
857
  }
858
+ async addBillingDetails(orderId, details) {
859
+ const response = await this.api.fetch(`/api/customer/orders/${orderId}/billing-details`, openOrderSchema, { method: "PATCH", body: details });
860
+ return response.data;
861
+ }
857
862
  async removeBillingDetails(orderId) {
858
863
  const response = await this.api.fetch(`/api/customer/orders/${orderId}/billing-details`, openOrderSchema, { method: "DELETE" });
859
864
  return response.data;
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.19",
4
+ "version": "0.4.23",
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",