@bizmap/sdk 0.0.50 → 0.0.52
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/main.d.ts +45 -6
- package/dist/main.js +27 -5
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -92,6 +92,8 @@ declare const CompanyUser: z.ZodObject<{
|
|
|
92
92
|
isBusy: z.ZodBoolean;
|
|
93
93
|
appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
94
94
|
lastActive: z.ZodInt;
|
|
95
|
+
inviteSent: z.ZodInt;
|
|
96
|
+
inviteAccepted: z.ZodInt;
|
|
95
97
|
name: z.ZodRecord<z.ZodEnum<{
|
|
96
98
|
first: "first";
|
|
97
99
|
last: "last";
|
|
@@ -101,6 +103,17 @@ declare const CompanyUser: z.ZodObject<{
|
|
|
101
103
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
102
104
|
}, z.core.$strip>;
|
|
103
105
|
type CompanyUser = z.infer<typeof CompanyUser>;
|
|
106
|
+
/** (email) -> user config */
|
|
107
|
+
declare const CompanyInviteList: z.ZodRecord<z.ZodEmail, z.ZodObject<{
|
|
108
|
+
createdAt: z.ZodInt;
|
|
109
|
+
roles: z.ZodArray<z.ZodEnum<{
|
|
110
|
+
doc: "doc";
|
|
111
|
+
physAsst: "physAsst";
|
|
112
|
+
rcpst: "rcpst";
|
|
113
|
+
cshr: "cshr";
|
|
114
|
+
}>>;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
type CompanyInviteList = z.infer<typeof CompanyInviteList>;
|
|
104
117
|
declare const CompanyDetails: z.ZodObject<{
|
|
105
118
|
uid: z.ZodReadonly<z.ZodString>;
|
|
106
119
|
identity: z.ZodObject<{
|
|
@@ -133,7 +146,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
133
146
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
134
147
|
}, z.core.$strip>;
|
|
135
148
|
notifications: z.ZodArray<z.ZodObject<{
|
|
136
|
-
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
149
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE" | "ALERT">;
|
|
137
150
|
payload: z.ZodString;
|
|
138
151
|
seen: z.ZodBoolean;
|
|
139
152
|
src: z.ZodObject<{
|
|
@@ -143,7 +156,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
143
156
|
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
144
157
|
createdAt: z.ZodInt;
|
|
145
158
|
}, z.core.$strip>> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
146
|
-
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
159
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE" | "ALERT">;
|
|
147
160
|
payload: z.ZodString;
|
|
148
161
|
seen: z.ZodBoolean;
|
|
149
162
|
src: z.ZodObject<{
|
|
@@ -279,6 +292,8 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
279
292
|
isBusy: z.ZodBoolean;
|
|
280
293
|
appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
281
294
|
lastActive: z.ZodInt;
|
|
295
|
+
inviteSent: z.ZodInt;
|
|
296
|
+
inviteAccepted: z.ZodInt;
|
|
282
297
|
name: z.ZodRecord<z.ZodEnum<{
|
|
283
298
|
first: "first";
|
|
284
299
|
last: "last";
|
|
@@ -319,6 +334,8 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
319
334
|
isBusy: boolean;
|
|
320
335
|
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
321
336
|
lastActive: number;
|
|
337
|
+
inviteSent: number;
|
|
338
|
+
inviteAccepted: number;
|
|
322
339
|
name: Record<"first" | "last", string>;
|
|
323
340
|
email: string;
|
|
324
341
|
lastModified?: number | null | undefined;
|
|
@@ -351,6 +368,8 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
351
368
|
isBusy: boolean;
|
|
352
369
|
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
353
370
|
lastActive: number;
|
|
371
|
+
inviteSent: number;
|
|
372
|
+
inviteAccepted: number;
|
|
354
373
|
name: Record<"first" | "last", string>;
|
|
355
374
|
email: string;
|
|
356
375
|
lastModified?: number | null | undefined;
|
|
@@ -394,6 +413,8 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
394
413
|
isBusy: z.ZodBoolean;
|
|
395
414
|
appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
396
415
|
lastActive: z.ZodInt;
|
|
416
|
+
inviteSent: z.ZodInt;
|
|
417
|
+
inviteAccepted: z.ZodInt;
|
|
397
418
|
name: z.ZodRecord<z.ZodEnum<{
|
|
398
419
|
first: "first";
|
|
399
420
|
last: "last";
|
|
@@ -434,6 +455,8 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
434
455
|
isBusy: boolean;
|
|
435
456
|
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
436
457
|
lastActive: number;
|
|
458
|
+
inviteSent: number;
|
|
459
|
+
inviteAccepted: number;
|
|
437
460
|
name: Record<"first" | "last", string>;
|
|
438
461
|
email: string;
|
|
439
462
|
lastModified?: number | null | undefined;
|
|
@@ -466,6 +489,8 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
466
489
|
isBusy: boolean;
|
|
467
490
|
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
468
491
|
lastActive: number;
|
|
492
|
+
inviteSent: number;
|
|
493
|
+
inviteAccepted: number;
|
|
469
494
|
name: Record<"first" | "last", string>;
|
|
470
495
|
email: string;
|
|
471
496
|
lastModified?: number | null | undefined;
|
|
@@ -521,7 +546,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
521
546
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
522
547
|
}, z.core.$strip>;
|
|
523
548
|
notifications: z.ZodArray<z.ZodObject<{
|
|
524
|
-
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
549
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE" | "ALERT">;
|
|
525
550
|
payload: z.ZodString;
|
|
526
551
|
seen: z.ZodBoolean;
|
|
527
552
|
src: z.ZodObject<{
|
|
@@ -531,7 +556,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
531
556
|
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
532
557
|
createdAt: z.ZodInt;
|
|
533
558
|
}, z.core.$strip>> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
534
|
-
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
559
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE" | "ALERT">;
|
|
535
560
|
payload: z.ZodString;
|
|
536
561
|
seen: z.ZodBoolean;
|
|
537
562
|
src: z.ZodObject<{
|
|
@@ -667,6 +692,8 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
667
692
|
isBusy: z.ZodBoolean;
|
|
668
693
|
appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
669
694
|
lastActive: z.ZodInt;
|
|
695
|
+
inviteSent: z.ZodInt;
|
|
696
|
+
inviteAccepted: z.ZodInt;
|
|
670
697
|
name: z.ZodRecord<z.ZodEnum<{
|
|
671
698
|
first: "first";
|
|
672
699
|
last: "last";
|
|
@@ -707,6 +734,8 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
707
734
|
isBusy: boolean;
|
|
708
735
|
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
709
736
|
lastActive: number;
|
|
737
|
+
inviteSent: number;
|
|
738
|
+
inviteAccepted: number;
|
|
710
739
|
name: Record<"first" | "last", string>;
|
|
711
740
|
email: string;
|
|
712
741
|
lastModified?: number | null | undefined;
|
|
@@ -739,6 +768,8 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
739
768
|
isBusy: boolean;
|
|
740
769
|
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
741
770
|
lastActive: number;
|
|
771
|
+
inviteSent: number;
|
|
772
|
+
inviteAccepted: number;
|
|
742
773
|
name: Record<"first" | "last", string>;
|
|
743
774
|
email: string;
|
|
744
775
|
lastModified?: number | null | undefined;
|
|
@@ -782,6 +813,8 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
782
813
|
isBusy: z.ZodBoolean;
|
|
783
814
|
appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
784
815
|
lastActive: z.ZodInt;
|
|
816
|
+
inviteSent: z.ZodInt;
|
|
817
|
+
inviteAccepted: z.ZodInt;
|
|
785
818
|
name: z.ZodRecord<z.ZodEnum<{
|
|
786
819
|
first: "first";
|
|
787
820
|
last: "last";
|
|
@@ -822,6 +855,8 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
822
855
|
isBusy: boolean;
|
|
823
856
|
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
824
857
|
lastActive: number;
|
|
858
|
+
inviteSent: number;
|
|
859
|
+
inviteAccepted: number;
|
|
825
860
|
name: Record<"first" | "last", string>;
|
|
826
861
|
email: string;
|
|
827
862
|
lastModified?: number | null | undefined;
|
|
@@ -854,6 +889,8 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
854
889
|
isBusy: boolean;
|
|
855
890
|
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
856
891
|
lastActive: number;
|
|
892
|
+
inviteSent: number;
|
|
893
|
+
inviteAccepted: number;
|
|
857
894
|
name: Record<"first" | "last", string>;
|
|
858
895
|
email: string;
|
|
859
896
|
lastModified?: number | null | undefined;
|
|
@@ -889,7 +926,7 @@ declare const TierList: z.ZodRecord<z.ZodEnum<{
|
|
|
889
926
|
}, z.core.$strip>>;
|
|
890
927
|
type TierList = z.infer<typeof TierList>;
|
|
891
928
|
declare const Notification: z.ZodObject<{
|
|
892
|
-
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
929
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE" | "ALERT">;
|
|
893
930
|
payload: z.ZodString;
|
|
894
931
|
seen: z.ZodBoolean;
|
|
895
932
|
src: z.ZodObject<{
|
|
@@ -931,6 +968,8 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
|
|
|
931
968
|
isBusy: boolean;
|
|
932
969
|
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
933
970
|
lastActive: number;
|
|
971
|
+
inviteSent: number;
|
|
972
|
+
inviteAccepted: number;
|
|
934
973
|
name: Record<"first" | "last", string>;
|
|
935
974
|
email: string;
|
|
936
975
|
lastModified?: number | null | undefined;
|
|
@@ -940,4 +979,4 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
|
|
|
940
979
|
/**@returns the roles that are compatible with the selected role. */
|
|
941
980
|
declare const getCompatibleRoles: (role: CompanyUserRole) => CompanyUserRole[];
|
|
942
981
|
|
|
943
|
-
export { type AppointmentDistAlg, CompanyDetails, type CompanyPartnerRole, type CompanyServiceSelector, CompanyUser, type CompanyUserRole, type EmployeeRole, type HealthcareProviderRole, InviteResponse, InvoiceNo, Jwt, Notification, PartialCompanyDetails, PriceAdjustment, PriceTag, PricingRate, StandardTime, type Tier, TierList, TimeLog, Timestamp, UuidV4, UuidV7, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyUserRoles, employeeRoles, findConflictingPartners, getCompatibleRoles, healthcareProviderRoles, tiers };
|
|
982
|
+
export { type AppointmentDistAlg, CompanyDetails, CompanyInviteList, type CompanyPartnerRole, type CompanyServiceSelector, CompanyUser, type CompanyUserRole, type EmployeeRole, type HealthcareProviderRole, InviteResponse, InvoiceNo, Jwt, Notification, PartialCompanyDetails, PriceAdjustment, PriceTag, PricingRate, StandardTime, type Tier, TierList, TimeLog, Timestamp, UuidV4, UuidV7, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyUserRoles, employeeRoles, findConflictingPartners, getCompatibleRoles, healthcareProviderRoles, tiers };
|
package/dist/main.js
CHANGED
|
@@ -99,7 +99,12 @@ var TierList = z5.record(
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
var Notification = z5.object({
|
|
102
|
-
code: z5.literal([
|
|
102
|
+
code: z5.literal([
|
|
103
|
+
"COMPANY_INVITE",
|
|
104
|
+
"INVITE_RESPONSE",
|
|
105
|
+
"DEV_MESSAGE",
|
|
106
|
+
"ALERT"
|
|
107
|
+
]),
|
|
103
108
|
payload: z5.string(),
|
|
104
109
|
seen: z5.boolean(),
|
|
105
110
|
src: z5.object({
|
|
@@ -109,6 +114,11 @@ var Notification = z5.object({
|
|
|
109
114
|
expiresAt: Timestamp.nullish(),
|
|
110
115
|
createdAt: Timestamp
|
|
111
116
|
}).superRefine((data, ctx) => {
|
|
117
|
+
const expectMessage = () => {
|
|
118
|
+
if ((data.payload?.length ?? 0) < 3) {
|
|
119
|
+
ctx.addIssue("The payload must have at least (3) characters.");
|
|
120
|
+
}
|
|
121
|
+
};
|
|
112
122
|
switch (data.code) {
|
|
113
123
|
case "COMPANY_INVITE":
|
|
114
124
|
if (!Jwt.safeParse(data.payload).success) {
|
|
@@ -116,9 +126,10 @@ var Notification = z5.object({
|
|
|
116
126
|
}
|
|
117
127
|
break;
|
|
118
128
|
case "DEV_MESSAGE":
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
129
|
+
expectMessage();
|
|
130
|
+
break;
|
|
131
|
+
case "ALERT":
|
|
132
|
+
expectMessage();
|
|
122
133
|
break;
|
|
123
134
|
case "INVITE_RESPONSE":
|
|
124
135
|
if (!InviteResponse.safeParse(data.payload).success) {
|
|
@@ -190,6 +201,8 @@ var CompanyUser = z6.object({
|
|
|
190
201
|
z6.int().min(0)
|
|
191
202
|
),
|
|
192
203
|
lastActive: Timestamp,
|
|
204
|
+
inviteSent: Timestamp,
|
|
205
|
+
inviteAccepted: Timestamp,
|
|
193
206
|
...TimeLog.shape
|
|
194
207
|
}).superRefine((data, ctx) => {
|
|
195
208
|
if (!data.availability.isAvailable && data.status !== "active") {
|
|
@@ -201,6 +214,10 @@ var CompanyUser = z6.object({
|
|
|
201
214
|
);
|
|
202
215
|
}
|
|
203
216
|
});
|
|
217
|
+
var CompanyInviteList = z6.record(
|
|
218
|
+
CompanyUser.shape.email,
|
|
219
|
+
z6.object({ createdAt: Timestamp, roles: z6.array(employeeRoles) })
|
|
220
|
+
);
|
|
204
221
|
var CompanyIdentity = z6.object({
|
|
205
222
|
displayName: z6.string().min(3).max(25),
|
|
206
223
|
logo: z6.string().max(2500).nullish(),
|
|
@@ -356,12 +373,16 @@ var Staff = z6.object({
|
|
|
356
373
|
}
|
|
357
374
|
}
|
|
358
375
|
});
|
|
376
|
+
var CompanyNotifications = z6.array(Notification).refine(
|
|
377
|
+
(data) => data.every((notif) => notif.code !== "COMPANY_INVITE"),
|
|
378
|
+
"A company can't receive a company invite."
|
|
379
|
+
);
|
|
359
380
|
var Receipts = z6.array(PriceTag.omit({ uid: true, lastModified: true }));
|
|
360
381
|
var createCompanyDetails = (options) => {
|
|
361
382
|
return z6.object({
|
|
362
383
|
uid: UuidV7,
|
|
363
384
|
identity: CompanyIdentity,
|
|
364
|
-
notifications: options.partial ?
|
|
385
|
+
notifications: options.partial ? CompanyNotifications.nullish() : CompanyNotifications,
|
|
365
386
|
receipts: options.partial ? Receipts.nullish() : Receipts,
|
|
366
387
|
state: options.partial ? CompanyState.nullish() : CompanyState,
|
|
367
388
|
preferences: options.partial ? CompanyPreferences.nullish() : CompanyPreferences,
|
|
@@ -374,6 +395,7 @@ var CompanyDetails = createCompanyDetails({ partial: false });
|
|
|
374
395
|
var PartialCompanyDetails = createCompanyDetails({ partial: true });
|
|
375
396
|
export {
|
|
376
397
|
CompanyDetails,
|
|
398
|
+
CompanyInviteList,
|
|
377
399
|
CompanyUser,
|
|
378
400
|
InviteResponse,
|
|
379
401
|
InvoiceNo,
|