@bizmap/sdk 0.0.85 → 0.0.87
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 +36 -6
- package/dist/main.js +16 -3
- 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;
|
|
@@ -1975,10 +2004,11 @@ declare const findConflictingPartners: (...partners: (CompanyUser | MiniCompanyU
|
|
|
1975
2004
|
* */
|
|
1976
2005
|
declare const getCompatibleRoles: (role: CompanyUserRole) => CompanyUserRole[];
|
|
1977
2006
|
declare const normalizeCompanyId: (id: string) => string;
|
|
2007
|
+
declare const normalizeNidClass: (value: NidClass) => string;
|
|
1978
2008
|
|
|
1979
2009
|
declare function createNotifId(options?: {
|
|
1980
2010
|
from: string;
|
|
1981
2011
|
to: string;
|
|
1982
2012
|
}): string;
|
|
1983
2013
|
|
|
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 };
|
|
2014
|
+
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, normalizeNidClass, 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";
|
|
@@ -392,7 +393,7 @@ import * as z15 from "zod";
|
|
|
392
393
|
import * as z14 from "zod";
|
|
393
394
|
|
|
394
395
|
// src/functions/helper-functions.ts
|
|
395
|
-
import { upperFirst as upperFirst2 } from "@wavy/fn";
|
|
396
|
+
import { camelCaseToLetter, upperFirst as upperFirst2 } from "@wavy/fn";
|
|
396
397
|
var findConflictingPartners = (...partners) => {
|
|
397
398
|
let hasSingleDoctor = false;
|
|
398
399
|
const conflicts = [];
|
|
@@ -425,6 +426,11 @@ var getCompatibleRoles = (role) => {
|
|
|
425
426
|
var normalizeCompanyId = (id) => {
|
|
426
427
|
return id.split("-").map((value) => upperFirst2(value.toLowerCase())).join(" ");
|
|
427
428
|
};
|
|
429
|
+
var normalizeNidClass = (value) => {
|
|
430
|
+
value = nidClasses.parse(value);
|
|
431
|
+
if (value === "nin") return "National Id No.";
|
|
432
|
+
return camelCaseToLetter(value.replace("No", "No."));
|
|
433
|
+
};
|
|
428
434
|
|
|
429
435
|
// src/schemas/profiles/User.ts
|
|
430
436
|
import { UserModel } from "@wavy/util";
|
|
@@ -706,6 +712,11 @@ var ClientIdentity = UserDetails.pick({
|
|
|
706
712
|
sex: genders,
|
|
707
713
|
isGlobal: z20.boolean(),
|
|
708
714
|
origin: CompanyIdentity.shape._id,
|
|
715
|
+
nid: z20.object({
|
|
716
|
+
class: nidClasses,
|
|
717
|
+
// Hash this value
|
|
718
|
+
value: z20.string()
|
|
719
|
+
}).optional(),
|
|
709
720
|
// Don't hash the attributes, they can be used to help accurately identify a client by whoever is searching for
|
|
710
721
|
// the client
|
|
711
722
|
attributes: z20.object({
|
|
@@ -713,8 +724,8 @@ var ClientIdentity = UserDetails.pick({
|
|
|
713
724
|
fathersMiddleName: Name,
|
|
714
725
|
mothersMiddleName: Name,
|
|
715
726
|
oldestSiblingMiddleName: Name,
|
|
716
|
-
firstSchoolName: z20.string().trim().min(3).max(60)
|
|
717
|
-
nickname:
|
|
727
|
+
firstSchoolName: z20.string().trim().min(3).max(60)
|
|
728
|
+
// nickname: z.string().trim().min(1).max(40),
|
|
718
729
|
}).partial().refine(
|
|
719
730
|
(data) => Object.keys(data).length > 0,
|
|
720
731
|
"At least (1) attribute must be defined."
|
|
@@ -1065,7 +1076,9 @@ export {
|
|
|
1065
1076
|
genders,
|
|
1066
1077
|
getCompatibleRoles,
|
|
1067
1078
|
healthcareProviderRoles,
|
|
1079
|
+
nidClasses,
|
|
1068
1080
|
normalizeCompanyId,
|
|
1081
|
+
normalizeNidClass,
|
|
1069
1082
|
paymentMethods,
|
|
1070
1083
|
scheduleAppointment,
|
|
1071
1084
|
serviceProviders,
|