@moonbase.sh/storefront-api 1.0.6 → 1.0.12
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 +51 -2
- package/dist/index.d.cts +152 -6
- package/dist/index.d.ts +152 -6
- package/dist/index.js +50 -2
- package/package.json +1 -1
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,6 +455,18 @@ 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(),
|
|
@@ -454,7 +478,8 @@ var userSchema = import_zod7.z.object({
|
|
|
454
478
|
subscribedProducts: import_zod7.z.string().array().optional(),
|
|
455
479
|
confirmedAccount: import_zod7.z.boolean().optional(),
|
|
456
480
|
hasProducts: import_zod7.z.boolean().nullish(),
|
|
457
|
-
hasSubscriptions: import_zod7.z.boolean().nullish()
|
|
481
|
+
hasSubscriptions: import_zod7.z.boolean().nullish(),
|
|
482
|
+
connectedAccounts: import_zod7.z.array(connectedAccountSchema).default([])
|
|
458
483
|
});
|
|
459
484
|
var identitySchema = userSchema.and(import_zod7.z.object({
|
|
460
485
|
accessToken: import_zod7.z.string(),
|
|
@@ -576,6 +601,19 @@ var IdentityEndpoints = class {
|
|
|
576
601
|
async confirmEmailChange(email, code) {
|
|
577
602
|
await this.api.authenticatedFetch(`/api/customer/identity/confirm-email-change?email=${encodeURIComponent(email)}&code=${encodeURIComponent(code.replaceAll(" ", "+"))}`, null, { method: "POST" });
|
|
578
603
|
}
|
|
604
|
+
async getConnectionUrl(provider, redirectUri, loginId) {
|
|
605
|
+
const params = new URLSearchParams({ redirectUri });
|
|
606
|
+
if (loginId)
|
|
607
|
+
params.set("loginId", loginId);
|
|
608
|
+
const response = await this.api.authenticatedFetch(
|
|
609
|
+
`/api/customer/connect/${provider}/authorize?${params.toString()}`,
|
|
610
|
+
connectionUrlSchema
|
|
611
|
+
);
|
|
612
|
+
return response.data.url;
|
|
613
|
+
}
|
|
614
|
+
async disconnectAccount(provider) {
|
|
615
|
+
await this.api.authenticatedFetch(`/api/customer/connect/${provider}`, null, { method: "DELETE" });
|
|
616
|
+
}
|
|
579
617
|
};
|
|
580
618
|
|
|
581
619
|
// src/inventory/activation/endpoints.ts
|
|
@@ -593,6 +631,7 @@ var import_zod8 = require("zod");
|
|
|
593
631
|
// src/inventory/licenses/models.ts
|
|
594
632
|
var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
|
|
595
633
|
LicenseStatus2["Active"] = "Active";
|
|
634
|
+
LicenseStatus2["Pending"] = "Pending";
|
|
596
635
|
LicenseStatus2["Revoked"] = "Revoked";
|
|
597
636
|
return LicenseStatus2;
|
|
598
637
|
})(LicenseStatus || {});
|
|
@@ -609,13 +648,21 @@ var ActivationMethod = /* @__PURE__ */ ((ActivationMethod2) => {
|
|
|
609
648
|
|
|
610
649
|
// src/inventory/licenses/schemas.ts
|
|
611
650
|
var externalLicenseFileContent = import_zod8.z.object({
|
|
651
|
+
type: import_zod8.z.literal("file"),
|
|
612
652
|
fileName: import_zod8.z.string(),
|
|
613
653
|
contentType: import_zod8.z.string(),
|
|
614
654
|
data: import_zod8.z.string()
|
|
615
655
|
});
|
|
656
|
+
var externalLicenseILokContent = import_zod8.z.object({
|
|
657
|
+
type: import_zod8.z.literal("iLok"),
|
|
658
|
+
licenseId: import_zod8.z.string()
|
|
659
|
+
});
|
|
616
660
|
var externalLicenseContent = import_zod8.z.union([
|
|
617
661
|
import_zod8.z.string(),
|
|
618
|
-
|
|
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;
|
|
@@ -961,6 +1000,22 @@ declare const userSchema: z.ZodObject<{
|
|
|
961
1000
|
confirmedAccount: z.ZodOptional<z.ZodBoolean>;
|
|
962
1001
|
hasProducts: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
963
1002
|
hasSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
1003
|
+
connectedAccounts: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
|
|
1004
|
+
provider: z.ZodLiteral<ConnectableAccountProvider>;
|
|
1005
|
+
isConnected: z.ZodBoolean;
|
|
1006
|
+
pendingLicenseFulfillments: z.ZodBoolean;
|
|
1007
|
+
accountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1008
|
+
}, "strip", z.ZodTypeAny, {
|
|
1009
|
+
provider: ConnectableAccountProvider;
|
|
1010
|
+
isConnected: boolean;
|
|
1011
|
+
pendingLicenseFulfillments: boolean;
|
|
1012
|
+
accountId?: string | null | undefined;
|
|
1013
|
+
}, {
|
|
1014
|
+
provider: ConnectableAccountProvider;
|
|
1015
|
+
isConnected: boolean;
|
|
1016
|
+
pendingLicenseFulfillments: boolean;
|
|
1017
|
+
accountId?: string | null | undefined;
|
|
1018
|
+
}>]>, "many">>;
|
|
964
1019
|
}, "strip", z.ZodTypeAny, {
|
|
965
1020
|
id: string;
|
|
966
1021
|
email: string;
|
|
@@ -969,6 +1024,12 @@ declare const userSchema: z.ZodObject<{
|
|
|
969
1024
|
communicationPreferences: {
|
|
970
1025
|
newsletterOptIn: boolean;
|
|
971
1026
|
};
|
|
1027
|
+
connectedAccounts: {
|
|
1028
|
+
provider: ConnectableAccountProvider;
|
|
1029
|
+
isConnected: boolean;
|
|
1030
|
+
pendingLicenseFulfillments: boolean;
|
|
1031
|
+
accountId?: string | null | undefined;
|
|
1032
|
+
}[];
|
|
972
1033
|
address?: {
|
|
973
1034
|
countryCode: string;
|
|
974
1035
|
streetAddress1: string;
|
|
@@ -1003,6 +1064,12 @@ declare const userSchema: z.ZodObject<{
|
|
|
1003
1064
|
confirmedAccount?: boolean | undefined;
|
|
1004
1065
|
hasProducts?: boolean | null | undefined;
|
|
1005
1066
|
hasSubscriptions?: boolean | null | undefined;
|
|
1067
|
+
connectedAccounts?: {
|
|
1068
|
+
provider: ConnectableAccountProvider;
|
|
1069
|
+
isConnected: boolean;
|
|
1070
|
+
pendingLicenseFulfillments: boolean;
|
|
1071
|
+
accountId?: string | null | undefined;
|
|
1072
|
+
}[] | undefined;
|
|
1006
1073
|
}>;
|
|
1007
1074
|
declare const identitySchema: z.ZodIntersection<z.ZodObject<{
|
|
1008
1075
|
id: z.ZodString;
|
|
@@ -1043,6 +1110,22 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
|
|
|
1043
1110
|
confirmedAccount: z.ZodOptional<z.ZodBoolean>;
|
|
1044
1111
|
hasProducts: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
1045
1112
|
hasSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
1113
|
+
connectedAccounts: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
|
|
1114
|
+
provider: z.ZodLiteral<ConnectableAccountProvider>;
|
|
1115
|
+
isConnected: z.ZodBoolean;
|
|
1116
|
+
pendingLicenseFulfillments: z.ZodBoolean;
|
|
1117
|
+
accountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1118
|
+
}, "strip", z.ZodTypeAny, {
|
|
1119
|
+
provider: ConnectableAccountProvider;
|
|
1120
|
+
isConnected: boolean;
|
|
1121
|
+
pendingLicenseFulfillments: boolean;
|
|
1122
|
+
accountId?: string | null | undefined;
|
|
1123
|
+
}, {
|
|
1124
|
+
provider: ConnectableAccountProvider;
|
|
1125
|
+
isConnected: boolean;
|
|
1126
|
+
pendingLicenseFulfillments: boolean;
|
|
1127
|
+
accountId?: string | null | undefined;
|
|
1128
|
+
}>]>, "many">>;
|
|
1046
1129
|
}, "strip", z.ZodTypeAny, {
|
|
1047
1130
|
id: string;
|
|
1048
1131
|
email: string;
|
|
@@ -1051,6 +1134,12 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
|
|
|
1051
1134
|
communicationPreferences: {
|
|
1052
1135
|
newsletterOptIn: boolean;
|
|
1053
1136
|
};
|
|
1137
|
+
connectedAccounts: {
|
|
1138
|
+
provider: ConnectableAccountProvider;
|
|
1139
|
+
isConnected: boolean;
|
|
1140
|
+
pendingLicenseFulfillments: boolean;
|
|
1141
|
+
accountId?: string | null | undefined;
|
|
1142
|
+
}[];
|
|
1054
1143
|
address?: {
|
|
1055
1144
|
countryCode: string;
|
|
1056
1145
|
streetAddress1: string;
|
|
@@ -1085,6 +1174,12 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
|
|
|
1085
1174
|
confirmedAccount?: boolean | undefined;
|
|
1086
1175
|
hasProducts?: boolean | null | undefined;
|
|
1087
1176
|
hasSubscriptions?: boolean | null | undefined;
|
|
1177
|
+
connectedAccounts?: {
|
|
1178
|
+
provider: ConnectableAccountProvider;
|
|
1179
|
+
isConnected: boolean;
|
|
1180
|
+
pendingLicenseFulfillments: boolean;
|
|
1181
|
+
accountId?: string | null | undefined;
|
|
1182
|
+
}[] | undefined;
|
|
1088
1183
|
}>, z.ZodObject<{
|
|
1089
1184
|
accessToken: z.ZodString;
|
|
1090
1185
|
refreshToken: z.ZodString;
|
|
@@ -1114,14 +1209,21 @@ declare const userAccountConfirmedSchema: z.ZodObject<{
|
|
|
1114
1209
|
|
|
1115
1210
|
declare const schemas$9_addressSchema: typeof addressSchema;
|
|
1116
1211
|
declare const schemas$9_communicationPreferencesSchema: typeof communicationPreferencesSchema;
|
|
1212
|
+
declare const schemas$9_connectedAccountSchema: typeof connectedAccountSchema;
|
|
1213
|
+
declare const schemas$9_connectionUrlSchema: typeof connectionUrlSchema;
|
|
1117
1214
|
declare const schemas$9_identitySchema: typeof identitySchema;
|
|
1215
|
+
declare const schemas$9_ilokConnectedAccountSchema: typeof ilokConnectedAccountSchema;
|
|
1118
1216
|
declare const schemas$9_userAccountConfirmedSchema: typeof userAccountConfirmedSchema;
|
|
1119
1217
|
declare const schemas$9_userSchema: typeof userSchema;
|
|
1120
1218
|
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 };
|
|
1219
|
+
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
1220
|
}
|
|
1123
1221
|
|
|
1124
1222
|
type CommunicationPreferences = z.infer<typeof communicationPreferencesSchema>;
|
|
1223
|
+
declare enum ConnectableAccountProvider {
|
|
1224
|
+
ILok = "ILok"
|
|
1225
|
+
}
|
|
1226
|
+
type ConnectedAccount = z.infer<typeof connectedAccountSchema>;
|
|
1125
1227
|
type User = z.infer<typeof userSchema>;
|
|
1126
1228
|
type Identity = z.infer<typeof identitySchema>;
|
|
1127
1229
|
type Address = z.infer<typeof addressSchema>;
|
|
@@ -1146,6 +1248,12 @@ declare class IdentityEndpoints {
|
|
|
1146
1248
|
communicationPreferences: {
|
|
1147
1249
|
newsletterOptIn: boolean;
|
|
1148
1250
|
};
|
|
1251
|
+
connectedAccounts: {
|
|
1252
|
+
provider: ConnectableAccountProvider;
|
|
1253
|
+
isConnected: boolean;
|
|
1254
|
+
pendingLicenseFulfillments: boolean;
|
|
1255
|
+
accountId?: string | null | undefined;
|
|
1256
|
+
}[];
|
|
1149
1257
|
address?: {
|
|
1150
1258
|
countryCode: string;
|
|
1151
1259
|
streetAddress1: string;
|
|
@@ -1167,21 +1275,35 @@ declare class IdentityEndpoints {
|
|
|
1167
1275
|
confirmAccount(email: string, code: string): Promise<UserAccountConfirmed>;
|
|
1168
1276
|
confirmEmail(email: string, code: string): Promise<void>;
|
|
1169
1277
|
confirmEmailChange(email: string, code: string): Promise<void>;
|
|
1278
|
+
getConnectionUrl(provider: ConnectableAccountProvider, redirectUri: string, loginId?: string): Promise<string>;
|
|
1279
|
+
disconnectAccount(provider: ConnectableAccountProvider): Promise<void>;
|
|
1170
1280
|
}
|
|
1171
1281
|
|
|
1172
|
-
declare const externalLicenseContent: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1282
|
+
declare const externalLicenseContent: z.ZodUnion<[z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1283
|
+
type: z.ZodLiteral<"file">;
|
|
1173
1284
|
fileName: z.ZodString;
|
|
1174
1285
|
contentType: z.ZodString;
|
|
1175
1286
|
data: z.ZodString;
|
|
1176
1287
|
}, "strip", z.ZodTypeAny, {
|
|
1288
|
+
type: "file";
|
|
1177
1289
|
data: string;
|
|
1178
1290
|
fileName: string;
|
|
1179
1291
|
contentType: string;
|
|
1180
1292
|
}, {
|
|
1293
|
+
type: "file";
|
|
1181
1294
|
data: string;
|
|
1182
1295
|
fileName: string;
|
|
1183
1296
|
contentType: string;
|
|
1184
|
-
}
|
|
1297
|
+
}>, z.ZodObject<{
|
|
1298
|
+
type: z.ZodLiteral<"iLok">;
|
|
1299
|
+
licenseId: z.ZodString;
|
|
1300
|
+
}, "strip", z.ZodTypeAny, {
|
|
1301
|
+
type: "iLok";
|
|
1302
|
+
licenseId: string;
|
|
1303
|
+
}, {
|
|
1304
|
+
type: "iLok";
|
|
1305
|
+
licenseId: string;
|
|
1306
|
+
}>]>]>;
|
|
1185
1307
|
type ExternalLicenseContent = z.infer<typeof externalLicenseContent>;
|
|
1186
1308
|
declare const licenseSchema: z.ZodObject<{
|
|
1187
1309
|
id: z.ZodString;
|
|
@@ -1332,19 +1454,32 @@ declare const licenseSchema: z.ZodObject<{
|
|
|
1332
1454
|
}>;
|
|
1333
1455
|
activeNumberOfActivations: z.ZodNumber;
|
|
1334
1456
|
maxNumberOfActivations: z.ZodNumber;
|
|
1335
|
-
externalFulfillment: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1457
|
+
externalFulfillment: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1458
|
+
type: z.ZodLiteral<"file">;
|
|
1336
1459
|
fileName: z.ZodString;
|
|
1337
1460
|
contentType: z.ZodString;
|
|
1338
1461
|
data: z.ZodString;
|
|
1339
1462
|
}, "strip", z.ZodTypeAny, {
|
|
1463
|
+
type: "file";
|
|
1340
1464
|
data: string;
|
|
1341
1465
|
fileName: string;
|
|
1342
1466
|
contentType: string;
|
|
1343
1467
|
}, {
|
|
1468
|
+
type: "file";
|
|
1344
1469
|
data: string;
|
|
1345
1470
|
fileName: string;
|
|
1346
1471
|
contentType: string;
|
|
1347
|
-
}
|
|
1472
|
+
}>, z.ZodObject<{
|
|
1473
|
+
type: z.ZodLiteral<"iLok">;
|
|
1474
|
+
licenseId: z.ZodString;
|
|
1475
|
+
}, "strip", z.ZodTypeAny, {
|
|
1476
|
+
type: "iLok";
|
|
1477
|
+
licenseId: string;
|
|
1478
|
+
}, {
|
|
1479
|
+
type: "iLok";
|
|
1480
|
+
licenseId: string;
|
|
1481
|
+
}>]>]>>;
|
|
1482
|
+
requiredConnectedAccount: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof ConnectableAccountProvider>>>;
|
|
1348
1483
|
fulfillmentMessage: z.ZodOptional<z.ZodString>;
|
|
1349
1484
|
expiresAt: z.ZodOptional<z.ZodDate>;
|
|
1350
1485
|
createdAt: z.ZodDate;
|
|
@@ -1390,10 +1525,15 @@ declare const licenseSchema: z.ZodObject<{
|
|
|
1390
1525
|
createdAt: Date;
|
|
1391
1526
|
expiresAt?: Date | undefined;
|
|
1392
1527
|
externalFulfillment?: string | {
|
|
1528
|
+
type: "file";
|
|
1393
1529
|
data: string;
|
|
1394
1530
|
fileName: string;
|
|
1395
1531
|
contentType: string;
|
|
1532
|
+
} | {
|
|
1533
|
+
type: "iLok";
|
|
1534
|
+
licenseId: string;
|
|
1396
1535
|
} | undefined;
|
|
1536
|
+
requiredConnectedAccount?: ConnectableAccountProvider | null | undefined;
|
|
1397
1537
|
fulfillmentMessage?: string | undefined;
|
|
1398
1538
|
}, {
|
|
1399
1539
|
id: string;
|
|
@@ -1437,10 +1577,15 @@ 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";
|
|
1586
|
+
licenseId: string;
|
|
1443
1587
|
} | undefined;
|
|
1588
|
+
requiredConnectedAccount?: ConnectableAccountProvider | null | undefined;
|
|
1444
1589
|
fulfillmentMessage?: string | undefined;
|
|
1445
1590
|
}>;
|
|
1446
1591
|
declare const activationSchema: z.ZodObject<{
|
|
@@ -1479,6 +1624,7 @@ declare namespace schemas$8 {
|
|
|
1479
1624
|
|
|
1480
1625
|
declare enum LicenseStatus {
|
|
1481
1626
|
Active = "Active",
|
|
1627
|
+
Pending = "Pending",
|
|
1482
1628
|
Revoked = "Revoked"
|
|
1483
1629
|
}
|
|
1484
1630
|
declare enum ActivationStatus {
|
|
@@ -37828,4 +37974,4 @@ declare class MoonbaseClient {
|
|
|
37828
37974
|
orders: OrderEndpoints;
|
|
37829
37975
|
}
|
|
37830
37976
|
|
|
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 };
|
|
37977
|
+
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;
|
|
@@ -961,6 +1000,22 @@ declare const userSchema: z.ZodObject<{
|
|
|
961
1000
|
confirmedAccount: z.ZodOptional<z.ZodBoolean>;
|
|
962
1001
|
hasProducts: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
963
1002
|
hasSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
1003
|
+
connectedAccounts: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
|
|
1004
|
+
provider: z.ZodLiteral<ConnectableAccountProvider>;
|
|
1005
|
+
isConnected: z.ZodBoolean;
|
|
1006
|
+
pendingLicenseFulfillments: z.ZodBoolean;
|
|
1007
|
+
accountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1008
|
+
}, "strip", z.ZodTypeAny, {
|
|
1009
|
+
provider: ConnectableAccountProvider;
|
|
1010
|
+
isConnected: boolean;
|
|
1011
|
+
pendingLicenseFulfillments: boolean;
|
|
1012
|
+
accountId?: string | null | undefined;
|
|
1013
|
+
}, {
|
|
1014
|
+
provider: ConnectableAccountProvider;
|
|
1015
|
+
isConnected: boolean;
|
|
1016
|
+
pendingLicenseFulfillments: boolean;
|
|
1017
|
+
accountId?: string | null | undefined;
|
|
1018
|
+
}>]>, "many">>;
|
|
964
1019
|
}, "strip", z.ZodTypeAny, {
|
|
965
1020
|
id: string;
|
|
966
1021
|
email: string;
|
|
@@ -969,6 +1024,12 @@ declare const userSchema: z.ZodObject<{
|
|
|
969
1024
|
communicationPreferences: {
|
|
970
1025
|
newsletterOptIn: boolean;
|
|
971
1026
|
};
|
|
1027
|
+
connectedAccounts: {
|
|
1028
|
+
provider: ConnectableAccountProvider;
|
|
1029
|
+
isConnected: boolean;
|
|
1030
|
+
pendingLicenseFulfillments: boolean;
|
|
1031
|
+
accountId?: string | null | undefined;
|
|
1032
|
+
}[];
|
|
972
1033
|
address?: {
|
|
973
1034
|
countryCode: string;
|
|
974
1035
|
streetAddress1: string;
|
|
@@ -1003,6 +1064,12 @@ declare const userSchema: z.ZodObject<{
|
|
|
1003
1064
|
confirmedAccount?: boolean | undefined;
|
|
1004
1065
|
hasProducts?: boolean | null | undefined;
|
|
1005
1066
|
hasSubscriptions?: boolean | null | undefined;
|
|
1067
|
+
connectedAccounts?: {
|
|
1068
|
+
provider: ConnectableAccountProvider;
|
|
1069
|
+
isConnected: boolean;
|
|
1070
|
+
pendingLicenseFulfillments: boolean;
|
|
1071
|
+
accountId?: string | null | undefined;
|
|
1072
|
+
}[] | undefined;
|
|
1006
1073
|
}>;
|
|
1007
1074
|
declare const identitySchema: z.ZodIntersection<z.ZodObject<{
|
|
1008
1075
|
id: z.ZodString;
|
|
@@ -1043,6 +1110,22 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
|
|
|
1043
1110
|
confirmedAccount: z.ZodOptional<z.ZodBoolean>;
|
|
1044
1111
|
hasProducts: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
1045
1112
|
hasSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
1113
|
+
connectedAccounts: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
|
|
1114
|
+
provider: z.ZodLiteral<ConnectableAccountProvider>;
|
|
1115
|
+
isConnected: z.ZodBoolean;
|
|
1116
|
+
pendingLicenseFulfillments: z.ZodBoolean;
|
|
1117
|
+
accountId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1118
|
+
}, "strip", z.ZodTypeAny, {
|
|
1119
|
+
provider: ConnectableAccountProvider;
|
|
1120
|
+
isConnected: boolean;
|
|
1121
|
+
pendingLicenseFulfillments: boolean;
|
|
1122
|
+
accountId?: string | null | undefined;
|
|
1123
|
+
}, {
|
|
1124
|
+
provider: ConnectableAccountProvider;
|
|
1125
|
+
isConnected: boolean;
|
|
1126
|
+
pendingLicenseFulfillments: boolean;
|
|
1127
|
+
accountId?: string | null | undefined;
|
|
1128
|
+
}>]>, "many">>;
|
|
1046
1129
|
}, "strip", z.ZodTypeAny, {
|
|
1047
1130
|
id: string;
|
|
1048
1131
|
email: string;
|
|
@@ -1051,6 +1134,12 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
|
|
|
1051
1134
|
communicationPreferences: {
|
|
1052
1135
|
newsletterOptIn: boolean;
|
|
1053
1136
|
};
|
|
1137
|
+
connectedAccounts: {
|
|
1138
|
+
provider: ConnectableAccountProvider;
|
|
1139
|
+
isConnected: boolean;
|
|
1140
|
+
pendingLicenseFulfillments: boolean;
|
|
1141
|
+
accountId?: string | null | undefined;
|
|
1142
|
+
}[];
|
|
1054
1143
|
address?: {
|
|
1055
1144
|
countryCode: string;
|
|
1056
1145
|
streetAddress1: string;
|
|
@@ -1085,6 +1174,12 @@ declare const identitySchema: z.ZodIntersection<z.ZodObject<{
|
|
|
1085
1174
|
confirmedAccount?: boolean | undefined;
|
|
1086
1175
|
hasProducts?: boolean | null | undefined;
|
|
1087
1176
|
hasSubscriptions?: boolean | null | undefined;
|
|
1177
|
+
connectedAccounts?: {
|
|
1178
|
+
provider: ConnectableAccountProvider;
|
|
1179
|
+
isConnected: boolean;
|
|
1180
|
+
pendingLicenseFulfillments: boolean;
|
|
1181
|
+
accountId?: string | null | undefined;
|
|
1182
|
+
}[] | undefined;
|
|
1088
1183
|
}>, z.ZodObject<{
|
|
1089
1184
|
accessToken: z.ZodString;
|
|
1090
1185
|
refreshToken: z.ZodString;
|
|
@@ -1114,14 +1209,21 @@ declare const userAccountConfirmedSchema: z.ZodObject<{
|
|
|
1114
1209
|
|
|
1115
1210
|
declare const schemas$9_addressSchema: typeof addressSchema;
|
|
1116
1211
|
declare const schemas$9_communicationPreferencesSchema: typeof communicationPreferencesSchema;
|
|
1212
|
+
declare const schemas$9_connectedAccountSchema: typeof connectedAccountSchema;
|
|
1213
|
+
declare const schemas$9_connectionUrlSchema: typeof connectionUrlSchema;
|
|
1117
1214
|
declare const schemas$9_identitySchema: typeof identitySchema;
|
|
1215
|
+
declare const schemas$9_ilokConnectedAccountSchema: typeof ilokConnectedAccountSchema;
|
|
1118
1216
|
declare const schemas$9_userAccountConfirmedSchema: typeof userAccountConfirmedSchema;
|
|
1119
1217
|
declare const schemas$9_userSchema: typeof userSchema;
|
|
1120
1218
|
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 };
|
|
1219
|
+
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
1220
|
}
|
|
1123
1221
|
|
|
1124
1222
|
type CommunicationPreferences = z.infer<typeof communicationPreferencesSchema>;
|
|
1223
|
+
declare enum ConnectableAccountProvider {
|
|
1224
|
+
ILok = "ILok"
|
|
1225
|
+
}
|
|
1226
|
+
type ConnectedAccount = z.infer<typeof connectedAccountSchema>;
|
|
1125
1227
|
type User = z.infer<typeof userSchema>;
|
|
1126
1228
|
type Identity = z.infer<typeof identitySchema>;
|
|
1127
1229
|
type Address = z.infer<typeof addressSchema>;
|
|
@@ -1146,6 +1248,12 @@ declare class IdentityEndpoints {
|
|
|
1146
1248
|
communicationPreferences: {
|
|
1147
1249
|
newsletterOptIn: boolean;
|
|
1148
1250
|
};
|
|
1251
|
+
connectedAccounts: {
|
|
1252
|
+
provider: ConnectableAccountProvider;
|
|
1253
|
+
isConnected: boolean;
|
|
1254
|
+
pendingLicenseFulfillments: boolean;
|
|
1255
|
+
accountId?: string | null | undefined;
|
|
1256
|
+
}[];
|
|
1149
1257
|
address?: {
|
|
1150
1258
|
countryCode: string;
|
|
1151
1259
|
streetAddress1: string;
|
|
@@ -1167,21 +1275,35 @@ declare class IdentityEndpoints {
|
|
|
1167
1275
|
confirmAccount(email: string, code: string): Promise<UserAccountConfirmed>;
|
|
1168
1276
|
confirmEmail(email: string, code: string): Promise<void>;
|
|
1169
1277
|
confirmEmailChange(email: string, code: string): Promise<void>;
|
|
1278
|
+
getConnectionUrl(provider: ConnectableAccountProvider, redirectUri: string, loginId?: string): Promise<string>;
|
|
1279
|
+
disconnectAccount(provider: ConnectableAccountProvider): Promise<void>;
|
|
1170
1280
|
}
|
|
1171
1281
|
|
|
1172
|
-
declare const externalLicenseContent: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1282
|
+
declare const externalLicenseContent: z.ZodUnion<[z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1283
|
+
type: z.ZodLiteral<"file">;
|
|
1173
1284
|
fileName: z.ZodString;
|
|
1174
1285
|
contentType: z.ZodString;
|
|
1175
1286
|
data: z.ZodString;
|
|
1176
1287
|
}, "strip", z.ZodTypeAny, {
|
|
1288
|
+
type: "file";
|
|
1177
1289
|
data: string;
|
|
1178
1290
|
fileName: string;
|
|
1179
1291
|
contentType: string;
|
|
1180
1292
|
}, {
|
|
1293
|
+
type: "file";
|
|
1181
1294
|
data: string;
|
|
1182
1295
|
fileName: string;
|
|
1183
1296
|
contentType: string;
|
|
1184
|
-
}
|
|
1297
|
+
}>, z.ZodObject<{
|
|
1298
|
+
type: z.ZodLiteral<"iLok">;
|
|
1299
|
+
licenseId: z.ZodString;
|
|
1300
|
+
}, "strip", z.ZodTypeAny, {
|
|
1301
|
+
type: "iLok";
|
|
1302
|
+
licenseId: string;
|
|
1303
|
+
}, {
|
|
1304
|
+
type: "iLok";
|
|
1305
|
+
licenseId: string;
|
|
1306
|
+
}>]>]>;
|
|
1185
1307
|
type ExternalLicenseContent = z.infer<typeof externalLicenseContent>;
|
|
1186
1308
|
declare const licenseSchema: z.ZodObject<{
|
|
1187
1309
|
id: z.ZodString;
|
|
@@ -1332,19 +1454,32 @@ declare const licenseSchema: z.ZodObject<{
|
|
|
1332
1454
|
}>;
|
|
1333
1455
|
activeNumberOfActivations: z.ZodNumber;
|
|
1334
1456
|
maxNumberOfActivations: z.ZodNumber;
|
|
1335
|
-
externalFulfillment: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
1457
|
+
externalFulfillment: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1458
|
+
type: z.ZodLiteral<"file">;
|
|
1336
1459
|
fileName: z.ZodString;
|
|
1337
1460
|
contentType: z.ZodString;
|
|
1338
1461
|
data: z.ZodString;
|
|
1339
1462
|
}, "strip", z.ZodTypeAny, {
|
|
1463
|
+
type: "file";
|
|
1340
1464
|
data: string;
|
|
1341
1465
|
fileName: string;
|
|
1342
1466
|
contentType: string;
|
|
1343
1467
|
}, {
|
|
1468
|
+
type: "file";
|
|
1344
1469
|
data: string;
|
|
1345
1470
|
fileName: string;
|
|
1346
1471
|
contentType: string;
|
|
1347
|
-
}
|
|
1472
|
+
}>, z.ZodObject<{
|
|
1473
|
+
type: z.ZodLiteral<"iLok">;
|
|
1474
|
+
licenseId: z.ZodString;
|
|
1475
|
+
}, "strip", z.ZodTypeAny, {
|
|
1476
|
+
type: "iLok";
|
|
1477
|
+
licenseId: string;
|
|
1478
|
+
}, {
|
|
1479
|
+
type: "iLok";
|
|
1480
|
+
licenseId: string;
|
|
1481
|
+
}>]>]>>;
|
|
1482
|
+
requiredConnectedAccount: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof ConnectableAccountProvider>>>;
|
|
1348
1483
|
fulfillmentMessage: z.ZodOptional<z.ZodString>;
|
|
1349
1484
|
expiresAt: z.ZodOptional<z.ZodDate>;
|
|
1350
1485
|
createdAt: z.ZodDate;
|
|
@@ -1390,10 +1525,15 @@ declare const licenseSchema: z.ZodObject<{
|
|
|
1390
1525
|
createdAt: Date;
|
|
1391
1526
|
expiresAt?: Date | undefined;
|
|
1392
1527
|
externalFulfillment?: string | {
|
|
1528
|
+
type: "file";
|
|
1393
1529
|
data: string;
|
|
1394
1530
|
fileName: string;
|
|
1395
1531
|
contentType: string;
|
|
1532
|
+
} | {
|
|
1533
|
+
type: "iLok";
|
|
1534
|
+
licenseId: string;
|
|
1396
1535
|
} | undefined;
|
|
1536
|
+
requiredConnectedAccount?: ConnectableAccountProvider | null | undefined;
|
|
1397
1537
|
fulfillmentMessage?: string | undefined;
|
|
1398
1538
|
}, {
|
|
1399
1539
|
id: string;
|
|
@@ -1437,10 +1577,15 @@ 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";
|
|
1586
|
+
licenseId: string;
|
|
1443
1587
|
} | undefined;
|
|
1588
|
+
requiredConnectedAccount?: ConnectableAccountProvider | null | undefined;
|
|
1444
1589
|
fulfillmentMessage?: string | undefined;
|
|
1445
1590
|
}>;
|
|
1446
1591
|
declare const activationSchema: z.ZodObject<{
|
|
@@ -1479,6 +1624,7 @@ declare namespace schemas$8 {
|
|
|
1479
1624
|
|
|
1480
1625
|
declare enum LicenseStatus {
|
|
1481
1626
|
Active = "Active",
|
|
1627
|
+
Pending = "Pending",
|
|
1482
1628
|
Revoked = "Revoked"
|
|
1483
1629
|
}
|
|
1484
1630
|
declare enum ActivationStatus {
|
|
@@ -37828,4 +37974,4 @@ declare class MoonbaseClient {
|
|
|
37828
37974
|
orders: OrderEndpoints;
|
|
37829
37975
|
}
|
|
37830
37976
|
|
|
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 };
|
|
37977
|
+
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,6 +407,18 @@ 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(),
|
|
@@ -407,7 +430,8 @@ var userSchema = z7.object({
|
|
|
407
430
|
subscribedProducts: z7.string().array().optional(),
|
|
408
431
|
confirmedAccount: z7.boolean().optional(),
|
|
409
432
|
hasProducts: z7.boolean().nullish(),
|
|
410
|
-
hasSubscriptions: z7.boolean().nullish()
|
|
433
|
+
hasSubscriptions: z7.boolean().nullish(),
|
|
434
|
+
connectedAccounts: z7.array(connectedAccountSchema).default([])
|
|
411
435
|
});
|
|
412
436
|
var identitySchema = userSchema.and(z7.object({
|
|
413
437
|
accessToken: z7.string(),
|
|
@@ -529,6 +553,19 @@ var IdentityEndpoints = class {
|
|
|
529
553
|
async confirmEmailChange(email, code) {
|
|
530
554
|
await this.api.authenticatedFetch(`/api/customer/identity/confirm-email-change?email=${encodeURIComponent(email)}&code=${encodeURIComponent(code.replaceAll(" ", "+"))}`, null, { method: "POST" });
|
|
531
555
|
}
|
|
556
|
+
async getConnectionUrl(provider, redirectUri, loginId) {
|
|
557
|
+
const params = new URLSearchParams({ redirectUri });
|
|
558
|
+
if (loginId)
|
|
559
|
+
params.set("loginId", loginId);
|
|
560
|
+
const response = await this.api.authenticatedFetch(
|
|
561
|
+
`/api/customer/connect/${provider}/authorize?${params.toString()}`,
|
|
562
|
+
connectionUrlSchema
|
|
563
|
+
);
|
|
564
|
+
return response.data.url;
|
|
565
|
+
}
|
|
566
|
+
async disconnectAccount(provider) {
|
|
567
|
+
await this.api.authenticatedFetch(`/api/customer/connect/${provider}`, null, { method: "DELETE" });
|
|
568
|
+
}
|
|
532
569
|
};
|
|
533
570
|
|
|
534
571
|
// src/inventory/activation/endpoints.ts
|
|
@@ -546,6 +583,7 @@ import { z as z8 } from "zod";
|
|
|
546
583
|
// src/inventory/licenses/models.ts
|
|
547
584
|
var LicenseStatus = /* @__PURE__ */ ((LicenseStatus2) => {
|
|
548
585
|
LicenseStatus2["Active"] = "Active";
|
|
586
|
+
LicenseStatus2["Pending"] = "Pending";
|
|
549
587
|
LicenseStatus2["Revoked"] = "Revoked";
|
|
550
588
|
return LicenseStatus2;
|
|
551
589
|
})(LicenseStatus || {});
|
|
@@ -562,13 +600,21 @@ var ActivationMethod = /* @__PURE__ */ ((ActivationMethod2) => {
|
|
|
562
600
|
|
|
563
601
|
// src/inventory/licenses/schemas.ts
|
|
564
602
|
var externalLicenseFileContent = z8.object({
|
|
603
|
+
type: z8.literal("file"),
|
|
565
604
|
fileName: z8.string(),
|
|
566
605
|
contentType: z8.string(),
|
|
567
606
|
data: z8.string()
|
|
568
607
|
});
|
|
608
|
+
var externalLicenseILokContent = z8.object({
|
|
609
|
+
type: z8.literal("iLok"),
|
|
610
|
+
licenseId: z8.string()
|
|
611
|
+
});
|
|
569
612
|
var externalLicenseContent = z8.union([
|
|
570
613
|
z8.string(),
|
|
571
|
-
|
|
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.
|
|
4
|
+
"version": "1.0.12",
|
|
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",
|