@bizmap/sdk 0.0.84 → 0.0.86
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 +35 -6
- package/dist/main.js +13 -5
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -68,6 +68,12 @@ declare const genders: z.ZodEnum<{
|
|
|
68
68
|
female: "female";
|
|
69
69
|
}>;
|
|
70
70
|
type Gender = z.infer<typeof genders>;
|
|
71
|
+
declare const nidClasses: z.ZodEnum<{
|
|
72
|
+
passportNo: "passportNo";
|
|
73
|
+
trn: "trn";
|
|
74
|
+
nin: "nin";
|
|
75
|
+
}>;
|
|
76
|
+
type NidClass = z.infer<typeof nidClasses>;
|
|
71
77
|
|
|
72
78
|
declare const vitalKeys: z.ZodEnum<{
|
|
73
79
|
heartRate: "heartRate";
|
|
@@ -1096,13 +1102,20 @@ declare const ClientIdentity: z.ZodObject<{
|
|
|
1096
1102
|
}>;
|
|
1097
1103
|
isGlobal: z.ZodBoolean;
|
|
1098
1104
|
origin: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1105
|
+
nid: z.ZodOptional<z.ZodObject<{
|
|
1106
|
+
class: z.ZodEnum<{
|
|
1107
|
+
passportNo: "passportNo";
|
|
1108
|
+
trn: "trn";
|
|
1109
|
+
nin: "nin";
|
|
1110
|
+
}>;
|
|
1111
|
+
value: z.ZodString;
|
|
1112
|
+
}, z.core.$strip>>;
|
|
1099
1113
|
attributes: z.ZodObject<{
|
|
1100
1114
|
mothersMaidenName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1101
1115
|
fathersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1102
1116
|
mothersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1103
1117
|
oldestSiblingMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1104
1118
|
firstSchoolName: z.ZodOptional<z.ZodString>;
|
|
1105
|
-
nickname: z.ZodOptional<z.ZodString>;
|
|
1106
1119
|
}, z.core.$strip>;
|
|
1107
1120
|
address: z.ZodOptional<z.ZodObject<{
|
|
1108
1121
|
streetAddress: z.ZodString;
|
|
@@ -1128,7 +1141,6 @@ declare const ClientForm: z.ZodObject<{
|
|
|
1128
1141
|
mothersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1129
1142
|
oldestSiblingMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1130
1143
|
firstSchoolName: z.ZodOptional<z.ZodString>;
|
|
1131
|
-
nickname: z.ZodOptional<z.ZodString>;
|
|
1132
1144
|
}, z.core.$strip>>;
|
|
1133
1145
|
}, z.core.$strip>;
|
|
1134
1146
|
type ClientForm = z.infer<typeof ClientForm>;
|
|
@@ -1450,13 +1462,20 @@ declare const AppointmentDetails: z.ZodObject<{
|
|
|
1450
1462
|
}>;
|
|
1451
1463
|
isGlobal: z.ZodBoolean;
|
|
1452
1464
|
origin: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1465
|
+
nid: z.ZodOptional<z.ZodObject<{
|
|
1466
|
+
class: z.ZodEnum<{
|
|
1467
|
+
passportNo: "passportNo";
|
|
1468
|
+
trn: "trn";
|
|
1469
|
+
nin: "nin";
|
|
1470
|
+
}>;
|
|
1471
|
+
value: z.ZodString;
|
|
1472
|
+
}, z.core.$strip>>;
|
|
1453
1473
|
attributes: z.ZodObject<{
|
|
1454
1474
|
mothersMaidenName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1455
1475
|
fathersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1456
1476
|
mothersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1457
1477
|
oldestSiblingMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1458
1478
|
firstSchoolName: z.ZodOptional<z.ZodString>;
|
|
1459
|
-
nickname: z.ZodOptional<z.ZodString>;
|
|
1460
1479
|
}, z.core.$strip>;
|
|
1461
1480
|
address: z.ZodOptional<z.ZodObject<{
|
|
1462
1481
|
streetAddress: z.ZodString;
|
|
@@ -1634,13 +1653,20 @@ declare const MutableAppointmentDetails: z.ZodObject<{
|
|
|
1634
1653
|
}>;
|
|
1635
1654
|
isGlobal: z.ZodBoolean;
|
|
1636
1655
|
origin: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1656
|
+
nid: z.ZodOptional<z.ZodObject<{
|
|
1657
|
+
class: z.ZodEnum<{
|
|
1658
|
+
passportNo: "passportNo";
|
|
1659
|
+
trn: "trn";
|
|
1660
|
+
nin: "nin";
|
|
1661
|
+
}>;
|
|
1662
|
+
value: z.ZodString;
|
|
1663
|
+
}, z.core.$strip>>;
|
|
1637
1664
|
attributes: z.ZodObject<{
|
|
1638
1665
|
mothersMaidenName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1639
1666
|
fathersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1640
1667
|
mothersMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1641
1668
|
oldestSiblingMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1642
1669
|
firstSchoolName: z.ZodOptional<z.ZodString>;
|
|
1643
|
-
nickname: z.ZodOptional<z.ZodString>;
|
|
1644
1670
|
}, z.core.$strip>;
|
|
1645
1671
|
address: z.ZodOptional<z.ZodObject<{
|
|
1646
1672
|
streetAddress: z.ZodString;
|
|
@@ -1856,12 +1882,15 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1856
1882
|
mothersMiddleName?: string | undefined;
|
|
1857
1883
|
oldestSiblingMiddleName?: string | undefined;
|
|
1858
1884
|
firstSchoolName?: string | undefined;
|
|
1859
|
-
nickname?: string | undefined;
|
|
1860
1885
|
};
|
|
1861
1886
|
lastModified?: number | null | undefined;
|
|
1862
1887
|
phoneNumber?: string | undefined;
|
|
1863
1888
|
photoUrl?: string | null | undefined;
|
|
1864
1889
|
email?: string | undefined;
|
|
1890
|
+
nid?: {
|
|
1891
|
+
class: "passportNo" | "trn" | "nin";
|
|
1892
|
+
value: string;
|
|
1893
|
+
} | undefined;
|
|
1865
1894
|
address?: {
|
|
1866
1895
|
streetAddress: string;
|
|
1867
1896
|
parish: string;
|
|
@@ -1981,4 +2010,4 @@ declare function createNotifId(options?: {
|
|
|
1981
2010
|
to: string;
|
|
1982
2011
|
}): string;
|
|
1983
2012
|
|
|
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 };
|
|
2013
|
+
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, type NidClass, 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, nidClasses, normalizeCompanyId, paymentMethods, scheduleAppointment, serviceProviders, tiers, vitalKeys };
|
package/dist/main.js
CHANGED
|
@@ -28,6 +28,7 @@ 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
30
|
var genders = z2.enum(["male", "female"]);
|
|
31
|
+
var nidClasses = z2.enum(["passportNo", "trn", "nin"]);
|
|
31
32
|
|
|
32
33
|
// src/enums/Medical.ts
|
|
33
34
|
import * as z3 from "zod";
|
|
@@ -256,6 +257,7 @@ import * as z10 from "zod";
|
|
|
256
257
|
|
|
257
258
|
// src/constants.ts
|
|
258
259
|
var NOTIF_ID_DELIM = "::";
|
|
260
|
+
var MAX_NAME_LENGTH = 21;
|
|
259
261
|
|
|
260
262
|
// src/schemas/Global.ts
|
|
261
263
|
var TierList = z10.record(
|
|
@@ -440,8 +442,8 @@ var UserDetails = z13.object({
|
|
|
440
442
|
if (idx === 0 && name.length < 2) {
|
|
441
443
|
ctx.addIssue(`${nty} name must have at least (2) characters.`);
|
|
442
444
|
}
|
|
443
|
-
if (name.length >
|
|
444
|
-
ctx.addIssue(`${nty} name can't have more than (
|
|
445
|
+
if (name.length > MAX_NAME_LENGTH) {
|
|
446
|
+
ctx.addIssue(`${nty} name can't have more than (${MAX_NAME_LENGTH}) characters.`);
|
|
445
447
|
}
|
|
446
448
|
});
|
|
447
449
|
}),
|
|
@@ -681,7 +683,7 @@ var MedicalDetails = z19.object({
|
|
|
681
683
|
// src/schemas/profiles/Client.ts
|
|
682
684
|
import * as z20 from "zod";
|
|
683
685
|
import { Address as Address2 } from "@wavy/util";
|
|
684
|
-
var Name = z20.string().trim().min(2).transform((d) => d.replace(/-+/g, "-").replace(/'+/g, "'")).superRefine((data, ctx) => {
|
|
686
|
+
var Name = z20.string().trim().min(2).max(MAX_NAME_LENGTH).transform((d) => d.replace(/-+/g, "-").replace(/'+/g, "'")).superRefine((data, ctx) => {
|
|
685
687
|
const invalidCharIdx = data.search(/[^a-z'-]/i);
|
|
686
688
|
if (invalidCharIdx >= 0) {
|
|
687
689
|
const char = data[invalidCharIdx].includes('"') ? `(${data[invalidCharIdx]})` : `"${data[invalidCharIdx]}"`;
|
|
@@ -705,6 +707,11 @@ var ClientIdentity = UserDetails.pick({
|
|
|
705
707
|
sex: genders,
|
|
706
708
|
isGlobal: z20.boolean(),
|
|
707
709
|
origin: CompanyIdentity.shape._id,
|
|
710
|
+
nid: z20.object({
|
|
711
|
+
class: nidClasses,
|
|
712
|
+
// Hash this value
|
|
713
|
+
value: z20.string()
|
|
714
|
+
}).optional(),
|
|
708
715
|
// Don't hash the attributes, they can be used to help accurately identify a client by whoever is searching for
|
|
709
716
|
// the client
|
|
710
717
|
attributes: z20.object({
|
|
@@ -712,8 +719,8 @@ var ClientIdentity = UserDetails.pick({
|
|
|
712
719
|
fathersMiddleName: Name,
|
|
713
720
|
mothersMiddleName: Name,
|
|
714
721
|
oldestSiblingMiddleName: Name,
|
|
715
|
-
firstSchoolName: z20.string().trim().min(3).max(60)
|
|
716
|
-
nickname:
|
|
722
|
+
firstSchoolName: z20.string().trim().min(3).max(60)
|
|
723
|
+
// nickname: z.string().trim().min(1).max(40),
|
|
717
724
|
}).partial().refine(
|
|
718
725
|
(data) => Object.keys(data).length > 0,
|
|
719
726
|
"At least (1) attribute must be defined."
|
|
@@ -1064,6 +1071,7 @@ export {
|
|
|
1064
1071
|
genders,
|
|
1065
1072
|
getCompatibleRoles,
|
|
1066
1073
|
healthcareProviderRoles,
|
|
1074
|
+
nidClasses,
|
|
1067
1075
|
normalizeCompanyId,
|
|
1068
1076
|
paymentMethods,
|
|
1069
1077
|
scheduleAppointment,
|