@moonbase.sh/storefront-api 1.0.6 → 1.0.15

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
@@ -24,6 +24,7 @@ __export(index_exports, {
24
24
  ActivationRequestFulfillmentType: () => ActivationRequestFulfillmentType,
25
25
  ActivationRequestStatus: () => ActivationRequestStatus,
26
26
  ActivationStatus: () => ActivationStatus,
27
+ ConnectableAccountProvider: () => ConnectableAccountProvider,
27
28
  ConsoleLogger: () => ConsoleLogger,
28
29
  CycleLength: () => CycleLength,
29
30
  DiscountUtils: () => DiscountUtils,
@@ -426,11 +427,22 @@ var schemas_exports4 = {};
426
427
  __export(schemas_exports4, {
427
428
  addressSchema: () => addressSchema,
428
429
  communicationPreferencesSchema: () => communicationPreferencesSchema,
430
+ connectedAccountSchema: () => connectedAccountSchema,
431
+ connectionUrlSchema: () => connectionUrlSchema,
429
432
  identitySchema: () => identitySchema,
433
+ ilokConnectedAccountSchema: () => ilokConnectedAccountSchema,
430
434
  userAccountConfirmedSchema: () => userAccountConfirmedSchema,
431
435
  userSchema: () => userSchema
432
436
  });
433
437
  var import_zod7 = require("zod");
438
+
439
+ // src/identity/models.ts
440
+ var ConnectableAccountProvider = /* @__PURE__ */ ((ConnectableAccountProvider2) => {
441
+ ConnectableAccountProvider2["ILok"] = "ILok";
442
+ return ConnectableAccountProvider2;
443
+ })(ConnectableAccountProvider || {});
444
+
445
+ // src/identity/schemas.ts
434
446
  var addressSchema = import_zod7.z.object({
435
447
  countryCode: import_zod7.z.string(),
436
448
  streetAddress1: import_zod7.z.string(),
@@ -443,18 +455,32 @@ var communicationPreferencesSchema = import_zod7.z.object({
443
455
  newsletterOptIn: import_zod7.z.boolean()
444
456
  // productUpdatesOptIn: z.boolean(), // TODO: Enable when relevant
445
457
  });
458
+ var ilokConnectedAccountSchema = import_zod7.z.object({
459
+ provider: import_zod7.z.literal("ILok" /* ILok */),
460
+ isConnected: import_zod7.z.boolean(),
461
+ pendingLicenseFulfillments: import_zod7.z.boolean(),
462
+ accountId: import_zod7.z.string().nullish()
463
+ });
464
+ var connectedAccountSchema = import_zod7.z.discriminatedUnion("provider", [
465
+ ilokConnectedAccountSchema
466
+ ]);
467
+ var connectionUrlSchema = import_zod7.z.object({
468
+ url: import_zod7.z.string()
469
+ });
446
470
  var userSchema = import_zod7.z.object({
447
471
  id: import_zod7.z.string(),
448
472
  email: import_zod7.z.string(),
449
473
  name: import_zod7.z.string(),
450
474
  tenantId: import_zod7.z.string(),
451
475
  address: addressSchema.optional(),
476
+ phone: import_zod7.z.string().optional(),
452
477
  communicationPreferences: communicationPreferencesSchema,
453
478
  ownedProducts: import_zod7.z.string().array().optional(),
454
479
  subscribedProducts: import_zod7.z.string().array().optional(),
455
480
  confirmedAccount: import_zod7.z.boolean().optional(),
456
481
  hasProducts: import_zod7.z.boolean().nullish(),
457
- hasSubscriptions: import_zod7.z.boolean().nullish()
482
+ hasSubscriptions: import_zod7.z.boolean().nullish(),
483
+ connectedAccounts: import_zod7.z.array(connectedAccountSchema).default([])
458
484
  });
459
485
  var identitySchema = userSchema.and(import_zod7.z.object({
460
486
  accessToken: import_zod7.z.string(),
@@ -576,6 +602,19 @@ var IdentityEndpoints = class {
576
602
  async confirmEmailChange(email, code) {
577
603
  await this.api.authenticatedFetch(`/api/customer/identity/confirm-email-change?email=${encodeURIComponent(email)}&code=${encodeURIComponent(code.replaceAll(" ", "+"))}`, null, { method: "POST" });
578
604
  }
605
+ async getConnectionUrl(provider, redirectUri, loginId) {
606
+ const params = new URLSearchParams({ redirectUri });
607
+ if (loginId)
608
+ params.set("loginId", loginId);
609
+ const response = await this.api.authenticatedFetch(
610
+ `/api/customer/connect/${provider}/authorize?${params.toString()}`,
611
+ connectionUrlSchema
612
+ );
613
+ return response.data.url;
614
+ }
615
+ async disconnectAccount(provider) {
616
+ await this.api.authenticatedFetch(`/api/customer/connect/${provider}`, null, { method: "DELETE" });
617
+ }
579
618
  };
580
619
 
581
620
  // src/inventory/activation/endpoints.ts
@@ -593,6 +632,7 @@ var import_zod8 = require("zod");
593
632
  // src/inventory/licenses/models.ts
594
633
  var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
595
634
  LicenseStatus2["Active"] = "Active";
635
+ LicenseStatus2["Pending"] = "Pending";
596
636
  LicenseStatus2["Revoked"] = "Revoked";
597
637
  return LicenseStatus2;
598
638
  })(LicenseStatus || {});
@@ -609,13 +649,20 @@ var ActivationMethod = /* @__PURE__ */ ((ActivationMethod2) => {
609
649
 
610
650
  // src/inventory/licenses/schemas.ts
611
651
  var externalLicenseFileContent = import_zod8.z.object({
652
+ type: import_zod8.z.literal("file"),
612
653
  fileName: import_zod8.z.string(),
613
654
  contentType: import_zod8.z.string(),
614
655
  data: import_zod8.z.string()
615
656
  });
657
+ var externalLicenseILokContent = import_zod8.z.object({
658
+ type: import_zod8.z.literal("iLok")
659
+ });
616
660
  var externalLicenseContent = import_zod8.z.union([
617
661
  import_zod8.z.string(),
618
- externalLicenseFileContent
662
+ import_zod8.z.discriminatedUnion("type", [
663
+ externalLicenseFileContent,
664
+ externalLicenseILokContent
665
+ ])
619
666
  ]);
620
667
  var licenseSchema = import_zod8.z.object({
621
668
  id: import_zod8.z.string(),
@@ -624,6 +671,7 @@ var licenseSchema = import_zod8.z.object({
624
671
  activeNumberOfActivations: import_zod8.z.number(),
625
672
  maxNumberOfActivations: import_zod8.z.number(),
626
673
  externalFulfillment: externalLicenseContent.optional(),
674
+ requiredConnectedAccount: import_zod8.z.nativeEnum(ConnectableAccountProvider).nullish(),
627
675
  fulfillmentMessage: import_zod8.z.string().optional(),
628
676
  expiresAt: import_zod8.z.coerce.date().optional(),
629
677
  createdAt: import_zod8.z.coerce.date()
@@ -1524,6 +1572,7 @@ var MoonbaseClient = class {
1524
1572
  ActivationRequestFulfillmentType,
1525
1573
  ActivationRequestStatus,
1526
1574
  ActivationStatus,
1575
+ ConnectableAccountProvider,
1527
1576
  ConsoleLogger,
1528
1577
  CycleLength,
1529
1578
  DiscountUtils,
package/dist/index.d.cts CHANGED
@@ -922,6 +922,45 @@ declare const communicationPreferencesSchema: z.ZodObject<{
922
922
  }, {
923
923
  newsletterOptIn: boolean;
924
924
  }>;
925
+ declare const ilokConnectedAccountSchema: z.ZodObject<{
926
+ provider: z.ZodLiteral<ConnectableAccountProvider>;
927
+ isConnected: z.ZodBoolean;
928
+ pendingLicenseFulfillments: z.ZodBoolean;
929
+ accountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
930
+ }, "strip", z.ZodTypeAny, {
931
+ provider: ConnectableAccountProvider;
932
+ isConnected: boolean;
933
+ pendingLicenseFulfillments: boolean;
934
+ accountId?: string | null | undefined;
935
+ }, {
936
+ provider: ConnectableAccountProvider;
937
+ isConnected: boolean;
938
+ pendingLicenseFulfillments: boolean;
939
+ accountId?: string | null | undefined;
940
+ }>;
941
+ declare const connectedAccountSchema: z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
942
+ provider: z.ZodLiteral<ConnectableAccountProvider>;
943
+ isConnected: z.ZodBoolean;
944
+ pendingLicenseFulfillments: z.ZodBoolean;
945
+ accountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
946
+ }, "strip", z.ZodTypeAny, {
947
+ provider: ConnectableAccountProvider;
948
+ isConnected: boolean;
949
+ pendingLicenseFulfillments: boolean;
950
+ accountId?: string | null | undefined;
951
+ }, {
952
+ provider: ConnectableAccountProvider;
953
+ isConnected: boolean;
954
+ pendingLicenseFulfillments: boolean;
955
+ accountId?: string | null | undefined;
956
+ }>]>;
957
+ declare const connectionUrlSchema: z.ZodObject<{
958
+ url: z.ZodString;
959
+ }, "strip", z.ZodTypeAny, {
960
+ url: string;
961
+ }, {
962
+ url: string;
963
+ }>;
925
964
  declare const userSchema: z.ZodObject<{
926
965
  id: z.ZodString;
927
966
  email: z.ZodString;
@@ -949,6 +988,7 @@ declare const userSchema: z.ZodObject<{
949
988
  region: string | null;
950
989
  postCode: string | null;
951
990
  }>>;
991
+ phone: z.ZodOptional<z.ZodString>;
952
992
  communicationPreferences: z.ZodObject<{
953
993
  newsletterOptIn: z.ZodBoolean;
954
994
  }, "strip", z.ZodTypeAny, {
@@ -961,6 +1001,22 @@ declare const userSchema: z.ZodObject<{
961
1001
  confirmedAccount: z.ZodOptional<z.ZodBoolean>;
962
1002
  hasProducts: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
963
1003
  hasSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1004
+ connectedAccounts: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
1005
+ provider: z.ZodLiteral<ConnectableAccountProvider>;
1006
+ isConnected: z.ZodBoolean;
1007
+ pendingLicenseFulfillments: z.ZodBoolean;
1008
+ accountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1009
+ }, "strip", z.ZodTypeAny, {
1010
+ provider: ConnectableAccountProvider;
1011
+ isConnected: boolean;
1012
+ pendingLicenseFulfillments: boolean;
1013
+ accountId?: string | null | undefined;
1014
+ }, {
1015
+ provider: ConnectableAccountProvider;
1016
+ isConnected: boolean;
1017
+ pendingLicenseFulfillments: boolean;
1018
+ accountId?: string | null | undefined;
1019
+ }>]>, "many">>;
964
1020
  }, "strip", z.ZodTypeAny, {
965
1021
  id: string;
966
1022
  email: string;
@@ -969,6 +1025,12 @@ declare const userSchema: z.ZodObject<{
969
1025
  communicationPreferences: {
970
1026
  newsletterOptIn: boolean;
971
1027
  };
1028
+ connectedAccounts: {
1029
+ provider: ConnectableAccountProvider;
1030
+ isConnected: boolean;
1031
+ pendingLicenseFulfillments: boolean;
1032
+ accountId?: string | null | undefined;
1033
+ }[];
972
1034
  address?: {
973
1035
  countryCode: string;
974
1036
  streetAddress1: string;
@@ -977,6 +1039,7 @@ declare const userSchema: z.ZodObject<{
977
1039
  region: string | null;
978
1040
  postCode: string | null;
979
1041
  } | undefined;
1042
+ phone?: string | undefined;
980
1043
  ownedProducts?: string[] | undefined;
981
1044
  subscribedProducts?: string[] | undefined;
982
1045
  confirmedAccount?: boolean | undefined;
@@ -998,11 +1061,18 @@ declare const userSchema: z.ZodObject<{
998
1061
  region: string | null;
999
1062
  postCode: string | null;
1000
1063
  } | undefined;
1064
+ phone?: string | undefined;
1001
1065
  ownedProducts?: string[] | undefined;
1002
1066
  subscribedProducts?: string[] | undefined;
1003
1067
  confirmedAccount?: boolean | undefined;
1004
1068
  hasProducts?: boolean | null | undefined;
1005
1069
  hasSubscriptions?: boolean | null | undefined;
1070
+ connectedAccounts?: {
1071
+ provider: ConnectableAccountProvider;
1072
+ isConnected: boolean;
1073
+ pendingLicenseFulfillments: boolean;
1074
+ accountId?: string | null | undefined;
1075
+ }[] | undefined;
1006
1076
  }>;
1007
1077
  declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1008
1078
  id: z.ZodString;
@@ -1031,6 +1101,7 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1031
1101
  region: string | null;
1032
1102
  postCode: string | null;
1033
1103
  }>>;
1104
+ phone: z.ZodOptional<z.ZodString>;
1034
1105
  communicationPreferences: z.ZodObject<{
1035
1106
  newsletterOptIn: z.ZodBoolean;
1036
1107
  }, "strip", z.ZodTypeAny, {
@@ -1043,6 +1114,22 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1043
1114
  confirmedAccount: z.ZodOptional<z.ZodBoolean>;
1044
1115
  hasProducts: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1045
1116
  hasSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1117
+ connectedAccounts: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
1118
+ provider: z.ZodLiteral<ConnectableAccountProvider>;
1119
+ isConnected: z.ZodBoolean;
1120
+ pendingLicenseFulfillments: z.ZodBoolean;
1121
+ accountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1122
+ }, "strip", z.ZodTypeAny, {
1123
+ provider: ConnectableAccountProvider;
1124
+ isConnected: boolean;
1125
+ pendingLicenseFulfillments: boolean;
1126
+ accountId?: string | null | undefined;
1127
+ }, {
1128
+ provider: ConnectableAccountProvider;
1129
+ isConnected: boolean;
1130
+ pendingLicenseFulfillments: boolean;
1131
+ accountId?: string | null | undefined;
1132
+ }>]>, "many">>;
1046
1133
  }, "strip", z.ZodTypeAny, {
1047
1134
  id: string;
1048
1135
  email: string;
@@ -1051,6 +1138,12 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1051
1138
  communicationPreferences: {
1052
1139
  newsletterOptIn: boolean;
1053
1140
  };
1141
+ connectedAccounts: {
1142
+ provider: ConnectableAccountProvider;
1143
+ isConnected: boolean;
1144
+ pendingLicenseFulfillments: boolean;
1145
+ accountId?: string | null | undefined;
1146
+ }[];
1054
1147
  address?: {
1055
1148
  countryCode: string;
1056
1149
  streetAddress1: string;
@@ -1059,6 +1152,7 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1059
1152
  region: string | null;
1060
1153
  postCode: string | null;
1061
1154
  } | undefined;
1155
+ phone?: string | undefined;
1062
1156
  ownedProducts?: string[] | undefined;
1063
1157
  subscribedProducts?: string[] | undefined;
1064
1158
  confirmedAccount?: boolean | undefined;
@@ -1080,11 +1174,18 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1080
1174
  region: string | null;
1081
1175
  postCode: string | null;
1082
1176
  } | undefined;
1177
+ phone?: string | undefined;
1083
1178
  ownedProducts?: string[] | undefined;
1084
1179
  subscribedProducts?: string[] | undefined;
1085
1180
  confirmedAccount?: boolean | undefined;
1086
1181
  hasProducts?: boolean | null | undefined;
1087
1182
  hasSubscriptions?: boolean | null | undefined;
1183
+ connectedAccounts?: {
1184
+ provider: ConnectableAccountProvider;
1185
+ isConnected: boolean;
1186
+ pendingLicenseFulfillments: boolean;
1187
+ accountId?: string | null | undefined;
1188
+ }[] | undefined;
1088
1189
  }>, z.ZodObject<{
1089
1190
  accessToken: z.ZodString;
1090
1191
  refreshToken: z.ZodString;
@@ -1114,14 +1215,21 @@ declare const userAccountConfirmedSchema: z.ZodObject<{
1114
1215
 
1115
1216
  declare const schemas$9_addressSchema: typeof addressSchema;
1116
1217
  declare const schemas$9_communicationPreferencesSchema: typeof communicationPreferencesSchema;
1218
+ declare const schemas$9_connectedAccountSchema: typeof connectedAccountSchema;
1219
+ declare const schemas$9_connectionUrlSchema: typeof connectionUrlSchema;
1117
1220
  declare const schemas$9_identitySchema: typeof identitySchema;
1221
+ declare const schemas$9_ilokConnectedAccountSchema: typeof ilokConnectedAccountSchema;
1118
1222
  declare const schemas$9_userAccountConfirmedSchema: typeof userAccountConfirmedSchema;
1119
1223
  declare const schemas$9_userSchema: typeof userSchema;
1120
1224
  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 };
1225
+ export { schemas$9_addressSchema as addressSchema, schemas$9_communicationPreferencesSchema as communicationPreferencesSchema, schemas$9_connectedAccountSchema as connectedAccountSchema, schemas$9_connectionUrlSchema as connectionUrlSchema, schemas$9_identitySchema as identitySchema, schemas$9_ilokConnectedAccountSchema as ilokConnectedAccountSchema, schemas$9_userAccountConfirmedSchema as userAccountConfirmedSchema, schemas$9_userSchema as userSchema };
1122
1226
  }
1123
1227
 
1124
1228
  type CommunicationPreferences = z.infer<typeof communicationPreferencesSchema>;
1229
+ declare enum ConnectableAccountProvider {
1230
+ ILok = "ILok"
1231
+ }
1232
+ type ConnectedAccount = z.infer<typeof connectedAccountSchema>;
1125
1233
  type User = z.infer<typeof userSchema>;
1126
1234
  type Identity = z.infer<typeof identitySchema>;
1127
1235
  type Address = z.infer<typeof addressSchema>;
@@ -1146,6 +1254,12 @@ declare class IdentityEndpoints {
1146
1254
  communicationPreferences: {
1147
1255
  newsletterOptIn: boolean;
1148
1256
  };
1257
+ connectedAccounts: {
1258
+ provider: ConnectableAccountProvider;
1259
+ isConnected: boolean;
1260
+ pendingLicenseFulfillments: boolean;
1261
+ accountId?: string | null | undefined;
1262
+ }[];
1149
1263
  address?: {
1150
1264
  countryCode: string;
1151
1265
  streetAddress1: string;
@@ -1154,6 +1268,7 @@ declare class IdentityEndpoints {
1154
1268
  region: string | null;
1155
1269
  postCode: string | null;
1156
1270
  } | undefined;
1271
+ phone?: string | undefined;
1157
1272
  ownedProducts?: string[] | undefined;
1158
1273
  subscribedProducts?: string[] | undefined;
1159
1274
  confirmedAccount?: boolean | undefined;
@@ -1167,21 +1282,32 @@ declare class IdentityEndpoints {
1167
1282
  confirmAccount(email: string, code: string): Promise<UserAccountConfirmed>;
1168
1283
  confirmEmail(email: string, code: string): Promise<void>;
1169
1284
  confirmEmailChange(email: string, code: string): Promise<void>;
1285
+ getConnectionUrl(provider: ConnectableAccountProvider, redirectUri: string, loginId?: string): Promise<string>;
1286
+ disconnectAccount(provider: ConnectableAccountProvider): Promise<void>;
1170
1287
  }
1171
1288
 
1172
- declare const externalLicenseContent: z.ZodUnion<[z.ZodString, z.ZodObject<{
1289
+ declare const externalLicenseContent: z.ZodUnion<[z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1290
+ type: z.ZodLiteral<"file">;
1173
1291
  fileName: z.ZodString;
1174
1292
  contentType: z.ZodString;
1175
1293
  data: z.ZodString;
1176
1294
  }, "strip", z.ZodTypeAny, {
1295
+ type: "file";
1177
1296
  data: string;
1178
1297
  fileName: string;
1179
1298
  contentType: string;
1180
1299
  }, {
1300
+ type: "file";
1181
1301
  data: string;
1182
1302
  fileName: string;
1183
1303
  contentType: string;
1184
- }>]>;
1304
+ }>, z.ZodObject<{
1305
+ type: z.ZodLiteral<"iLok">;
1306
+ }, "strip", z.ZodTypeAny, {
1307
+ type: "iLok";
1308
+ }, {
1309
+ type: "iLok";
1310
+ }>]>]>;
1185
1311
  type ExternalLicenseContent = z.infer<typeof externalLicenseContent>;
1186
1312
  declare const licenseSchema: z.ZodObject<{
1187
1313
  id: z.ZodString;
@@ -1332,19 +1458,29 @@ declare const licenseSchema: z.ZodObject<{
1332
1458
  }>;
1333
1459
  activeNumberOfActivations: z.ZodNumber;
1334
1460
  maxNumberOfActivations: z.ZodNumber;
1335
- externalFulfillment: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
1461
+ externalFulfillment: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1462
+ type: z.ZodLiteral<"file">;
1336
1463
  fileName: z.ZodString;
1337
1464
  contentType: z.ZodString;
1338
1465
  data: z.ZodString;
1339
1466
  }, "strip", z.ZodTypeAny, {
1467
+ type: "file";
1340
1468
  data: string;
1341
1469
  fileName: string;
1342
1470
  contentType: string;
1343
1471
  }, {
1472
+ type: "file";
1344
1473
  data: string;
1345
1474
  fileName: string;
1346
1475
  contentType: string;
1347
- }>]>>;
1476
+ }>, z.ZodObject<{
1477
+ type: z.ZodLiteral<"iLok">;
1478
+ }, "strip", z.ZodTypeAny, {
1479
+ type: "iLok";
1480
+ }, {
1481
+ type: "iLok";
1482
+ }>]>]>>;
1483
+ requiredConnectedAccount: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof ConnectableAccountProvider>>>;
1348
1484
  fulfillmentMessage: z.ZodOptional<z.ZodString>;
1349
1485
  expiresAt: z.ZodOptional<z.ZodDate>;
1350
1486
  createdAt: z.ZodDate;
@@ -1390,10 +1526,14 @@ declare const licenseSchema: z.ZodObject<{
1390
1526
  createdAt: Date;
1391
1527
  expiresAt?: Date | undefined;
1392
1528
  externalFulfillment?: string | {
1529
+ type: "file";
1393
1530
  data: string;
1394
1531
  fileName: string;
1395
1532
  contentType: string;
1533
+ } | {
1534
+ type: "iLok";
1396
1535
  } | undefined;
1536
+ requiredConnectedAccount?: ConnectableAccountProvider | null | undefined;
1397
1537
  fulfillmentMessage?: string | undefined;
1398
1538
  }, {
1399
1539
  id: string;
@@ -1437,10 +1577,14 @@ declare const licenseSchema: z.ZodObject<{
1437
1577
  createdAt: Date;
1438
1578
  expiresAt?: Date | undefined;
1439
1579
  externalFulfillment?: string | {
1580
+ type: "file";
1440
1581
  data: string;
1441
1582
  fileName: string;
1442
1583
  contentType: string;
1584
+ } | {
1585
+ type: "iLok";
1443
1586
  } | undefined;
1587
+ requiredConnectedAccount?: ConnectableAccountProvider | null | undefined;
1444
1588
  fulfillmentMessage?: string | undefined;
1445
1589
  }>;
1446
1590
  declare const activationSchema: z.ZodObject<{
@@ -1479,6 +1623,7 @@ declare namespace schemas$8 {
1479
1623
 
1480
1624
  declare enum LicenseStatus {
1481
1625
  Active = "Active",
1626
+ Pending = "Pending",
1482
1627
  Revoked = "Revoked"
1483
1628
  }
1484
1629
  declare enum ActivationStatus {
@@ -37828,4 +37973,4 @@ declare class MoonbaseClient {
37828
37973
  orders: OrderEndpoints;
37829
37974
  }
37830
37975
 
37831
- export { type Activation, ActivationMethod, type ActivationRequest, ActivationRequestFulfillmentType, ActivationRequestStatus, ActivationStatus, type Address, type BundleLineItem, type CommunicationPreferences, type CompletedOrder, ConsoleLogger, CycleLength, type Discount, DiscountUtils, type Download, type DownloadManifest, type ILogger, type IRecurrence, type IStore, type ITokenStore, type Identity, InMemoryStore, type License, LicenseStatus, type LineItem, LocalStorageStore, LogLevel, MarketingConsentType, type MilestoneProgress, type Money, type MoneyCollection, MoneyCollectionUtils, MoonbaseApi, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OfferCondition, OfferUtils, type OpenOrder, type Order, OrderStatus, type OwnedProduct, type Page, Platform, type PricingTier, type PricingVariation, type ProblemDetails, type ProductLineItem, type Quantifiable, type SingleOrMultiple, type Storefront, type StorefrontBundle, type StorefrontOffer, type StorefrontProduct, type Subscription, SubscriptionStatus, TokenStore, type UrchinTrackingModule, type User, type UserAccountConfirmed, type Vendor, type Voucher, objectToQuery, problemDetailsSchema, schemas, utmToObject };
37976
+ export { type Activation, ActivationMethod, type ActivationRequest, ActivationRequestFulfillmentType, ActivationRequestStatus, ActivationStatus, type Address, type BundleLineItem, type CommunicationPreferences, type CompletedOrder, ConnectableAccountProvider, type ConnectedAccount, ConsoleLogger, CycleLength, type Discount, DiscountUtils, type Download, type DownloadManifest, type ILogger, type IRecurrence, type IStore, type ITokenStore, type Identity, InMemoryStore, type License, LicenseStatus, type LineItem, LocalStorageStore, LogLevel, MarketingConsentType, type MilestoneProgress, type Money, type MoneyCollection, MoneyCollectionUtils, MoonbaseApi, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OfferCondition, OfferUtils, type OpenOrder, type Order, OrderStatus, type OwnedProduct, type Page, Platform, type PricingTier, type PricingVariation, type ProblemDetails, type ProductLineItem, type Quantifiable, type SingleOrMultiple, type Storefront, type StorefrontBundle, type StorefrontOffer, type StorefrontProduct, type Subscription, SubscriptionStatus, TokenStore, type UrchinTrackingModule, type User, type UserAccountConfirmed, type Vendor, type Voucher, objectToQuery, problemDetailsSchema, schemas, utmToObject };
package/dist/index.d.ts CHANGED
@@ -922,6 +922,45 @@ declare const communicationPreferencesSchema: z.ZodObject<{
922
922
  }, {
923
923
  newsletterOptIn: boolean;
924
924
  }>;
925
+ declare const ilokConnectedAccountSchema: z.ZodObject<{
926
+ provider: z.ZodLiteral<ConnectableAccountProvider>;
927
+ isConnected: z.ZodBoolean;
928
+ pendingLicenseFulfillments: z.ZodBoolean;
929
+ accountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
930
+ }, "strip", z.ZodTypeAny, {
931
+ provider: ConnectableAccountProvider;
932
+ isConnected: boolean;
933
+ pendingLicenseFulfillments: boolean;
934
+ accountId?: string | null | undefined;
935
+ }, {
936
+ provider: ConnectableAccountProvider;
937
+ isConnected: boolean;
938
+ pendingLicenseFulfillments: boolean;
939
+ accountId?: string | null | undefined;
940
+ }>;
941
+ declare const connectedAccountSchema: z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
942
+ provider: z.ZodLiteral<ConnectableAccountProvider>;
943
+ isConnected: z.ZodBoolean;
944
+ pendingLicenseFulfillments: z.ZodBoolean;
945
+ accountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
946
+ }, "strip", z.ZodTypeAny, {
947
+ provider: ConnectableAccountProvider;
948
+ isConnected: boolean;
949
+ pendingLicenseFulfillments: boolean;
950
+ accountId?: string | null | undefined;
951
+ }, {
952
+ provider: ConnectableAccountProvider;
953
+ isConnected: boolean;
954
+ pendingLicenseFulfillments: boolean;
955
+ accountId?: string | null | undefined;
956
+ }>]>;
957
+ declare const connectionUrlSchema: z.ZodObject<{
958
+ url: z.ZodString;
959
+ }, "strip", z.ZodTypeAny, {
960
+ url: string;
961
+ }, {
962
+ url: string;
963
+ }>;
925
964
  declare const userSchema: z.ZodObject<{
926
965
  id: z.ZodString;
927
966
  email: z.ZodString;
@@ -949,6 +988,7 @@ declare const userSchema: z.ZodObject<{
949
988
  region: string | null;
950
989
  postCode: string | null;
951
990
  }>>;
991
+ phone: z.ZodOptional<z.ZodString>;
952
992
  communicationPreferences: z.ZodObject<{
953
993
  newsletterOptIn: z.ZodBoolean;
954
994
  }, "strip", z.ZodTypeAny, {
@@ -961,6 +1001,22 @@ declare const userSchema: z.ZodObject<{
961
1001
  confirmedAccount: z.ZodOptional<z.ZodBoolean>;
962
1002
  hasProducts: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
963
1003
  hasSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1004
+ connectedAccounts: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
1005
+ provider: z.ZodLiteral<ConnectableAccountProvider>;
1006
+ isConnected: z.ZodBoolean;
1007
+ pendingLicenseFulfillments: z.ZodBoolean;
1008
+ accountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1009
+ }, "strip", z.ZodTypeAny, {
1010
+ provider: ConnectableAccountProvider;
1011
+ isConnected: boolean;
1012
+ pendingLicenseFulfillments: boolean;
1013
+ accountId?: string | null | undefined;
1014
+ }, {
1015
+ provider: ConnectableAccountProvider;
1016
+ isConnected: boolean;
1017
+ pendingLicenseFulfillments: boolean;
1018
+ accountId?: string | null | undefined;
1019
+ }>]>, "many">>;
964
1020
  }, "strip", z.ZodTypeAny, {
965
1021
  id: string;
966
1022
  email: string;
@@ -969,6 +1025,12 @@ declare const userSchema: z.ZodObject<{
969
1025
  communicationPreferences: {
970
1026
  newsletterOptIn: boolean;
971
1027
  };
1028
+ connectedAccounts: {
1029
+ provider: ConnectableAccountProvider;
1030
+ isConnected: boolean;
1031
+ pendingLicenseFulfillments: boolean;
1032
+ accountId?: string | null | undefined;
1033
+ }[];
972
1034
  address?: {
973
1035
  countryCode: string;
974
1036
  streetAddress1: string;
@@ -977,6 +1039,7 @@ declare const userSchema: z.ZodObject<{
977
1039
  region: string | null;
978
1040
  postCode: string | null;
979
1041
  } | undefined;
1042
+ phone?: string | undefined;
980
1043
  ownedProducts?: string[] | undefined;
981
1044
  subscribedProducts?: string[] | undefined;
982
1045
  confirmedAccount?: boolean | undefined;
@@ -998,11 +1061,18 @@ declare const userSchema: z.ZodObject<{
998
1061
  region: string | null;
999
1062
  postCode: string | null;
1000
1063
  } | undefined;
1064
+ phone?: string | undefined;
1001
1065
  ownedProducts?: string[] | undefined;
1002
1066
  subscribedProducts?: string[] | undefined;
1003
1067
  confirmedAccount?: boolean | undefined;
1004
1068
  hasProducts?: boolean | null | undefined;
1005
1069
  hasSubscriptions?: boolean | null | undefined;
1070
+ connectedAccounts?: {
1071
+ provider: ConnectableAccountProvider;
1072
+ isConnected: boolean;
1073
+ pendingLicenseFulfillments: boolean;
1074
+ accountId?: string | null | undefined;
1075
+ }[] | undefined;
1006
1076
  }>;
1007
1077
  declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1008
1078
  id: z.ZodString;
@@ -1031,6 +1101,7 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1031
1101
  region: string | null;
1032
1102
  postCode: string | null;
1033
1103
  }>>;
1104
+ phone: z.ZodOptional<z.ZodString>;
1034
1105
  communicationPreferences: z.ZodObject<{
1035
1106
  newsletterOptIn: z.ZodBoolean;
1036
1107
  }, "strip", z.ZodTypeAny, {
@@ -1043,6 +1114,22 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1043
1114
  confirmedAccount: z.ZodOptional<z.ZodBoolean>;
1044
1115
  hasProducts: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1045
1116
  hasSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1117
+ connectedAccounts: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
1118
+ provider: z.ZodLiteral<ConnectableAccountProvider>;
1119
+ isConnected: z.ZodBoolean;
1120
+ pendingLicenseFulfillments: z.ZodBoolean;
1121
+ accountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1122
+ }, "strip", z.ZodTypeAny, {
1123
+ provider: ConnectableAccountProvider;
1124
+ isConnected: boolean;
1125
+ pendingLicenseFulfillments: boolean;
1126
+ accountId?: string | null | undefined;
1127
+ }, {
1128
+ provider: ConnectableAccountProvider;
1129
+ isConnected: boolean;
1130
+ pendingLicenseFulfillments: boolean;
1131
+ accountId?: string | null | undefined;
1132
+ }>]>, "many">>;
1046
1133
  }, "strip", z.ZodTypeAny, {
1047
1134
  id: string;
1048
1135
  email: string;
@@ -1051,6 +1138,12 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1051
1138
  communicationPreferences: {
1052
1139
  newsletterOptIn: boolean;
1053
1140
  };
1141
+ connectedAccounts: {
1142
+ provider: ConnectableAccountProvider;
1143
+ isConnected: boolean;
1144
+ pendingLicenseFulfillments: boolean;
1145
+ accountId?: string | null | undefined;
1146
+ }[];
1054
1147
  address?: {
1055
1148
  countryCode: string;
1056
1149
  streetAddress1: string;
@@ -1059,6 +1152,7 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1059
1152
  region: string | null;
1060
1153
  postCode: string | null;
1061
1154
  } | undefined;
1155
+ phone?: string | undefined;
1062
1156
  ownedProducts?: string[] | undefined;
1063
1157
  subscribedProducts?: string[] | undefined;
1064
1158
  confirmedAccount?: boolean | undefined;
@@ -1080,11 +1174,18 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
1080
1174
  region: string | null;
1081
1175
  postCode: string | null;
1082
1176
  } | undefined;
1177
+ phone?: string | undefined;
1083
1178
  ownedProducts?: string[] | undefined;
1084
1179
  subscribedProducts?: string[] | undefined;
1085
1180
  confirmedAccount?: boolean | undefined;
1086
1181
  hasProducts?: boolean | null | undefined;
1087
1182
  hasSubscriptions?: boolean | null | undefined;
1183
+ connectedAccounts?: {
1184
+ provider: ConnectableAccountProvider;
1185
+ isConnected: boolean;
1186
+ pendingLicenseFulfillments: boolean;
1187
+ accountId?: string | null | undefined;
1188
+ }[] | undefined;
1088
1189
  }>, z.ZodObject<{
1089
1190
  accessToken: z.ZodString;
1090
1191
  refreshToken: z.ZodString;
@@ -1114,14 +1215,21 @@ declare const userAccountConfirmedSchema: z.ZodObject<{
1114
1215
 
1115
1216
  declare const schemas$9_addressSchema: typeof addressSchema;
1116
1217
  declare const schemas$9_communicationPreferencesSchema: typeof communicationPreferencesSchema;
1218
+ declare const schemas$9_connectedAccountSchema: typeof connectedAccountSchema;
1219
+ declare const schemas$9_connectionUrlSchema: typeof connectionUrlSchema;
1117
1220
  declare const schemas$9_identitySchema: typeof identitySchema;
1221
+ declare const schemas$9_ilokConnectedAccountSchema: typeof ilokConnectedAccountSchema;
1118
1222
  declare const schemas$9_userAccountConfirmedSchema: typeof userAccountConfirmedSchema;
1119
1223
  declare const schemas$9_userSchema: typeof userSchema;
1120
1224
  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 };
1225
+ export { schemas$9_addressSchema as addressSchema, schemas$9_communicationPreferencesSchema as communicationPreferencesSchema, schemas$9_connectedAccountSchema as connectedAccountSchema, schemas$9_connectionUrlSchema as connectionUrlSchema, schemas$9_identitySchema as identitySchema, schemas$9_ilokConnectedAccountSchema as ilokConnectedAccountSchema, schemas$9_userAccountConfirmedSchema as userAccountConfirmedSchema, schemas$9_userSchema as userSchema };
1122
1226
  }
1123
1227
 
1124
1228
  type CommunicationPreferences = z.infer<typeof communicationPreferencesSchema>;
1229
+ declare enum ConnectableAccountProvider {
1230
+ ILok = "ILok"
1231
+ }
1232
+ type ConnectedAccount = z.infer<typeof connectedAccountSchema>;
1125
1233
  type User = z.infer<typeof userSchema>;
1126
1234
  type Identity = z.infer<typeof identitySchema>;
1127
1235
  type Address = z.infer<typeof addressSchema>;
@@ -1146,6 +1254,12 @@ declare class IdentityEndpoints {
1146
1254
  communicationPreferences: {
1147
1255
  newsletterOptIn: boolean;
1148
1256
  };
1257
+ connectedAccounts: {
1258
+ provider: ConnectableAccountProvider;
1259
+ isConnected: boolean;
1260
+ pendingLicenseFulfillments: boolean;
1261
+ accountId?: string | null | undefined;
1262
+ }[];
1149
1263
  address?: {
1150
1264
  countryCode: string;
1151
1265
  streetAddress1: string;
@@ -1154,6 +1268,7 @@ declare class IdentityEndpoints {
1154
1268
  region: string | null;
1155
1269
  postCode: string | null;
1156
1270
  } | undefined;
1271
+ phone?: string | undefined;
1157
1272
  ownedProducts?: string[] | undefined;
1158
1273
  subscribedProducts?: string[] | undefined;
1159
1274
  confirmedAccount?: boolean | undefined;
@@ -1167,21 +1282,32 @@ declare class IdentityEndpoints {
1167
1282
  confirmAccount(email: string, code: string): Promise<UserAccountConfirmed>;
1168
1283
  confirmEmail(email: string, code: string): Promise<void>;
1169
1284
  confirmEmailChange(email: string, code: string): Promise<void>;
1285
+ getConnectionUrl(provider: ConnectableAccountProvider, redirectUri: string, loginId?: string): Promise<string>;
1286
+ disconnectAccount(provider: ConnectableAccountProvider): Promise<void>;
1170
1287
  }
1171
1288
 
1172
- declare const externalLicenseContent: z.ZodUnion<[z.ZodString, z.ZodObject<{
1289
+ declare const externalLicenseContent: z.ZodUnion<[z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1290
+ type: z.ZodLiteral<"file">;
1173
1291
  fileName: z.ZodString;
1174
1292
  contentType: z.ZodString;
1175
1293
  data: z.ZodString;
1176
1294
  }, "strip", z.ZodTypeAny, {
1295
+ type: "file";
1177
1296
  data: string;
1178
1297
  fileName: string;
1179
1298
  contentType: string;
1180
1299
  }, {
1300
+ type: "file";
1181
1301
  data: string;
1182
1302
  fileName: string;
1183
1303
  contentType: string;
1184
- }>]>;
1304
+ }>, z.ZodObject<{
1305
+ type: z.ZodLiteral<"iLok">;
1306
+ }, "strip", z.ZodTypeAny, {
1307
+ type: "iLok";
1308
+ }, {
1309
+ type: "iLok";
1310
+ }>]>]>;
1185
1311
  type ExternalLicenseContent = z.infer<typeof externalLicenseContent>;
1186
1312
  declare const licenseSchema: z.ZodObject<{
1187
1313
  id: z.ZodString;
@@ -1332,19 +1458,29 @@ declare const licenseSchema: z.ZodObject<{
1332
1458
  }>;
1333
1459
  activeNumberOfActivations: z.ZodNumber;
1334
1460
  maxNumberOfActivations: z.ZodNumber;
1335
- externalFulfillment: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
1461
+ externalFulfillment: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1462
+ type: z.ZodLiteral<"file">;
1336
1463
  fileName: z.ZodString;
1337
1464
  contentType: z.ZodString;
1338
1465
  data: z.ZodString;
1339
1466
  }, "strip", z.ZodTypeAny, {
1467
+ type: "file";
1340
1468
  data: string;
1341
1469
  fileName: string;
1342
1470
  contentType: string;
1343
1471
  }, {
1472
+ type: "file";
1344
1473
  data: string;
1345
1474
  fileName: string;
1346
1475
  contentType: string;
1347
- }>]>>;
1476
+ }>, z.ZodObject<{
1477
+ type: z.ZodLiteral<"iLok">;
1478
+ }, "strip", z.ZodTypeAny, {
1479
+ type: "iLok";
1480
+ }, {
1481
+ type: "iLok";
1482
+ }>]>]>>;
1483
+ requiredConnectedAccount: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof ConnectableAccountProvider>>>;
1348
1484
  fulfillmentMessage: z.ZodOptional<z.ZodString>;
