@voyantjs/customer-portal 0.26.1 → 0.26.3
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/routes-public.d.ts +16 -8
- package/dist/routes-public.d.ts.map +1 -1
- package/dist/service-public.d.ts.map +1 -1
- package/dist/service-public.js +24 -10
- package/dist/validation-public.d.ts +4 -2
- package/dist/validation-public.d.ts.map +1 -1
- package/dist/validation-public.js +4 -1
- package/package.json +10 -10
package/dist/routes-public.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare function createPublicCustomerPortalRoutes(options?: PublicCustome
|
|
|
18
18
|
output: {
|
|
19
19
|
data: {
|
|
20
20
|
userId: string;
|
|
21
|
-
email: string;
|
|
21
|
+
email: string | null;
|
|
22
22
|
emailVerified: boolean;
|
|
23
23
|
firstName: string | null;
|
|
24
24
|
middleName: string | null;
|
|
@@ -73,6 +73,7 @@ export declare function createPublicCustomerPortalRoutes(options?: PublicCustome
|
|
|
73
73
|
relation: string | null;
|
|
74
74
|
status: string;
|
|
75
75
|
} | null;
|
|
76
|
+
phoneNumber?: string | null | undefined;
|
|
76
77
|
};
|
|
77
78
|
};
|
|
78
79
|
outputFormat: "json";
|
|
@@ -124,7 +125,7 @@ export declare function createPublicCustomerPortalRoutes(options?: PublicCustome
|
|
|
124
125
|
output: {
|
|
125
126
|
data: {
|
|
126
127
|
userId: string;
|
|
127
|
-
email: string;
|
|
128
|
+
email: string | null;
|
|
128
129
|
emailVerified: boolean;
|
|
129
130
|
firstName: string | null;
|
|
130
131
|
middleName: string | null;
|
|
@@ -179,6 +180,7 @@ export declare function createPublicCustomerPortalRoutes(options?: PublicCustome
|
|
|
179
180
|
relation: string | null;
|
|
180
181
|
status: string;
|
|
181
182
|
} | null;
|
|
183
|
+
phoneNumber?: string | null | undefined;
|
|
182
184
|
};
|
|
183
185
|
};
|
|
184
186
|
outputFormat: "json";
|
|
@@ -213,7 +215,7 @@ export declare function createPublicCustomerPortalRoutes(options?: PublicCustome
|
|
|
213
215
|
output: {
|
|
214
216
|
data: {
|
|
215
217
|
userId: string;
|
|
216
|
-
email: string;
|
|
218
|
+
email: string | null;
|
|
217
219
|
emailVerified: boolean;
|
|
218
220
|
firstName: string | null;
|
|
219
221
|
middleName: string | null;
|
|
@@ -268,6 +270,7 @@ export declare function createPublicCustomerPortalRoutes(options?: PublicCustome
|
|
|
268
270
|
relation: string | null;
|
|
269
271
|
status: string;
|
|
270
272
|
} | null;
|
|
273
|
+
phoneNumber?: string | null | undefined;
|
|
271
274
|
};
|
|
272
275
|
};
|
|
273
276
|
outputFormat: "json";
|
|
@@ -456,7 +459,7 @@ export declare function createPublicCustomerPortalRoutes(options?: PublicCustome
|
|
|
456
459
|
status: "already_linked" | "linked_existing_customer" | "created_customer" | "customer_selection_required";
|
|
457
460
|
profile: {
|
|
458
461
|
userId: string;
|
|
459
|
-
email: string;
|
|
462
|
+
email: string | null;
|
|
460
463
|
emailVerified: boolean;
|
|
461
464
|
firstName: string | null;
|
|
462
465
|
middleName: string | null;
|
|
@@ -511,6 +514,7 @@ export declare function createPublicCustomerPortalRoutes(options?: PublicCustome
|
|
|
511
514
|
relation: string | null;
|
|
512
515
|
status: string;
|
|
513
516
|
} | null;
|
|
517
|
+
phoneNumber?: string | null | undefined;
|
|
514
518
|
} | null;
|
|
515
519
|
candidates: {
|
|
516
520
|
id: string;
|
|
@@ -970,7 +974,7 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
|
|
|
970
974
|
output: {
|
|
971
975
|
data: {
|
|
972
976
|
userId: string;
|
|
973
|
-
email: string;
|
|
977
|
+
email: string | null;
|
|
974
978
|
emailVerified: boolean;
|
|
975
979
|
firstName: string | null;
|
|
976
980
|
middleName: string | null;
|
|
@@ -1025,6 +1029,7 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
|
|
|
1025
1029
|
relation: string | null;
|
|
1026
1030
|
status: string;
|
|
1027
1031
|
} | null;
|
|
1032
|
+
phoneNumber?: string | null | undefined;
|
|
1028
1033
|
};
|
|
1029
1034
|
};
|
|
1030
1035
|
outputFormat: "json";
|
|
@@ -1076,7 +1081,7 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
|
|
|
1076
1081
|
output: {
|
|
1077
1082
|
data: {
|
|
1078
1083
|
userId: string;
|
|
1079
|
-
email: string;
|
|
1084
|
+
email: string | null;
|
|
1080
1085
|
emailVerified: boolean;
|
|
1081
1086
|
firstName: string | null;
|
|
1082
1087
|
middleName: string | null;
|
|
@@ -1131,6 +1136,7 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
|
|
|
1131
1136
|
relation: string | null;
|
|
1132
1137
|
status: string;
|
|
1133
1138
|
} | null;
|
|
1139
|
+
phoneNumber?: string | null | undefined;
|
|
1134
1140
|
};
|
|
1135
1141
|
};
|
|
1136
1142
|
outputFormat: "json";
|
|
@@ -1165,7 +1171,7 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
|
|
|
1165
1171
|
output: {
|
|
1166
1172
|
data: {
|
|
1167
1173
|
userId: string;
|
|
1168
|
-
email: string;
|
|
1174
|
+
email: string | null;
|
|
1169
1175
|
emailVerified: boolean;
|
|
1170
1176
|
firstName: string | null;
|
|
1171
1177
|
middleName: string | null;
|
|
@@ -1220,6 +1226,7 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
|
|
|
1220
1226
|
relation: string | null;
|
|
1221
1227
|
status: string;
|
|
1222
1228
|
} | null;
|
|
1229
|
+
phoneNumber?: string | null | undefined;
|
|
1223
1230
|
};
|
|
1224
1231
|
};
|
|
1225
1232
|
outputFormat: "json";
|
|
@@ -1408,7 +1415,7 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
|
|
|
1408
1415
|
status: "already_linked" | "linked_existing_customer" | "created_customer" | "customer_selection_required";
|
|
1409
1416
|
profile: {
|
|
1410
1417
|
userId: string;
|
|
1411
|
-
email: string;
|
|
1418
|
+
email: string | null;
|
|
1412
1419
|
emailVerified: boolean;
|
|
1413
1420
|
firstName: string | null;
|
|
1414
1421
|
middleName: string | null;
|
|
@@ -1463,6 +1470,7 @@ export declare const publicCustomerPortalRoutes: import("hono/hono-base").HonoBa
|
|
|
1463
1470
|
relation: string | null;
|
|
1464
1471
|
status: string;
|
|
1465
1472
|
} | null;
|
|
1473
|
+
phoneNumber?: string | null | undefined;
|
|
1466
1474
|
} | null;
|
|
1467
1475
|
candidates: {
|
|
1468
1476
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes-public.d.ts","sourceRoot":"","sources":["../src/routes-public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAoBjE,KAAK,GAAG,GAAG;IACT,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,SAAS,EAAE;QACT,SAAS,CAAC,EAAE,eAAe,CAAA;QAC3B,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAoBD,MAAM,WAAW,gCAAgC;IAC/C,0BAA0B,CAAC,EAAE,CAC3B,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;CAC5C;AAED,wBAAgB,gCAAgC,CAAC,OAAO,GAAE,gCAAqC
|
|
1
|
+
{"version":3,"file":"routes-public.d.ts","sourceRoot":"","sources":["../src/routes-public.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAoBjE,KAAK,GAAG,GAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAAqC,CAAA;AAE5E,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-public.d.ts","sourceRoot":"","sources":["../src/service-public.ts"],"names":[],"mappings":"AAwBA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAA;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,KAAK,EACV,4BAA4B,EAC5B,6BAA6B,EAC7B,kCAAkC,EAGlC,2BAA2B,EAK3B,4BAA4B,EAE5B,uBAAuB,EACvB,iCAAiC,EACjC,sCAAsC,EACtC,qBAAqB,EACrB,yCAAyC,EACzC,0CAA0C,EAE1C,kCAAkC,EAClC,gCAAgC,EACjC,MAAM,wBAAwB,CAAA;AAQ/B,UAAU,4BAA4B;IACpC,GAAG,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IACxB,0BAA0B,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;CAC5F;AAsGD,KAAK,gBAAgB,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"service-public.d.ts","sourceRoot":"","sources":["../src/service-public.ts"],"names":[],"mappings":"AAwBA,OAAO,EAGL,KAAK,WAAW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,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QAC1B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QAC5B,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KACtB,YACS,4BAA4B;;;;;;;;;;;;;;yBA2BlC,kBAAkB,UACd,MAAM,cACF,MAAM,SACX;QACL,IAAI,CAAC,EAAE,gBAAgB,CAAA;QACvB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QACtB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QAChC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QAC1B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QAC5B,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KACtB,YACS,4BAA4B;;;;;;;;;;;;;;yBA0Bb,kBAAkB,UAAU,MAAM,cAAc,MAAM;;;6BAW3E,kBAAkB,UACd,MAAM,cACF,MAAM,YACR,4BAA4B;;;;;;;;;;;;;;CAWzC,CAAA"}
|
package/dist/service-public.js
CHANGED
|
@@ -767,7 +767,7 @@ async function upsertCustomerBillingAddress(db, personId, input) {
|
|
|
767
767
|
}
|
|
768
768
|
async function getAccessibleBookingIds(db, params) {
|
|
769
769
|
const linkedPersonId = await resolveLinkedCustomerRecordId(db, params.userId);
|
|
770
|
-
const email = params.email
|
|
770
|
+
const email = params.email?.trim().toLowerCase() ?? null;
|
|
771
771
|
const [directBookingRows, participantPersonRows, participantEmailRows] = await Promise.all([
|
|
772
772
|
linkedPersonId
|
|
773
773
|
? db
|
|
@@ -781,18 +781,27 @@ async function getAccessibleBookingIds(db, params) {
|
|
|
781
781
|
.from(bookingTravelers)
|
|
782
782
|
.where(eq(bookingTravelers.personId, linkedPersonId))
|
|
783
783
|
: Promise.resolve([]),
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
784
|
+
// Phone-only users have no email to match on — fall back to linked-person matching only.
|
|
785
|
+
email
|
|
786
|
+
? db
|
|
787
|
+
.select({ bookingId: bookingTravelers.bookingId })
|
|
788
|
+
.from(bookingTravelers)
|
|
789
|
+
.where(sql `lower(${bookingTravelers.email}) = ${email}`)
|
|
790
|
+
: Promise.resolve([]),
|
|
788
791
|
]);
|
|
789
792
|
return Array.from(new Set([...directBookingRows, ...participantPersonRows, ...participantEmailRows].map((row) => row.bookingId)));
|
|
790
793
|
}
|
|
791
794
|
async function hasBookingAccess(params) {
|
|
792
|
-
const ownershipConditions = [
|
|
795
|
+
const ownershipConditions = [];
|
|
796
|
+
if (params.authEmail) {
|
|
797
|
+
ownershipConditions.push(sql `lower(${bookingTravelers.email}) = ${params.authEmail}`);
|
|
798
|
+
}
|
|
793
799
|
if (params.linkedPersonId) {
|
|
794
800
|
ownershipConditions.push(eq(bookingTravelers.personId, params.linkedPersonId));
|
|
795
801
|
}
|
|
802
|
+
if (ownershipConditions.length === 0) {
|
|
803
|
+
return false;
|
|
804
|
+
}
|
|
796
805
|
const [participantMatch, bookingMatch] = await Promise.all([
|
|
797
806
|
params.db
|
|
798
807
|
.select({ bookingId: bookingTravelers.bookingId })
|
|
@@ -1256,7 +1265,10 @@ export const publicCustomerPortalService = {
|
|
|
1256
1265
|
candidates: [],
|
|
1257
1266
|
};
|
|
1258
1267
|
}
|
|
1259
|
-
|
|
1268
|
+
// Phone-only signups have no email; email-keyed candidate
|
|
1269
|
+
// matching simply finds zero candidates and the path falls
|
|
1270
|
+
// through to creating a fresh `crm.people` row when allowed.
|
|
1271
|
+
const normalizedEmail = authProfile.email ? normalizeEmail(authProfile.email) : null;
|
|
1260
1272
|
const nextFirstName = input.firstName ?? authProfile.firstName ?? authProfile.name.split(" ")[0] ?? "Customer";
|
|
1261
1273
|
const nextLastName = input.lastName ?? authProfile.lastName ?? authProfile.name.split(" ").slice(1).join(" ") ?? "";
|
|
1262
1274
|
if (input.marketingConsent !== undefined || input.marketingConsentSource !== undefined) {
|
|
@@ -1324,7 +1336,9 @@ export const publicCustomerPortalService = {
|
|
|
1324
1336
|
candidates: [],
|
|
1325
1337
|
};
|
|
1326
1338
|
}
|
|
1327
|
-
const customerCandidates =
|
|
1339
|
+
const customerCandidates = normalizedEmail
|
|
1340
|
+
? await listCustomerRecordCandidatesByEmail(db, normalizedEmail)
|
|
1341
|
+
: [];
|
|
1328
1342
|
const selectableCandidates = customerCandidates.filter((candidate) => !candidate.claimedByAnotherUser);
|
|
1329
1343
|
if (selectableCandidates.length > 0) {
|
|
1330
1344
|
return {
|
|
@@ -1652,7 +1666,7 @@ export const publicCustomerPortalService = {
|
|
|
1652
1666
|
resolveLinkedCustomerRecordId(db, userId),
|
|
1653
1667
|
getCustomerRecord(db, userId),
|
|
1654
1668
|
]);
|
|
1655
|
-
const authEmail = authProfile.email
|
|
1669
|
+
const authEmail = authProfile.email?.trim().toLowerCase() ?? null;
|
|
1656
1670
|
const canAccess = await hasBookingAccess({
|
|
1657
1671
|
db,
|
|
1658
1672
|
bookingId,
|
|
@@ -1682,7 +1696,7 @@ export const publicCustomerPortalService = {
|
|
|
1682
1696
|
db,
|
|
1683
1697
|
bookingId,
|
|
1684
1698
|
userId,
|
|
1685
|
-
authEmail: authProfile.email
|
|
1699
|
+
authEmail: authProfile.email?.trim().toLowerCase() ?? null,
|
|
1686
1700
|
linkedPersonId,
|
|
1687
1701
|
});
|
|
1688
1702
|
if (!canAccess) {
|
|
@@ -110,7 +110,8 @@ export declare const customerPortalBootstrapCandidateSchema: z.ZodObject<{
|
|
|
110
110
|
}, z.core.$strip>;
|
|
111
111
|
export declare const customerPortalProfileSchema: z.ZodObject<{
|
|
112
112
|
userId: z.ZodString;
|
|
113
|
-
email: z.ZodString
|
|
113
|
+
email: z.ZodNullable<z.ZodString>;
|
|
114
|
+
phoneNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
115
|
emailVerified: z.ZodBoolean;
|
|
115
116
|
firstName: z.ZodNullable<z.ZodString>;
|
|
116
117
|
middleName: z.ZodNullable<z.ZodString>;
|
|
@@ -377,7 +378,8 @@ export declare const bootstrapCustomerPortalResultSchema: z.ZodObject<{
|
|
|
377
378
|
}>;
|
|
378
379
|
profile: z.ZodNullable<z.ZodObject<{
|
|
379
380
|
userId: z.ZodString;
|
|
380
|
-
email: z.ZodString
|
|
381
|
+
email: z.ZodNullable<z.ZodString>;
|
|
382
|
+
phoneNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
381
383
|
emailVerified: z.ZodBoolean;
|
|
382
384
|
firstName: z.ZodNullable<z.ZodString>;
|
|
383
385
|
middleName: z.ZodNullable<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-public.d.ts","sourceRoot":"","sources":["../src/validation-public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAgJvB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;iBAWtC,CAAA;AAEF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;iBAc1C,CAAA;AAEJ,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYrC,CAAA;AAEF,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGjD,CAAA;AAEF,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"validation-public.d.ts","sourceRoot":"","sources":["../src/validation-public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM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AA4C,CACpD,CAAA;AACD,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAC7F,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAA;AACnG,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA"}
|
|
@@ -177,7 +177,10 @@ export const customerPortalBootstrapCandidateSchema = customerPortalRecordSchema
|
|
|
177
177
|
});
|
|
178
178
|
export const customerPortalProfileSchema = z.object({
|
|
179
179
|
userId: z.string(),
|
|
180
|
-
|
|
180
|
+
// null for phone-only signups; check constraint on auth.user
|
|
181
|
+
// guarantees email or phoneNumber is set, not both required.
|
|
182
|
+
email: z.string().email().nullable(),
|
|
183
|
+
phoneNumber: z.string().nullable().optional(),
|
|
181
184
|
emailVerified: z.boolean(),
|
|
182
185
|
firstName: z.string().nullable(),
|
|
183
186
|
middleName: z.string().nullable(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/customer-portal",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"drizzle-orm": "^0.45.2",
|
|
35
35
|
"hono": "^4.12.10",
|
|
36
36
|
"zod": "^4.3.6",
|
|
37
|
-
"@voyantjs/bookings": "0.26.
|
|
38
|
-
"@voyantjs/core": "0.26.
|
|
39
|
-
"@voyantjs/crm": "0.26.
|
|
40
|
-
"@voyantjs/db": "0.26.
|
|
41
|
-
"@voyantjs/finance": "0.26.
|
|
42
|
-
"@voyantjs/hono": "0.26.
|
|
43
|
-
"@voyantjs/identity": "0.26.
|
|
44
|
-
"@voyantjs/legal": "0.26.
|
|
45
|
-
"@voyantjs/utils": "0.26.
|
|
37
|
+
"@voyantjs/bookings": "0.26.3",
|
|
38
|
+
"@voyantjs/core": "0.26.3",
|
|
39
|
+
"@voyantjs/crm": "0.26.3",
|
|
40
|
+
"@voyantjs/db": "0.26.3",
|
|
41
|
+
"@voyantjs/finance": "0.26.3",
|
|
42
|
+
"@voyantjs/hono": "0.26.3",
|
|
43
|
+
"@voyantjs/identity": "0.26.3",
|
|
44
|
+
"@voyantjs/legal": "0.26.3",
|
|
45
|
+
"@voyantjs/utils": "0.26.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"typescript": "^6.0.2",
|