@bizmap/sdk 0.0.24 → 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 CHANGED
@@ -53,6 +53,7 @@ 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;
56
57
  totalUploads: z.ZodNumber;
57
58
  preferences: z.ZodObject<{
58
59
  createdAt: z.ZodReadonly<z.ZodNumber>;
@@ -178,6 +179,7 @@ type CompanyRegistrationClaims = z.infer<typeof CompanyRegistrationClaims>;
178
179
  declare const CompanyUser: z.ZodObject<{
179
180
  createdAt: z.ZodReadonly<z.ZodNumber>;
180
181
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
182
+ uid: z.ZodReadonly<z.ZodString>;
181
183
  status: z.ZodEnum<{
182
184
  inviteSent: "inviteSent";
183
185
  active: "active";
@@ -198,7 +200,6 @@ declare const CompanyUser: z.ZodObject<{
198
200
  photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
199
201
  email: z.ZodEmail;
200
202
  phoneNumber: z.ZodOptional<z.ZodString>;
201
- uid: z.ZodString;
202
203
  }, z.core.$strip>;
203
204
  type CompanyUser = z.infer<typeof CompanyUser>;
204
205
  declare const _staffDetails: z.ZodObject<{
@@ -206,6 +207,7 @@ declare const _staffDetails: z.ZodObject<{
206
207
  members: z.ZodArray<z.ZodObject<{
207
208
  createdAt: z.ZodReadonly<z.ZodNumber>;
208
209
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
210
+ uid: z.ZodReadonly<z.ZodString>;
209
211
  status: z.ZodEnum<{
210
212
  inviteSent: "inviteSent";
211
213
  active: "active";
@@ -226,10 +228,9 @@ declare const _staffDetails: z.ZodObject<{
226
228
  photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
227
229
  email: z.ZodEmail;
228
230
  phoneNumber: z.ZodOptional<z.ZodString>;
229
- uid: z.ZodString;
230
231
  }, z.core.$strip>>;
231
- partnerMap: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
232
- blackList: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>;
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[]>>;
233
234
  }, z.core.$strip>;
234
235
  /** The unpacked Staff Details */
235
236
  declare const StaffDetails: z.ZodPipe<z.ZodObject<{
@@ -237,6 +238,7 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
237
238
  members: z.ZodArray<z.ZodObject<{
238
239
  createdAt: z.ZodReadonly<z.ZodNumber>;
239
240
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
241
+ uid: z.ZodReadonly<z.ZodString>;
240
242
  status: z.ZodEnum<{
241
243
  inviteSent: "inviteSent";
242
244
  active: "active";
@@ -257,20 +259,19 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
257
259
  photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
258
260
  email: z.ZodEmail;
259
261
  phoneNumber: z.ZodOptional<z.ZodString>;
260
- uid: z.ZodString;
261
262
  }, z.core.$strip>>;
262
- partnerMap: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
263
- blackList: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>;
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[]>>;
264
265
  }, z.core.$strip>, z.ZodTransform<{
265
266
  uid: string;
266
267
  members: {
267
268
  createdAt: number;
269
+ uid: string;
268
270
  status: "inviteSent" | "active" | "inactive";
269
271
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
270
272
  lastActive: number;
271
273
  name: Record<"first" | "last", string>;
272
274
  email: string;
273
- uid: string;
274
275
  lastModified?: number | null | undefined;
275
276
  photoUrl?: string | null | undefined;
276
277
  phoneNumber?: string | undefined;
@@ -281,12 +282,12 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
281
282
  uid: string;
282
283
  members: {
283
284
  createdAt: number;
285
+ uid: string;
284
286
  status: "inviteSent" | "active" | "inactive";
285
287
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
286
288
  lastActive: number;
287
289
  name: Record<"first" | "last", string>;
288
290
  email: string;
289
- uid: string;
290
291
  lastModified?: number | null | undefined;
291
292
  photoUrl?: string | null | undefined;
292
293
  phoneNumber?: string | undefined;
@@ -296,7 +297,7 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
296
297
  }>>;
297
298
  type StaffDetails = z.infer<typeof _staffDetails>;
298
299
  declare const CompanyDetails: z.ZodObject<{
299
- uid: z.ZodString;
300
+ uid: z.ZodReadonly<z.ZodString>;
300
301
  identity: z.ZodObject<{
301
302
  createdAt: z.ZodReadonly<z.ZodNumber>;
302
303
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -321,6 +322,7 @@ declare const CompanyDetails: z.ZodObject<{
321
322
  opState: z.ZodObject<{
322
323
  createdAt: z.ZodReadonly<z.ZodNumber>;
323
324
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
325
+ invoiceNoRef: z.ZodString;
324
326
  availableBalance: z.ZodNumber;
325
327
  totalUploads: z.ZodNumber;
326
328
  preferences: z.ZodObject<{
@@ -378,6 +380,7 @@ declare const CompanyDetails: z.ZodObject<{
378
380
  members: z.ZodArray<z.ZodObject<{
379
381
  createdAt: z.ZodReadonly<z.ZodNumber>;
380
382
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
383
+ uid: z.ZodReadonly<z.ZodString>;
381
384
  status: z.ZodEnum<{
382
385
  inviteSent: "inviteSent";
383
386
  active: "active";
@@ -398,10 +401,9 @@ declare const CompanyDetails: z.ZodObject<{
398
401
  photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
399
402
  email: z.ZodEmail;
400
403
  phoneNumber: z.ZodOptional<z.ZodString>;
401
- uid: z.ZodString;
402
404
  }, z.core.$strip>>;
403
- partnerMap: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
404
- blackList: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>;
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[]>>;
405
407
  }, z.core.$strip>;
406
408
  }, z.core.$strip>;
407
409
  type CompanyDetails = z.infer<typeof CompanyDetails>;
@@ -411,6 +413,8 @@ declare const TimeLog: z.ZodObject<{
411
413
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
412
414
  }, z.core.$strip>;
413
415
  type TimeLog = z.infer<typeof TimeLog>;
416
+ declare const InvoiceNo: z.ZodString;
417
+ declare const UuidV7: z.ZodReadonly<z.ZodString>;
414
418
  declare const Time: z.ZodString;
415
419
 
416
420
  declare const companyUserRoles: z.ZodEnum<{
@@ -442,12 +446,12 @@ type AppointmentDistAlg = z.infer<typeof appointmentDistAlgs>;
442
446
  /**@returns an array of the users that have conflicting roles or are incompatible with the other partners, or null if none was found. */
443
447
  declare const findConflictingPartners: (...partners: CompanyUser[]) => {
444
448
  createdAt: number;
449
+ uid: string;
445
450
  status: "inviteSent" | "active" | "inactive";
446
451
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
447
452
  lastActive: number;
448
453
  name: Record<"first" | "last", string>;
449
454
  email: string;
450
- uid: string;
451
455
  lastModified?: number | null | undefined;
452
456
  photoUrl?: string | null | undefined;
453
457
  phoneNumber?: string | undefined;
@@ -455,4 +459,4 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
455
459
  /**@returns the roles that are compatible with the selected role. */
456
460
  declare const getCompatibleRoles: (role: CompanyUserRole) => CompanyUserRole[];
457
461
 
458
- 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 Time = z.string().regex(/^[0-9]{1,2}:[0-9]{2} (am|AM|pm|PM)/, {
11
- error: "Must match the pattern hh:mm A"
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: z4.string().readonly(),
70
+ uid: UuidV7,
65
71
  // The company's uid
66
72
  displayName: z4.string(),
67
73
  logo: z4.string().nullish(),
@@ -80,10 +86,12 @@ var CompanyIdentity = z4.object({
80
86
  });
81
87
  var CompanyOpState = z4.object({
82
88
  // The company's uid
83
- uid: CompanyIdentity.shape.uid,
89
+ uid: UuidV7,
84
90
  // This can only be changed by the server/app admin
85
91
  availableBalance: z4.number(),
86
- /**
92
+ /** A counter for the company's invoice numbers. */
93
+ invoiceNoRef: InvoiceNo,
94
+ /**
87
95
  * The total amount of uploads made by an admin.
88
96
  * @note - This should be refreshed daily.
89
97
  */
@@ -105,7 +113,7 @@ var CompanyOpState = z4.object({
105
113
  ...TimeLog.shape
106
114
  });
107
115
  var CompanyBillingModel = z4.object({
108
- uid: CompanyIdentity.shape.uid,
116
+ uid: UuidV7,
109
117
  preferences: z4.object({
110
118
  /** Allows the serviceDecider to distribute invoices. */
111
119
  allowInvoiceDist: z4.boolean(),
@@ -156,6 +164,7 @@ var CompanyRegistrationClaims = z4.object({
156
164
  });
157
165
  var CompanyUser = z4.object({
158
166
  ...UserModel.shape,
167
+ uid: UuidV7,
159
168
  status: z4.enum(["inviteSent", "active", "inactive"]),
160
169
  roles: z4.array(companyUserRoles).transform((roles) => {
161
170
  const newRoles = [];
@@ -173,7 +182,7 @@ var CompanyUser = z4.object({
173
182
  ...TimeLog.shape
174
183
  });
175
184
  var _staffDetails = z4.object({
176
- uid: CompanyIdentity.shape.uid,
185
+ uid: UuidV7,
177
186
  members: z4.array(CompanyUser).superRefine((users, ctx) => {
178
187
  const duplicateUids = [];
179
188
  const duplicateEmails = [];
@@ -273,7 +282,7 @@ var StaffDetails = _staffDetails.transform((d) => {
273
282
  }
274
283
  });
275
284
  var CompanyDetails = z4.object({
276
- uid: z4.string(),
285
+ uid: CompanyIdentity.shape.uid,
277
286
  identity: CompanyIdentity.omit({ uid: true }),
278
287
  opState: CompanyOpState.omit({ uid: true }),
279
288
  billing: CompanyBillingModel.omit({ uid: true }),
@@ -317,6 +326,7 @@ export {
317
326
  CompanyOpState,
318
327
  CompanyRegistrationClaims,
319
328
  CompanyUser,
329
+ InvoiceNo,
320
330
  PriceAdjustment,
321
331
  PriceTag,
322
332
  PricingRate,
@@ -324,6 +334,7 @@ export {
324
334
  StaffDetails,
325
335
  Time,
326
336
  TimeLog,
337
+ UuidV7,
327
338
  appointmentDistAlgs,
328
339
  companyPartnerRoles,
329
340
  companyUserRoles,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.24",
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
  }