@bizmap/sdk 0.0.23 → 0.0.25
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 +21 -15
- package/dist/main.js +24 -8
- package/package.json +4 -1
package/dist/main.d.ts
CHANGED
|
@@ -53,6 +53,8 @@ declare const CompanyOpState: z.ZodObject<{
|
|
|
53
53
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
54
54
|
uid: z.ZodReadonly<z.ZodString>;
|
|
55
55
|
availableBalance: z.ZodNumber;
|
|
56
|
+
invoiceNoRef: z.ZodString;
|
|
57
|
+
totalUploads: z.ZodNumber;
|
|
56
58
|
preferences: z.ZodObject<{
|
|
57
59
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
58
60
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -177,6 +179,7 @@ type CompanyRegistrationClaims = z.infer<typeof CompanyRegistrationClaims>;
|
|
|
177
179
|
declare const CompanyUser: z.ZodObject<{
|
|
178
180
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
179
181
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
182
|
+
uid: z.ZodReadonly<z.ZodString>;
|
|
180
183
|
status: z.ZodEnum<{
|
|
181
184
|
inviteSent: "inviteSent";
|
|
182
185
|
active: "active";
|
|
@@ -197,7 +200,6 @@ declare const CompanyUser: z.ZodObject<{
|
|
|
197
200
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
198
201
|
email: z.ZodEmail;
|
|
199
202
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
200
|
-
uid: z.ZodString;
|
|
201
203
|
}, z.core.$strip>;
|
|
202
204
|
type CompanyUser = z.infer<typeof CompanyUser>;
|
|
203
205
|
declare const _staffDetails: z.ZodObject<{
|
|
@@ -205,6 +207,7 @@ declare const _staffDetails: z.ZodObject<{
|
|
|
205
207
|
members: z.ZodArray<z.ZodObject<{
|
|
206
208
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
207
209
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
210
|
+
uid: z.ZodReadonly<z.ZodString>;
|
|
208
211
|
status: z.ZodEnum<{
|
|
209
212
|
inviteSent: "inviteSent";
|
|
210
213
|
active: "active";
|
|
@@ -225,10 +228,9 @@ declare const _staffDetails: z.ZodObject<{
|
|
|
225
228
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
226
229
|
email: z.ZodEmail;
|
|
227
230
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
228
|
-
uid: z.ZodString;
|
|
229
231
|
}, z.core.$strip>>;
|
|
230
|
-
partnerMap: z.ZodRecord<z.ZodString
|
|
231
|
-
blackList: z.ZodPipe<z.ZodArray<z.ZodString
|
|
232
|
+
partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>>;
|
|
233
|
+
blackList: z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>;
|
|
232
234
|
}, z.core.$strip>;
|
|
233
235
|
/** The unpacked Staff Details */
|
|
234
236
|
declare const StaffDetails: z.ZodPipe<z.ZodObject<{
|
|
@@ -236,6 +238,7 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
|
|
|
236
238
|
members: z.ZodArray<z.ZodObject<{
|
|
237
239
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
238
240
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
241
|
+
uid: z.ZodReadonly<z.ZodString>;
|
|
239
242
|
status: z.ZodEnum<{
|
|
240
243
|
inviteSent: "inviteSent";
|
|
241
244
|
active: "active";
|
|
@@ -256,20 +259,19 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
|
|
|
256
259
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
257
260
|
email: z.ZodEmail;
|
|
258
261
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
259
|
-
uid: z.ZodString;
|
|
260
262
|
}, z.core.$strip>>;
|
|
261
|
-
partnerMap: z.ZodRecord<z.ZodString
|
|
262
|
-
blackList: z.ZodPipe<z.ZodArray<z.ZodString
|
|
263
|
+
partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>>;
|
|
264
|
+
blackList: z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>;
|
|
263
265
|
}, z.core.$strip>, z.ZodTransform<{
|
|
264
266
|
uid: string;
|
|
265
267
|
members: {
|
|
266
268
|
createdAt: number;
|
|
269
|
+
uid: string;
|
|
267
270
|
status: "inviteSent" | "active" | "inactive";
|
|
268
271
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
269
272
|
lastActive: number;
|
|
270
273
|
name: Record<"first" | "last", string>;
|
|
271
274
|
email: string;
|
|
272
|
-
uid: string;
|
|
273
275
|
lastModified?: number | null | undefined;
|
|
274
276
|
photoUrl?: string | null | undefined;
|
|
275
277
|
phoneNumber?: string | undefined;
|
|
@@ -280,12 +282,12 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
|
|
|
280
282
|
uid: string;
|
|
281
283
|
members: {
|
|
282
284
|
createdAt: number;
|
|
285
|
+
uid: string;
|
|
283
286
|
status: "inviteSent" | "active" | "inactive";
|
|
284
287
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
285
288
|
lastActive: number;
|
|
286
289
|
name: Record<"first" | "last", string>;
|
|
287
290
|
email: string;
|
|
288
|
-
uid: string;
|
|
289
291
|
lastModified?: number | null | undefined;
|
|
290
292
|
photoUrl?: string | null | undefined;
|
|
291
293
|
phoneNumber?: string | undefined;
|
|
@@ -295,7 +297,7 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
|
|
|
295
297
|
}>>;
|
|
296
298
|
type StaffDetails = z.infer<typeof _staffDetails>;
|
|
297
299
|
declare const CompanyDetails: z.ZodObject<{
|
|
298
|
-
uid: z.ZodString
|
|
300
|
+
uid: z.ZodReadonly<z.ZodString>;
|
|
299
301
|
identity: z.ZodObject<{
|
|
300
302
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
301
303
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -320,7 +322,9 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
320
322
|
opState: z.ZodObject<{
|
|
321
323
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
322
324
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
325
|
+
invoiceNoRef: z.ZodString;
|
|
323
326
|
availableBalance: z.ZodNumber;
|
|
327
|
+
totalUploads: z.ZodNumber;
|
|
324
328
|
preferences: z.ZodObject<{
|
|
325
329
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
326
330
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -376,6 +380,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
376
380
|
members: z.ZodArray<z.ZodObject<{
|
|
377
381
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
378
382
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
383
|
+
uid: z.ZodReadonly<z.ZodString>;
|
|
379
384
|
status: z.ZodEnum<{
|
|
380
385
|
inviteSent: "inviteSent";
|
|
381
386
|
active: "active";
|
|
@@ -396,10 +401,9 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
396
401
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
397
402
|
email: z.ZodEmail;
|
|
398
403
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
399
|
-
uid: z.ZodString;
|
|
400
404
|
}, z.core.$strip>>;
|
|
401
|
-
partnerMap: z.ZodRecord<z.ZodString
|
|
402
|
-
blackList: z.ZodPipe<z.ZodArray<z.ZodString
|
|
405
|
+
partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>>;
|
|
406
|
+
blackList: z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>;
|
|
403
407
|
}, z.core.$strip>;
|
|
404
408
|
}, z.core.$strip>;
|
|
405
409
|
type CompanyDetails = z.infer<typeof CompanyDetails>;
|
|
@@ -409,6 +413,8 @@ declare const TimeLog: z.ZodObject<{
|
|
|
409
413
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
410
414
|
}, z.core.$strip>;
|
|
411
415
|
type TimeLog = z.infer<typeof TimeLog>;
|
|
416
|
+
declare const InvoiceNo: z.ZodString;
|
|
417
|
+
declare const UuidV7: z.ZodReadonly<z.ZodString>;
|
|
412
418
|
declare const Time: z.ZodString;
|
|
413
419
|
|
|
414
420
|
declare const companyUserRoles: z.ZodEnum<{
|
|
@@ -440,12 +446,12 @@ type AppointmentDistAlg = z.infer<typeof appointmentDistAlgs>;
|
|
|
440
446
|
/**@returns an array of the users that have conflicting roles or are incompatible with the other partners, or null if none was found. */
|
|
441
447
|
declare const findConflictingPartners: (...partners: CompanyUser[]) => {
|
|
442
448
|
createdAt: number;
|
|
449
|
+
uid: string;
|
|
443
450
|
status: "inviteSent" | "active" | "inactive";
|
|
444
451
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
445
452
|
lastActive: number;
|
|
446
453
|
name: Record<"first" | "last", string>;
|
|
447
454
|
email: string;
|
|
448
|
-
uid: string;
|
|
449
455
|
lastModified?: number | null | undefined;
|
|
450
456
|
photoUrl?: string | null | undefined;
|
|
451
457
|
phoneNumber?: string | undefined;
|
|
@@ -453,4 +459,4 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
|
|
|
453
459
|
/**@returns the roles that are compatible with the selected role. */
|
|
454
460
|
declare const getCompatibleRoles: (role: CompanyUserRole) => CompanyUserRole[];
|
|
455
461
|
|
|
456
|
-
export { type AppointmentDistAlg, CompanyBillingModel, CompanyDetails, CompanyIdentity, CompanyOpState, type CompanyPartnerRole, CompanyRegistrationClaims, CompanyUser, type CompanyUserRole, type EmployeeRole, PriceAdjustment, PriceTag, PricingRate, RegisterCompanyForm, StaffDetails, Time, TimeLog, appointmentDistAlgs, companyPartnerRoles, companyUserRoles, employeeRoles, findConflictingPartners, getCompatibleRoles };
|
|
462
|
+
export { type AppointmentDistAlg, CompanyBillingModel, CompanyDetails, CompanyIdentity, CompanyOpState, type CompanyPartnerRole, CompanyRegistrationClaims, CompanyUser, type CompanyUserRole, type EmployeeRole, InvoiceNo, PriceAdjustment, PriceTag, PricingRate, RegisterCompanyForm, StaffDetails, Time, TimeLog, UuidV7, appointmentDistAlgs, companyPartnerRoles, companyUserRoles, employeeRoles, findConflictingPartners, getCompatibleRoles };
|
package/dist/main.js
CHANGED
|
@@ -2,13 +2,19 @@
|
|
|
2
2
|
import * as z2 from "zod";
|
|
3
3
|
|
|
4
4
|
// src/schemas/utils.ts
|
|
5
|
+
import { validate, version } from "uuid";
|
|
5
6
|
import * as z from "zod";
|
|
6
7
|
var TimeLog = z.object({
|
|
7
8
|
createdAt: z.number().readonly(),
|
|
8
9
|
lastModified: z.number().nullish()
|
|
9
10
|
});
|
|
10
|
-
var
|
|
11
|
-
|
|
11
|
+
var InvoiceNo = z.string().regex(
|
|
12
|
+
/^[0-9]{4}-(01|(0[2-9])|(1[0-2]))-(30|31|([1-2][0-9])|0[1-9])-[0-9]{7}/,
|
|
13
|
+
'An invoice no. must match the pattern "yyyy-mm-dd-9999999".'
|
|
14
|
+
);
|
|
15
|
+
var UuidV7 = z.string().readonly().refine((uid) => validate(uid) && version(uid) === 7, "Invalid uuid.");
|
|
16
|
+
var Time = z.string().regex(/^(01|(0[2-9])|(1[0-2])):(([1-5][0-9])|0[0-9]) (am|pm)/i, {
|
|
17
|
+
error: "A time must match the pattern hh:mm A."
|
|
12
18
|
});
|
|
13
19
|
|
|
14
20
|
// src/schemas/Billing.ts
|
|
@@ -61,7 +67,7 @@ var appointmentDistAlgs = z3.enum(["RR", "LOR"]);
|
|
|
61
67
|
|
|
62
68
|
// src/schemas/Company.ts
|
|
63
69
|
var CompanyIdentity = z4.object({
|
|
64
|
-
uid:
|
|
70
|
+
uid: UuidV7,
|
|
65
71
|
// The company's uid
|
|
66
72
|
displayName: z4.string(),
|
|
67
73
|
logo: z4.string().nullish(),
|
|
@@ -80,9 +86,16 @@ var CompanyIdentity = z4.object({
|
|
|
80
86
|
});
|
|
81
87
|
var CompanyOpState = z4.object({
|
|
82
88
|
// The company's uid
|
|
83
|
-
uid:
|
|
89
|
+
uid: UuidV7,
|
|
84
90
|
// This can only be changed by the server/app admin
|
|
85
91
|
availableBalance: z4.number(),
|
|
92
|
+
/** A counter for the company's invoice numbers. */
|
|
93
|
+
invoiceNoRef: InvoiceNo,
|
|
94
|
+
/**
|
|
95
|
+
* The total amount of uploads made by an admin.
|
|
96
|
+
* @note - This should be refreshed daily.
|
|
97
|
+
*/
|
|
98
|
+
totalUploads: z4.number(),
|
|
86
99
|
// This can be changed by the company's admin
|
|
87
100
|
preferences: z4.object({
|
|
88
101
|
/** The amount of user provisions made for this company */
|
|
@@ -100,11 +113,11 @@ var CompanyOpState = z4.object({
|
|
|
100
113
|
...TimeLog.shape
|
|
101
114
|
});
|
|
102
115
|
var CompanyBillingModel = z4.object({
|
|
103
|
-
uid:
|
|
116
|
+
uid: UuidV7,
|
|
104
117
|
preferences: z4.object({
|
|
105
118
|
/** Allows the serviceDecider to distribute invoices. */
|
|
106
119
|
allowInvoiceDist: z4.boolean(),
|
|
107
|
-
/** Forces service selectors to
|
|
120
|
+
/** Forces service selectors to use the list of service(s) that you've created. */
|
|
108
121
|
useCreatedServices: z4.boolean(),
|
|
109
122
|
/** The user that's allowed to record the client's services. */
|
|
110
123
|
serviceSelector: z4.enum(["scheduler", "doctor"]),
|
|
@@ -151,6 +164,7 @@ var CompanyRegistrationClaims = z4.object({
|
|
|
151
164
|
});
|
|
152
165
|
var CompanyUser = z4.object({
|
|
153
166
|
...UserModel.shape,
|
|
167
|
+
uid: UuidV7,
|
|
154
168
|
status: z4.enum(["inviteSent", "active", "inactive"]),
|
|
155
169
|
roles: z4.array(companyUserRoles).transform((roles) => {
|
|
156
170
|
const newRoles = [];
|
|
@@ -168,7 +182,7 @@ var CompanyUser = z4.object({
|
|
|
168
182
|
...TimeLog.shape
|
|
169
183
|
});
|
|
170
184
|
var _staffDetails = z4.object({
|
|
171
|
-
uid:
|
|
185
|
+
uid: UuidV7,
|
|
172
186
|
members: z4.array(CompanyUser).superRefine((users, ctx) => {
|
|
173
187
|
const duplicateUids = [];
|
|
174
188
|
const duplicateEmails = [];
|
|
@@ -268,7 +282,7 @@ var StaffDetails = _staffDetails.transform((d) => {
|
|
|
268
282
|
}
|
|
269
283
|
});
|
|
270
284
|
var CompanyDetails = z4.object({
|
|
271
|
-
uid:
|
|
285
|
+
uid: CompanyIdentity.shape.uid,
|
|
272
286
|
identity: CompanyIdentity.omit({ uid: true }),
|
|
273
287
|
opState: CompanyOpState.omit({ uid: true }),
|
|
274
288
|
billing: CompanyBillingModel.omit({ uid: true }),
|
|
@@ -312,6 +326,7 @@ export {
|
|
|
312
326
|
CompanyOpState,
|
|
313
327
|
CompanyRegistrationClaims,
|
|
314
328
|
CompanyUser,
|
|
329
|
+
InvoiceNo,
|
|
315
330
|
PriceAdjustment,
|
|
316
331
|
PriceTag,
|
|
317
332
|
PricingRate,
|
|
@@ -319,6 +334,7 @@ export {
|
|
|
319
334
|
StaffDetails,
|
|
320
335
|
Time,
|
|
321
336
|
TimeLog,
|
|
337
|
+
UuidV7,
|
|
322
338
|
appointmentDistAlgs,
|
|
323
339
|
companyPartnerRoles,
|
|
324
340
|
companyUserRoles,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bizmap/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"main": "./dist/main.js",
|
|
5
5
|
"types": "./dist/main.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -24,5 +24,8 @@
|
|
|
24
24
|
"tsup": "^8.5.0",
|
|
25
25
|
"typescript": "^5.9.2",
|
|
26
26
|
"zod": "^4.2.1"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"uuid": "^13.0.0"
|
|
27
30
|
}
|
|
28
31
|
}
|