@bizmap/sdk 0.0.80 → 0.0.82
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 +76 -18
- package/dist/main.js +37 -7
- 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";
|
|
@@ -751,13 +756,13 @@ type CompanyState = z.infer<typeof CompanyState>;
|
|
|
751
756
|
|
|
752
757
|
declare const CompanyUserSession: z.ZodObject<{
|
|
753
758
|
_id: z.ZodUUID;
|
|
754
|
-
srcIp: z.ZodString;
|
|
755
759
|
user: z.ZodObject<{
|
|
756
760
|
_id: z.ZodUUID;
|
|
757
761
|
email: z.ZodEmail;
|
|
758
762
|
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
759
763
|
}, z.core.$strip>;
|
|
760
764
|
companyId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
765
|
+
deviceId: z.ZodString;
|
|
761
766
|
isAvailable: z.ZodObject<{
|
|
762
767
|
value: z.ZodBoolean;
|
|
763
768
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
@@ -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>;
|
|
@@ -1398,12 +1417,26 @@ declare const AppointmentDetails: z.ZodObject<{
|
|
|
1398
1417
|
version: z.ZodInt;
|
|
1399
1418
|
_id: z.ZodUUID;
|
|
1400
1419
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
1401
|
-
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1402
1420
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1403
|
-
|
|
1404
|
-
|
|
1421
|
+
firstName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1422
|
+
middleName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1423
|
+
lastName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1405
1424
|
email: z.ZodOptional<z.ZodEmail>;
|
|
1406
|
-
dob: z.
|
|
1425
|
+
dob: z.ZodInt;
|
|
1426
|
+
sex: z.ZodEnum<{
|
|
1427
|
+
male: "male";
|
|
1428
|
+
female: "female";
|
|
1429
|
+
}>;
|
|
1430
|
+
isGlobal: z.ZodBoolean;
|
|
1431
|
+
origin: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1432
|
+
attributes: z.ZodObject<{
|
|
1433
|
+
mothersMaidenName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1434
|
+
fathersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1435
|
+
mothersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1436
|
+
oldestSiblingMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1437
|
+
firstSchoolName: z.ZodOptional<z.ZodString>;
|
|
1438
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
1439
|
+
}, z.core.$strip>;
|
|
1407
1440
|
address: z.ZodOptional<z.ZodObject<{
|
|
1408
1441
|
streetAddress: z.ZodString;
|
|
1409
1442
|
city: z.ZodOptional<z.ZodString>;
|
|
@@ -1567,12 +1600,26 @@ declare const MutableAppointmentDetails: z.ZodObject<{
|
|
|
1567
1600
|
version: z.ZodInt;
|
|
1568
1601
|
_id: z.ZodUUID;
|
|
1569
1602
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
1570
|
-
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1571
1603
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1572
|
-
|
|
1573
|
-
|
|
1604
|
+
firstName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1605
|
+
middleName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1606
|
+
lastName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1574
1607
|
email: z.ZodOptional<z.ZodEmail>;
|
|
1575
|
-
dob: z.
|
|
1608
|
+
dob: z.ZodInt;
|
|
1609
|
+
sex: z.ZodEnum<{
|
|
1610
|
+
male: "male";
|
|
1611
|
+
female: "female";
|
|
1612
|
+
}>;
|
|
1613
|
+
isGlobal: z.ZodBoolean;
|
|
1614
|
+
origin: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1615
|
+
attributes: z.ZodObject<{
|
|
1616
|
+
mothersMaidenName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1617
|
+
fathersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1618
|
+
mothersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1619
|
+
oldestSiblingMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1620
|
+
firstSchoolName: z.ZodOptional<z.ZodString>;
|
|
1621
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
1622
|
+
}, z.core.$strip>;
|
|
1576
1623
|
address: z.ZodOptional<z.ZodObject<{
|
|
1577
1624
|
streetAddress: z.ZodString;
|
|
1578
1625
|
city: z.ZodOptional<z.ZodString>;
|
|
@@ -1774,14 +1821,25 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1774
1821
|
createdAt: number;
|
|
1775
1822
|
version: number;
|
|
1776
1823
|
_id: string;
|
|
1777
|
-
|
|
1824
|
+
firstName: string;
|
|
1825
|
+
middleName: string;
|
|
1826
|
+
lastName: string;
|
|
1827
|
+
dob: number;
|
|
1828
|
+
sex: "male" | "female";
|
|
1829
|
+
isGlobal: boolean;
|
|
1830
|
+
origin: string;
|
|
1831
|
+
attributes: {
|
|
1832
|
+
mothersMaidenName?: string | undefined;
|
|
1833
|
+
fathersMiddleName?: string | undefined;
|
|
1834
|
+
mothersMiddleName?: string | undefined;
|
|
1835
|
+
oldestSiblingMiddleName?: string | undefined;
|
|
1836
|
+
firstSchoolName?: string | undefined;
|
|
1837
|
+
nickname?: string | undefined;
|
|
1838
|
+
};
|
|
1778
1839
|
lastModified?: number | null | undefined;
|
|
1779
1840
|
phoneNumber?: string | undefined;
|
|
1780
1841
|
photoUrl?: string | null | undefined;
|
|
1781
|
-
companyUids?: string[] | undefined;
|
|
1782
|
-
resumeToken?: string | undefined;
|
|
1783
1842
|
email?: string | undefined;
|
|
1784
|
-
dob?: number | undefined;
|
|
1785
1843
|
address?: {
|
|
1786
1844
|
streetAddress: string;
|
|
1787
1845
|
parish: string;
|
|
@@ -1900,4 +1958,4 @@ declare function createNotifId(options?: {
|
|
|
1900
1958
|
to: string;
|
|
1901
1959
|
}): string;
|
|
1902
1960
|
|
|
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 };
|
|
1961
|
+
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 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";
|
|
@@ -456,9 +457,9 @@ var UserDetails = z13.object({
|
|
|
456
457
|
// src/schemas/company/components/User.ts
|
|
457
458
|
var CompanyUserSession = z14.object({
|
|
458
459
|
_id: z14.uuidv4(),
|
|
459
|
-
srcIp: z14.string(),
|
|
460
460
|
user: UserDetails.pick({ _id: true, name: true, email: true }),
|
|
461
461
|
companyId: CompanyState.shape._id,
|
|
462
|
+
deviceId: z14.string().trim().min(15),
|
|
462
463
|
isAvailable: z14.object({
|
|
463
464
|
value: z14.boolean(),
|
|
464
465
|
lastModified: Timestamp.nullable()
|
|
@@ -479,7 +480,6 @@ var CompanyUserSession = z14.object({
|
|
|
479
480
|
(role, i) => i === 0 || getCompatibleRoles(roles[0]).includes(role)
|
|
480
481
|
);
|
|
481
482
|
}, "A user is not allowed to have conflicting roles."),
|
|
482
|
-
/** Stored in millis */
|
|
483
483
|
ttl: z14.number(),
|
|
484
484
|
lastModified: Timestamp.nullable(),
|
|
485
485
|
expiresAfter: z14.date()
|
|
@@ -681,14 +681,43 @@ var MedicalDetails = z19.object({
|
|
|
681
681
|
// src/schemas/profiles/Client.ts
|
|
682
682
|
import * as z20 from "zod";
|
|
683
683
|
import { Address as Address2 } from "@wavy/util";
|
|
684
|
-
var
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
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
|
|
688
698
|
}).safeExtend(
|
|
689
699
|
z20.object({
|
|
700
|
+
firstName: Name,
|
|
701
|
+
middleName: Name,
|
|
702
|
+
lastName: Name,
|
|
690
703
|
email: UserDetails.shape.email.optional(),
|
|
691
|
-
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
|
+
),
|
|
692
721
|
address: Address2.optional(),
|
|
693
722
|
linkedTo: UserDetails.shape._id.optional()
|
|
694
723
|
}).shape
|
|
@@ -1021,6 +1050,7 @@ export {
|
|
|
1021
1050
|
findAvailableStaff,
|
|
1022
1051
|
findConflictingPartners,
|
|
1023
1052
|
findNextAvailableStaff,
|
|
1053
|
+
genders,
|
|
1024
1054
|
getCompatibleRoles,
|
|
1025
1055
|
healthcareProviderRoles,
|
|
1026
1056
|
normalizeCompanyId,
|