@bizmap/sdk 0.0.81 → 0.0.83
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 +98 -17
- package/dist/main.js +48 -5
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -63,6 +63,11 @@ declare const paymentMethods: z.ZodEnum<{
|
|
|
63
63
|
insurance: "insurance";
|
|
64
64
|
}>;
|
|
65
65
|
type PaymentMethod = z.infer<typeof paymentMethods>;
|
|
66
|
+
declare const genders: z.ZodEnum<{
|
|
67
|
+
male: "male";
|
|
68
|
+
female: "female";
|
|
69
|
+
}>;
|
|
70
|
+
type Gender = z.infer<typeof genders>;
|
|
66
71
|
|
|
67
72
|
declare const vitalKeys: z.ZodEnum<{
|
|
68
73
|
heartRate: "heartRate";
|
|
@@ -1079,12 +1084,26 @@ declare const ClientIdentity: z.ZodObject<{
|
|
|
1079
1084
|
version: z.ZodInt;
|
|
1080
1085
|
_id: z.ZodUUID;
|
|
1081
1086
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
1082
|
-
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1083
1087
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1084
|
-
|
|
1085
|
-
|
|
1088
|
+
firstName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1089
|
+
middleName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1090
|
+
lastName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1086
1091
|
email: z.ZodOptional<z.ZodEmail>;
|
|
1087
|
-
dob: z.
|
|
1092
|
+
dob: z.ZodInt;
|
|
1093
|
+
sex: z.ZodEnum<{
|
|
1094
|
+
male: "male";
|
|
1095
|
+
female: "female";
|
|
1096
|
+
}>;
|
|
1097
|
+
isGlobal: z.ZodBoolean;
|
|
1098
|
+
origin: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1099
|
+
attributes: z.ZodObject<{
|
|
1100
|
+
mothersMaidenName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1101
|
+
fathersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1102
|
+
mothersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1103
|
+
oldestSiblingMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1104
|
+
firstSchoolName: z.ZodOptional<z.ZodString>;
|
|
1105
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
1106
|
+
}, z.core.$strip>;
|
|
1088
1107
|
address: z.ZodOptional<z.ZodObject<{
|
|
1089
1108
|
streetAddress: z.ZodString;
|
|
1090
1109
|
city: z.ZodOptional<z.ZodString>;
|
|
@@ -1094,6 +1113,25 @@ declare const ClientIdentity: z.ZodObject<{
|
|
|
1094
1113
|
linkedTo: z.ZodOptional<z.ZodUUID>;
|
|
1095
1114
|
}, z.core.$strip>;
|
|
1096
1115
|
type ClientIdentity = z.infer<typeof ClientIdentity>;
|
|
1116
|
+
declare const ClientForm: z.ZodObject<{
|
|
1117
|
+
firstName: z.ZodNonOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1118
|
+
lastName: z.ZodNonOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1119
|
+
middleName: z.ZodNonOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1120
|
+
dob: z.ZodNonOptional<z.ZodInt>;
|
|
1121
|
+
sex: z.ZodNonOptional<z.ZodEnum<{
|
|
1122
|
+
male: "male";
|
|
1123
|
+
female: "female";
|
|
1124
|
+
}>>;
|
|
1125
|
+
attributes: z.ZodNonOptional<z.ZodObject<{
|
|
1126
|
+
mothersMaidenName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1127
|
+
fathersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1128
|
+
mothersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1129
|
+
oldestSiblingMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1130
|
+
firstSchoolName: z.ZodOptional<z.ZodString>;
|
|
1131
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
1132
|
+
}, z.core.$strip>>;
|
|
1133
|
+
}, z.core.$strip>;
|
|
1134
|
+
type ClientForm = z.infer<typeof ClientForm>;
|
|
1097
1135
|
|
|
1098
1136
|
declare const MiniAppointmentDetails: z.ZodObject<{
|
|
1099
1137
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
@@ -1225,6 +1263,7 @@ declare const MiniAppointmentDetails: z.ZodObject<{
|
|
|
1225
1263
|
}>;
|
|
1226
1264
|
amount: z.ZodNumber;
|
|
1227
1265
|
}, z.core.$strip>>>>;
|
|
1266
|
+
lockedBy: z.ZodOptional<z.ZodUUID>;
|
|
1228
1267
|
timeline: z.ZodObject<{
|
|
1229
1268
|
scheduler: z.ZodObject<{
|
|
1230
1269
|
postedAt: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -1374,6 +1413,7 @@ declare const AppointmentDetails: z.ZodObject<{
|
|
|
1374
1413
|
}>;
|
|
1375
1414
|
amount: z.ZodNumber;
|
|
1376
1415
|
}, z.core.$strip>>>>;
|
|
1416
|
+
lockedBy: z.ZodOptional<z.ZodUUID>;
|
|
1377
1417
|
timeline: z.ZodObject<{
|
|
1378
1418
|
scheduler: z.ZodObject<{
|
|
1379
1419
|
postedAt: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -1398,12 +1438,26 @@ declare const AppointmentDetails: z.ZodObject<{
|
|
|
1398
1438
|
version: z.ZodInt;
|
|
1399
1439
|
_id: z.ZodUUID;
|
|
1400
1440
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
1401
|
-
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1402
1441
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1403
|
-
|
|
1404
|
-
|
|
1442
|
+
firstName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1443
|
+
middleName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1444
|
+
lastName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1405
1445
|
email: z.ZodOptional<z.ZodEmail>;
|
|
1406
|
-
dob: z.
|
|
1446
|
+
dob: z.ZodInt;
|
|
1447
|
+
sex: z.ZodEnum<{
|
|
1448
|
+
male: "male";
|
|
1449
|
+
female: "female";
|
|
1450
|
+
}>;
|
|
1451
|
+
isGlobal: z.ZodBoolean;
|
|
1452
|
+
origin: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1453
|
+
attributes: z.ZodObject<{
|
|
1454
|
+
mothersMaidenName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1455
|
+
fathersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1456
|
+
mothersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1457
|
+
oldestSiblingMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1458
|
+
firstSchoolName: z.ZodOptional<z.ZodString>;
|
|
1459
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
1460
|
+
}, z.core.$strip>;
|
|
1407
1461
|
address: z.ZodOptional<z.ZodObject<{
|
|
1408
1462
|
streetAddress: z.ZodString;
|
|
1409
1463
|
city: z.ZodOptional<z.ZodString>;
|
|
@@ -1543,6 +1597,7 @@ declare const MutableAppointmentDetails: z.ZodObject<{
|
|
|
1543
1597
|
}>;
|
|
1544
1598
|
amount: z.ZodNumber;
|
|
1545
1599
|
}, z.core.$strip>>>>;
|
|
1600
|
+
lockedBy: z.ZodOptional<z.ZodUUID>;
|
|
1546
1601
|
timeline: z.ZodObject<{
|
|
1547
1602
|
scheduler: z.ZodObject<{
|
|
1548
1603
|
postedAt: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -1567,12 +1622,26 @@ declare const MutableAppointmentDetails: z.ZodObject<{
|
|
|
1567
1622
|
version: z.ZodInt;
|
|
1568
1623
|
_id: z.ZodUUID;
|
|
1569
1624
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
1570
|
-
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1571
1625
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1572
|
-
|
|
1573
|
-
|
|
1626
|
+
firstName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1627
|
+
middleName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1628
|
+
lastName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1574
1629
|
email: z.ZodOptional<z.ZodEmail>;
|
|
1575
|
-
dob: z.
|
|
1630
|
+
dob: z.ZodInt;
|
|
1631
|
+
sex: z.ZodEnum<{
|
|
1632
|
+
male: "male";
|
|
1633
|
+
female: "female";
|
|
1634
|
+
}>;
|
|
1635
|
+
isGlobal: z.ZodBoolean;
|
|
1636
|
+
origin: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1637
|
+
attributes: z.ZodObject<{
|
|
1638
|
+
mothersMaidenName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1639
|
+
fathersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1640
|
+
mothersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1641
|
+
oldestSiblingMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1642
|
+
firstSchoolName: z.ZodOptional<z.ZodString>;
|
|
1643
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
1644
|
+
}, z.core.$strip>;
|
|
1576
1645
|
address: z.ZodOptional<z.ZodObject<{
|
|
1577
1646
|
streetAddress: z.ZodString;
|
|
1578
1647
|
city: z.ZodOptional<z.ZodString>;
|
|
@@ -1774,14 +1843,25 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1774
1843
|
createdAt: number;
|
|
1775
1844
|
version: number;
|
|
1776
1845
|
_id: string;
|
|
1777
|
-
|
|
1846
|
+
firstName: string;
|
|
1847
|
+
middleName: string;
|
|
1848
|
+
lastName: string;
|
|
1849
|
+
dob: number;
|
|
1850
|
+
sex: "male" | "female";
|
|
1851
|
+
isGlobal: boolean;
|
|
1852
|
+
origin: string;
|
|
1853
|
+
attributes: {
|
|
1854
|
+
mothersMaidenName?: string | undefined;
|
|
1855
|
+
fathersMiddleName?: string | undefined;
|
|
1856
|
+
mothersMiddleName?: string | undefined;
|
|
1857
|
+
oldestSiblingMiddleName?: string | undefined;
|
|
1858
|
+
firstSchoolName?: string | undefined;
|
|
1859
|
+
nickname?: string | undefined;
|
|
1860
|
+
};
|
|
1778
1861
|
lastModified?: number | null | undefined;
|
|
1779
1862
|
phoneNumber?: string | undefined;
|
|
1780
1863
|
photoUrl?: string | null | undefined;
|
|
1781
|
-
companyUids?: string[] | undefined;
|
|
1782
|
-
resumeToken?: string | undefined;
|
|
1783
1864
|
email?: string | undefined;
|
|
1784
|
-
dob?: number | undefined;
|
|
1785
1865
|
address?: {
|
|
1786
1866
|
streetAddress: string;
|
|
1787
1867
|
parish: string;
|
|
@@ -1838,6 +1918,7 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1838
1918
|
amount: number;
|
|
1839
1919
|
lastModified?: number | null | undefined;
|
|
1840
1920
|
}[] | null | undefined;
|
|
1921
|
+
lockedBy?: string | undefined;
|
|
1841
1922
|
};
|
|
1842
1923
|
}>;
|
|
1843
1924
|
|
|
@@ -1900,4 +1981,4 @@ declare function createNotifId(options?: {
|
|
|
1900
1981
|
to: string;
|
|
1901
1982
|
}): string;
|
|
1902
1983
|
|
|
1903
|
-
export { AppointmentDetails, type AppointmentDistAlg, ClientIdentity, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyInviteList, CompanyNotifications, type CompanyPartnerRole, CompanyPreferences, type CompanyServiceSelector, CompanyStaff, CompanyState, type CompanyType, CompanyUser, type CompanyUserRole, CompanyUserSession, type CompanyUserStatus, CreateCompanyForm, CreditCurrency, type EmployeeRole, type HealthcareProviderRole, InviteResponse, InvoiceNo, MedicalDetails, Medicine, MiniAppointmentDetails, MiniCompanyUser, MutableAppointmentDetails, MutableCompanyBilling, MutableCompanyDetails, MutableCompanyIdentity, MutableCompanyPreferences, Notification, type PaymentMethod, PriceAdjustment, PriceTag, Reason, Receipts, ScheduleAppointmentForm, StandardTime, TicketNo, type Tier, TierList, TimeLog, Timestamp, UserDetails, Version, Vitals, adminRoles, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyTypes, companyUserRoles, companyUserStatus, createNotifId, employeeRoles, findAvailableStaff, findConflictingPartners, findNextAvailableStaff, getCompatibleRoles, healthcareProviderRoles, normalizeCompanyId, paymentMethods, scheduleAppointment, serviceProviders, tiers, vitalKeys };
|
|
1984
|
+
export { AppointmentDetails, type AppointmentDistAlg, ClientForm, ClientIdentity, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyInviteList, CompanyNotifications, type CompanyPartnerRole, CompanyPreferences, type CompanyServiceSelector, CompanyStaff, CompanyState, type CompanyType, CompanyUser, type CompanyUserRole, CompanyUserSession, type CompanyUserStatus, CreateCompanyForm, CreditCurrency, type EmployeeRole, type Gender, type HealthcareProviderRole, InviteResponse, InvoiceNo, MedicalDetails, Medicine, MiniAppointmentDetails, MiniCompanyUser, MutableAppointmentDetails, MutableCompanyBilling, MutableCompanyDetails, MutableCompanyIdentity, MutableCompanyPreferences, Notification, type PaymentMethod, PriceAdjustment, PriceTag, Reason, Receipts, ScheduleAppointmentForm, StandardTime, TicketNo, type Tier, TierList, TimeLog, Timestamp, UserDetails, Version, Vitals, adminRoles, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyTypes, companyUserRoles, companyUserStatus, createNotifId, employeeRoles, findAvailableStaff, findConflictingPartners, findNextAvailableStaff, genders, getCompatibleRoles, healthcareProviderRoles, normalizeCompanyId, paymentMethods, scheduleAppointment, serviceProviders, tiers, vitalKeys };
|
package/dist/main.js
CHANGED
|
@@ -27,6 +27,7 @@ var companyUserStatus = z.enum(["inviteSent", "active", "inactive"]);
|
|
|
27
27
|
import * as z2 from "zod";
|
|
28
28
|
var tiers = z2.enum(["basic", "pro", "premium", "gold"]);
|
|
29
29
|
var paymentMethods = z2.enum(["cash", "card", "insurance"]);
|
|
30
|
+
var genders = z2.enum(["male", "female"]);
|
|
30
31
|
|
|
31
32
|
// src/enums/Medical.ts
|
|
32
33
|
import * as z3 from "zod";
|
|
@@ -680,21 +681,59 @@ var MedicalDetails = z19.object({
|
|
|
680
681
|
// src/schemas/profiles/Client.ts
|
|
681
682
|
import * as z20 from "zod";
|
|
682
683
|
import { Address as Address2 } from "@wavy/util";
|
|
683
|
-
var
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
684
|
+
var Name = z20.string().trim().min(2).transform((d) => d.replace(/-+/g, "-").replace(/'+/g, "'")).superRefine((data, ctx) => {
|
|
685
|
+
const invalidCharIdx = data.search(/[^a-z'-]/i);
|
|
686
|
+
if (invalidCharIdx >= 0) {
|
|
687
|
+
const char = data[invalidCharIdx].includes('"') ? `(${data[invalidCharIdx]})` : `"${data[invalidCharIdx]}"`;
|
|
688
|
+
ctx.addIssue(`${char} is not an allowed character.`);
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
var ClientIdentity = UserDetails.pick({
|
|
692
|
+
_id: true,
|
|
693
|
+
createdAt: true,
|
|
694
|
+
lastModified: true,
|
|
695
|
+
phoneNumber: true,
|
|
696
|
+
version: true,
|
|
697
|
+
photoUrl: true
|
|
687
698
|
}).safeExtend(
|
|
688
699
|
z20.object({
|
|
700
|
+
firstName: Name,
|
|
701
|
+
middleName: Name,
|
|
702
|
+
lastName: Name,
|
|
689
703
|
email: UserDetails.shape.email.optional(),
|
|
690
|
-
dob: Timestamp
|
|
704
|
+
dob: Timestamp,
|
|
705
|
+
sex: genders,
|
|
706
|
+
isGlobal: z20.boolean(),
|
|
707
|
+
origin: CompanyIdentity.shape._id,
|
|
708
|
+
// Don't hash the attributes, they can be used to help accurately identify a client by whoever is searching for
|
|
709
|
+
// the client
|
|
710
|
+
attributes: z20.object({
|
|
711
|
+
mothersMaidenName: Name,
|
|
712
|
+
fathersMiddleName: Name,
|
|
713
|
+
mothersMiddleName: Name,
|
|
714
|
+
oldestSiblingMiddleName: Name,
|
|
715
|
+
firstSchoolName: z20.string().trim().min(3).max(60),
|
|
716
|
+
nickname: z20.string().trim().min(1).max(40)
|
|
717
|
+
}).partial().refine(
|
|
718
|
+
(data) => Object.keys(data).length > 0,
|
|
719
|
+
"At least (1) attribute must be defined."
|
|
720
|
+
),
|
|
691
721
|
address: Address2.optional(),
|
|
692
722
|
linkedTo: UserDetails.shape._id.optional()
|
|
693
723
|
}).shape
|
|
694
724
|
);
|
|
725
|
+
var ClientForm = ClientIdentity.pick({
|
|
726
|
+
firstName: true,
|
|
727
|
+
middleName: true,
|
|
728
|
+
lastName: true,
|
|
729
|
+
dob: true,
|
|
730
|
+
sex: true,
|
|
731
|
+
attributes: true
|
|
732
|
+
}).required();
|
|
695
733
|
|
|
696
734
|
// src/schemas/appointment/Appointment.ts
|
|
697
735
|
import * as z21 from "zod";
|
|
736
|
+
import { UserDetails as UserDetails2 } from "src/main";
|
|
698
737
|
var TimelineActivity = z21.object({
|
|
699
738
|
postedAt: Timestamp.nullish(),
|
|
700
739
|
userUid: CompanyUser.shape._id.nonoptional()
|
|
@@ -751,6 +790,8 @@ var MiniAppointmentDetails = z21.object({
|
|
|
751
790
|
...TimeLog.shape
|
|
752
791
|
})
|
|
753
792
|
).max(100).nullish(),
|
|
793
|
+
// The user that is currently modifying the appointment
|
|
794
|
+
lockedBy: UserDetails2.shape._id.optional(),
|
|
754
795
|
timeline: z21.object({
|
|
755
796
|
scheduler: TimelineActivity,
|
|
756
797
|
physAsst: TimelineActivity.or(z21.literal("none")),
|
|
@@ -970,6 +1011,7 @@ function createNotifId(options) {
|
|
|
970
1011
|
}
|
|
971
1012
|
export {
|
|
972
1013
|
AppointmentDetails,
|
|
1014
|
+
ClientForm,
|
|
973
1015
|
ClientIdentity,
|
|
974
1016
|
CompanyBilling,
|
|
975
1017
|
CompanyDetails,
|
|
@@ -1020,6 +1062,7 @@ export {
|
|
|
1020
1062
|
findAvailableStaff,
|
|
1021
1063
|
findConflictingPartners,
|
|
1022
1064
|
findNextAvailableStaff,
|
|
1065
|
+
genders,
|
|
1023
1066
|
getCompatibleRoles,
|
|
1024
1067
|
healthcareProviderRoles,
|
|
1025
1068
|
normalizeCompanyId,
|