@bizmap/sdk 0.0.30 → 0.0.32

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
@@ -101,6 +101,10 @@ declare const CompanyUser: z.ZodObject<{
101
101
  active: "active";
102
102
  inactive: "inactive";
103
103
  }>;
104
+ availability: z.ZodObject<{
105
+ isAvailable: z.ZodDefault<z.ZodBoolean>;
106
+ lastModified: z.ZodDefault<z.ZodNullable<z.ZodInt>>;
107
+ }, z.core.$strip>;
104
108
  roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
105
109
  doc: "doc";
106
110
  physAsst: "physAsst";
@@ -142,13 +146,15 @@ declare const CompanyDetails: z.ZodObject<{
142
146
  }, z.core.$strip>;
143
147
  state: z.ZodObject<{
144
148
  availableBalance: z.ZodNumber;
145
- invoiceNoRef: z.ZodNullable<z.ZodString>;
146
149
  totalUploads: z.ZodNumber;
150
+ lastInvoiceNo: z.ZodNullable<z.ZodString>;
151
+ lastTktNo: z.ZodNullable<z.ZodNumber>;
147
152
  lastModified: z.ZodNullable<z.ZodInt>;
148
153
  }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
149
154
  availableBalance: z.ZodNumber;
150
- invoiceNoRef: z.ZodNullable<z.ZodString>;
151
155
  totalUploads: z.ZodNumber;
156
+ lastInvoiceNo: z.ZodNullable<z.ZodString>;
157
+ lastTktNo: z.ZodNullable<z.ZodNumber>;
152
158
  lastModified: z.ZodNullable<z.ZodInt>;
153
159
  }, z.core.$strip>>>;