1349
1485
  expiresAt: z.ZodOptional<z.ZodDate>;
1350
1486
  createdAt: z.ZodDate;
@@ -1390,10 +1526,14 @@ declare const licenseSchema: z.ZodObject<{
1390
1526
  createdAt: Date;
1391
1527
  expiresAt?: Date | undefined;
1392
1528
  externalFulfillment?: string | {
1529
+ type: "file";
1393
1530
  data: string;
1394
1531
  fileName: string;
1395
1532
  contentType: string;
1533
+ } | {
1534
+ type: "iLok";
1396
1535
  } | undefined;
1536
+ requiredConnectedAccount?: ConnectableAccountProvider | null | undefined;
1397
1537
  fulfillmentMessage?: string | undefined;
1398
1538
  }, {
1399
1539
  id: string;
@@ -1437,10 +1577,14 @@ declare const licenseSchema: z.ZodObject<{
1437
1577
  createdAt: Date;
1438
1578
  expiresAt?: Date | undefined;
1439
1579
  externalFulfillment?: string | {
1580
+ type: "file";
1440
1581
  data: string;
1441
1582
  fileName: string;
1442
1583
  contentType: string;
1584
+ } | {
1585
+ type: "iLok";
1443
1586
  } | undefined;
1587
+ requiredConnectedAccount?: ConnectableAccountProvider | null | undefined;
1444
1588
  fulfillmentMessage?: string | undefined;
1445
1589
  }>;
1446
1590
  declare const activationSchema: z.ZodObject<{
@@ -1479,6 +1623,7 @@ declare namespace schemas$8 {
1479
1623
 
1480
1624
  declare enum LicenseStatus {
1481
1625
  Active = "Active",
1626
+ Pending = "Pending",
1482
1627
  Revoked = "Revoked"
1483
1628
  }
1484
1629
  declare enum ActivationStatus {
@@ -37828,4 +37973,4 @@ declare class MoonbaseClient {
37828
37973
  orders: OrderEndpoints;
37829
37974
  }
37830
37975
 
37831
- export { type Activation, ActivationMethod, type ActivationRequest, ActivationRequestFulfillmentType, ActivationRequestStatus, ActivationStatus, type Address, type BundleLineItem, type CommunicationPreferences, type CompletedOrder, ConsoleLogger, CycleLength, type Discount, DiscountUtils, type Download, type DownloadManifest, type ILogger, type IRecurrence, type IStore, type ITokenStore, type Identity, InMemoryStore, type License, LicenseStatus, type LineItem, LocalStorageStore, LogLevel, MarketingConsentType, type MilestoneProgress, type Money, type MoneyCollection, MoneyCollectionUtils, MoonbaseApi, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OfferCondition, OfferUtils, type OpenOrder, type Order, OrderStatus, type OwnedProduct, type Page, Platform, type PricingTier, type PricingVariation, type ProblemDetails, type ProductLineItem, type Quantifiable, type SingleOrMultiple, type Storefront, type StorefrontBundle, type StorefrontOffer, type StorefrontProduct, type Subscription, SubscriptionStatus, TokenStore, type UrchinTrackingModule, type User, type UserAccountConfirmed, type Vendor, type Voucher, objectToQuery, problemDetailsSchema, schemas, utmToObject };
37976
+ export { type Activation, ActivationMethod, type ActivationRequest, ActivationRequestFulfillmentType, ActivationRequestStatus, ActivationStatus, type Address, type BundleLineItem, type CommunicationPreferences, type CompletedOrder, ConnectableAccountProvider, type ConnectedAccount, ConsoleLogger, CycleLength, type Discount, DiscountUtils, type Download, type DownloadManifest, type ILogger, type IRecurrence, type IStore, type ITokenStore, type Identity, InMemoryStore, type License, LicenseStatus, type LineItem, LocalStorageStore, LogLevel, MarketingConsentType, type MilestoneProgress, type Money, type MoneyCollection, MoneyCollectionUtils, MoonbaseApi, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OfferCondition, OfferUtils, type OpenOrder, type Order, OrderStatus, type OwnedProduct, type Page, Platform, type PricingTier, type PricingVariation, type ProblemDetails, type ProductLineItem, type Quantifiable, type SingleOrMultiple, type Storefront, type StorefrontBundle, type StorefrontOffer, type StorefrontProduct, type Subscription, SubscriptionStatus, TokenStore, type UrchinTrackingModule, type User, type UserAccountConfirmed, type Vendor, type Voucher, objectToQuery, problemDetailsSchema, schemas, utmToObject };
package/dist/index.js CHANGED
@@ -379,11 +379,22 @@ var schemas_exports4 = {};
379
379
  __export(schemas_exports4, {
380
380
  addressSchema: () => addressSchema,
381
381
  communicationPreferencesSchema: () => communicationPreferencesSchema,
382
+ connectedAccountSchema: () => connectedAccountSchema,
383
+ connectionUrlSchema: () => connectionUrlSchema,
382
384
  identitySchema: () => identitySchema,
385
+ ilokConnectedAccountSchema: () => ilokConnectedAccountSchema,
383
386
  userAccountConfirmedSchema: () => userAccountConfirmedSchema,
384
387
  userSchema: () => userSchema
385
388
  });
386
389
  import { z as z7 } from "zod";
390
+
391
+ // src/identity/models.ts
392
+ var ConnectableAccountProvider = /* @__PURE__ */ ((ConnectableAccountProvider2) => {
393
+ ConnectableAccountProvider2["ILok"] = "ILok";
394
+ return ConnectableAccountProvider2;
395
+ })(ConnectableAccountProvider || {});
396
+
397
+ // src/identity/schemas.ts
387
398
  var addressSchema = z7.object({
388
399
  countryCode: z7.string(),
389
400
  streetAddress1: z7.string(),
@@ -396,18 +407,32 @@ var communicationPreferencesSchema = z7.object({
396
407
  newsletterOptIn: z7.boolean()
397
408
  // productUpdatesOptIn: z.boolean(), // TODO: Enable when relevant
398
409
  });
410
+ var ilokConnectedAccountSchema = z7.object({
411
+ provider: z7.literal("ILok" /* ILok */),
412
+ isConnected: z7.boolean(),
413
+ pendingLicenseFulfillments: z7.boolean(),
414
+ accountId: z7.string().nullish()
415
+ });
416
+ var connectedAccountSchema = z7.discriminatedUnion("provider", [
417
+ ilokConnectedAccountSchema
418
+ ]);
419
+ var connectionUrlSchema = z7.object({
420
+ url: z7.string()
421
+ });
399
422
  var userSchema = z7.object({
400
423
  id: z7.string(),
401
424
  email: z7.string(),
402
425
  name: z7.string(),
403
426
  tenantId: z7.string(),
404
427
  address: addressSchema.optional(),
428
+ phone: z7.string().optional(),
405
429
  communicationPreferences: communicationPreferencesSchema,
406
430
  ownedProducts: z7.string().array().optional(),
407
431
  subscribedProducts: z7.string().array().optional(),
408
432
  confirmedAccount: z7.boolean().optional(),
409
433
  hasProducts: z7.boolean().nullish(),
410
- hasSubscriptions: z7.boolean().nullish()
434
+ hasSubscriptions: z7.boolean().nullish(),
435
+ connectedAccounts: z7.array(connectedAccountSchema).default([])
411
436
  });
412
437
  var identitySchema = userSchema.and(z7.object({
413
438
  accessToken: z7.string(),
@@ -529,6 +554,19 @@ var IdentityEndpoints = class {
529
554
  async confirmEmailChange(email, code) {
530
555
  await this.api.authenticatedFetch(`/api/customer/identity/confirm-email-change?email=${encodeURIComponent(email)}&code=${encodeURIComponent(code.replaceAll(" ", "+"))}`, null, { method: "POST" });
531
556
  }
557
+ async getConnectionUrl(provider, redirectUri, loginId) {
558
+ const params = new URLSearchParams({ redirectUri });
559
+ if (loginId)
560
+ params.set("loginId", loginId);
561
+ const response = await this.api.authenticatedFetch(
562
+ `/api/customer/connect/${provider}/authorize?${params.toString()}`,
563
+ connectionUrlSchema
564
+ );
565
+ return response.data.url;
566
+ }
567
+ async disconnectAccount(provider) {
568
+ await this.api.authenticatedFetch(`/api/customer/connect/${provider}`, null, { method: "DELETE" });
569
+ }
532
570
  };
533
571
 
534
572
  // src/inventory/activation/endpoints.ts
@@ -546,6 +584,7 @@ import { z as z8 } from "zod";
546
584
  // src/inventory/licenses/models.ts
547
585
  var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
548
586
  LicenseStatus2["Active"] = "Active";
587
+ LicenseStatus2["Pending"] = "Pending";
549
588
  LicenseStatus2["Revoked"] = "Revoked";
550
589
  return LicenseStatus2;
551
590
  })(LicenseStatus || {});
@@ -562,13 +601,20 @@ var ActivationMethod = /* @__PURE__ */ ((ActivationMethod2) => {
562
601
 
563
602
  // src/inventory/licenses/schemas.ts
564
603
  var externalLicenseFileContent = z8.object({
604
+ type: z8.literal("file"),
565
605
  fileName: z8.string(),
566
606
  contentType: z8.string(),
567
607
  data: z8.string()
568
608
  });
609
+ var externalLicenseILokContent = z8.object({
610
+ type: z8.literal("iLok")
611
+ });
569
612
  var externalLicenseContent = z8.union([
570
613
  z8.string(),
571
- externalLicenseFileContent
614
+ z8.discriminatedUnion("type", [
615
+ externalLicenseFileContent,
616
+ externalLicenseILokContent
617
+ ])
572
618
  ]);
573
619
  var licenseSchema = z8.object({
574
620
  id: z8.string(),
@@ -577,6 +623,7 @@ var licenseSchema = z8.object({
577
623
  activeNumberOfActivations: z8.number(),
578
624
  maxNumberOfActivations: z8.number(),
579
625
  externalFulfillment: externalLicenseContent.optional(),
626
+ requiredConnectedAccount: z8.nativeEnum(ConnectableAccountProvider).nullish(),
580
627
  fulfillmentMessage: z8.string().optional(),
581
628
  expiresAt: z8.coerce.date().optional(),
582
629
  createdAt: z8.coerce.date()
@@ -1476,6 +1523,7 @@ export {
1476
1523
  ActivationRequestFulfillmentType,
1477
1524
  ActivationRequestStatus,
1478
1525
  ActivationStatus,
1526
+ ConnectableAccountProvider,
1479
1527
  ConsoleLogger,
1480
1528
  CycleLength,
1481
1529
  DiscountUtils,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/storefront-api",
3
3
  "type": "module",
4
- "version": "1.0.6",
4
+ "version": "1.0.15",
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",