154
160
  preferences: z.ZodObject<{
@@ -253,6 +259,10 @@ declare const CompanyDetails: z.ZodObject<{
253
259
  active: "active";
254
260
  inactive: "inactive";
255
261
  }>;
262
+ availability: z.ZodObject<{
263
+ isAvailable: z.ZodDefault<z.ZodBoolean>;
264
+ lastModified: z.ZodDefault<z.ZodNullable<z.ZodInt>>;
265
+ }, z.core.$strip>;
256
266
  roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
257
267
  doc: "doc";
258
268
  physAsst: "physAsst";
@@ -277,6 +287,10 @@ declare const CompanyDetails: z.ZodObject<{
277
287
  createdAt: number;
278
288
  uid: string;
279
289
  status: "inviteSent" | "active" | "inactive";
290
+ availability: {
291
+ isAvailable: boolean;
292
+ lastModified: number | null;
293
+ };
280
294
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
281
295
  lastActive: number;
282
296
  name: Record<"first" | "last", string>;
@@ -293,6 +307,10 @@ declare const CompanyDetails: z.ZodObject<{
293
307
  createdAt: number;
294
308
  uid: string;
295
309
  status: "inviteSent" | "active" | "inactive";
310
+ availability: {
311
+ isAvailable: boolean;
312
+ lastModified: number | null;
313
+ };
296
314
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
297
315
  lastActive: number;
298
316
  name: Record<"first" | "last", string>;
@@ -314,6 +332,10 @@ declare const CompanyDetails: z.ZodObject<{
314
332
  active: "active";
315
333
  inactive: "inactive";
316
334
  }>;
335
+ availability: z.ZodObject<{
336
+ isAvailable: z.ZodDefault<z.ZodBoolean>;
337
+ lastModified: z.ZodDefault<z.ZodNullable<z.ZodInt>>;
338
+ }, z.core.$strip>;
317
339
  roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
318
340
  doc: "doc";
319
341
  physAsst: "physAsst";
@@ -338,6 +360,10 @@ declare const CompanyDetails: z.ZodObject<{
338
360
  createdAt: number;
339
361
  uid: string;
340
362
  status: "inviteSent" | "active" | "inactive";
363
+ availability: {
364
+ isAvailable: boolean;
365
+ lastModified: number | null;
366
+ };
341
367
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
342
368
  lastActive: number;
343
369
  name: Record<"first" | "last", string>;
@@ -354,6 +380,10 @@ declare const CompanyDetails: z.ZodObject<{
354
380
  createdAt: number;
355
381
  uid: string;
356
382
  status: "inviteSent" | "active" | "inactive";
383
+ availability: {
384
+ isAvailable: boolean;
385
+ lastModified: number | null;
386
+ };
357
387
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
358
388
  lastActive: number;
359
389
  name: Record<"first" | "last", string>;
@@ -393,13 +423,15 @@ declare const PartialCompanyDetails: z.ZodObject<{
393
423
  }, z.core.$strip>;
394
424
  state: z.ZodObject<{
395
425
  availableBalance: z.ZodNumber;
396
- invoiceNoRef: z.ZodNullable<z.ZodString>;
397
426
  totalUploads: z.ZodNumber;
427
+ lastInvoiceNo: z.ZodNullable<z.ZodString>;
428
+ lastTktNo: z.ZodNullable<z.ZodNumber>;
398
429
  lastModified: z.ZodNullable<z.ZodInt>;
399
430
  }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
400
431
  availableBalance: z.ZodNumber;
401
- invoiceNoRef: z.ZodNullable<z.ZodString>;
402
432
  totalUploads: z.ZodNumber;
433
+ lastInvoiceNo: z.ZodNullable<z.ZodString>;
434
+ lastTktNo: z.ZodNullable<z.ZodNumber>;
403
435
  lastModified: z.ZodNullable<z.ZodInt>;
404
436
  }, z.core.$strip>>>;
405
437
  preferences: z.ZodObject<{
@@ -504,6 +536,10 @@ declare const PartialCompanyDetails: z.ZodObject<{
504
536
  active: "active";
505
537
  inactive: "inactive";
506
538
  }>;
539
+ availability: z.ZodObject<{
540
+ isAvailable: z.ZodDefault<z.ZodBoolean>;
541
+ lastModified: z.ZodDefault<z.ZodNullable<z.ZodInt>>;
542
+ }, z.core.$strip>;
507
543
  roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
508
544
  doc: "doc";
509
545
  physAsst: "physAsst";
@@ -528,6 +564,10 @@ declare const PartialCompanyDetails: z.ZodObject<{
528
564
  createdAt: number;
529
565
  uid: string;
530
566
  status: "inviteSent" | "active" | "inactive";
567
+ availability: {
568
+ isAvailable: boolean;
569
+ lastModified: number | null;
570
+ };
531
571
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
532
572
  lastActive: number;
533
573
  name: Record<"first" | "last", string>;
@@ -544,6 +584,10 @@ declare const PartialCompanyDetails: z.ZodObject<{
544
584
  createdAt: number;
545
585
  uid: string;
546
586
  status: "inviteSent" | "active" | "inactive";
587
+ availability: {
588
+ isAvailable: boolean;
589
+ lastModified: number | null;
590
+ };
547
591
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
548
592
  lastActive: number;
549
593
  name: Record<"first" | "last", string>;
@@ -565,6 +609,10 @@ declare const PartialCompanyDetails: z.ZodObject<{
565
609
  active: "active";
566
610
  inactive: "inactive";
567
611
  }>;
612
+ availability: z.ZodObject<{
613
+ isAvailable: z.ZodDefault<z.ZodBoolean>;
614
+ lastModified: z.ZodDefault<z.ZodNullable<z.ZodInt>>;
615
+ }, z.core.$strip>;
568
616
  roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
569
617
  doc: "doc";
570
618
  physAsst: "physAsst";
@@ -589,6 +637,10 @@ declare const PartialCompanyDetails: z.ZodObject<{
589
637
  createdAt: number;
590
638
  uid: string;
591
639
  status: "inviteSent" | "active" | "inactive";
640
+ availability: {
641
+ isAvailable: boolean;
642
+ lastModified: number | null;
643
+ };
592
644
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
593
645
  lastActive: number;
594
646
  name: Record<"first" | "last", string>;
@@ -605,6 +657,10 @@ declare const PartialCompanyDetails: z.ZodObject<{
605
657
  createdAt: number;
606
658
  uid: string;
607
659
  status: "inviteSent" | "active" | "inactive";
660
+ availability: {
661
+ isAvailable: boolean;
662
+ lastModified: number | null;
663
+ };
608
664
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
609
665
  lastActive: number;
610
666
  name: Record<"first" | "last", string>;
@@ -663,6 +719,10 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
663
719
  createdAt: number;
664
720
  uid: string;
665
721
  status: "inviteSent" | "active" | "inactive";
722
+ availability: {
723
+ isAvailable: boolean;
724
+ lastModified: number | null;
725
+ };
666
726
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
667
727
  lastActive: number;
668
728
  name: Record<"first" | "last", string>;
package/dist/main.js CHANGED
@@ -8,8 +8,14 @@ var InvoiceNo = z.string().regex(
8
8
  /^[0-9]{4}-(01|(0[2-9])|(1[0-2]))-(30|31|([1-2][0-9])|0[1-9])-[0-9]{7}/,
9
9
  'An invoice no. must match the pattern "yyyy-mm-dd-9999999".'
10
10
  );
11
- var UuidV4 = z.string().readonly().refine((uid) => validate(uid) && version(uid) === 4, "Invalid uuid.");
12
- var UuidV7 = z.string().readonly().refine((uid) => validate(uid) && version(uid) === 7, "Invalid uuid.");
11
+ var UuidV4 = z.string().readonly().refine(
12
+ (uid) => validate(uid) && version(uid) === 4,
13
+ "Expected a v4 uuid but received an invalid uuid."
14
+ );
15
+ var UuidV7 = z.string().readonly().refine(
16
+ (uid) => validate(uid) && version(uid) === 7,
17
+ "Expected a v7 uuid but received an invalid uuid."
18
+ );
13
19
  var StandardTime = z.string().regex(/^(01|(0[2-9])|(1[0-2])):(([1-5][0-9])|0[0-9]) (am|pm)/i, {
14
20
  error: "A standard time must match the pattern hh:mm A."
15
21
  });
@@ -90,6 +96,10 @@ var CompanyUser = z4.object({
90
96
  ...UserModel.shape,
91
97
  uid: UuidV7,
92
98
  status: z4.enum(["inviteSent", "active", "inactive"]),
99
+ availability: z4.object({
100
+ isAvailable: z4.boolean().default(true),
101
+ lastModified: Timestamp.nullable().default(null)
102
+ }),
93
103
  roles: z4.array(companyUserRoles).transform((roles) => {
94
104
  const newRoles = [];
95
105
  for (const role of roles) {
@@ -104,6 +114,10 @@ var CompanyUser = z4.object({
104
114
  }, "A user is not allowed to have conflicting roles."),
105
115
  lastActive: Timestamp,
106
116
  ...TimeLog.shape
117
+ }).superRefine((data, ctx) => {
118
+ if (!data.availability.isAvailable && data.status !== "active") {
119
+ ctx.addIssue('Unavailable users MUST also have the "active" status.');
120
+ }
107
121
  });
108
122
  var CompanyIdentity = z4.object({
109
123
  displayName: z4.string().min(3).max(20),
@@ -124,13 +138,19 @@ var CompanyIdentity = z4.object({
124
138
  var CompanyState = z4.object({
125
139
  // This can only be changed by the server/app admin
126
140
  availableBalance: z4.number(),
127
- /** A counter for the company's invoice numbers. */
128
- invoiceNoRef: InvoiceNo.nullable(),
129
141
  /**
130
142
  * The total amount of uploads made by an admin.
131
143
  * @note - This should be refreshed daily.
132
144
  */
133
145
  totalUploads: z4.number(),
146
+ /** A counter for the company's invoice no.
147
+ * @note This should only be null when the cycle resets
148
+ */
149
+ lastInvoiceNo: InvoiceNo.nullable(),
150
+ /** A counter for the company's ticket no.
151
+ * @note This should only be null when the cycle resets
152
+ */
153
+ lastTktNo: z4.number().positive().nullable(),
134
154
  lastModified: Timestamp.nullable()
135
155
  });
136
156
  var CompanyPreferences = z4.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",