@bizmap/sdk 0.0.77 → 0.0.78

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
@@ -251,6 +251,7 @@ declare const CompanyDetails: z.ZodObject<{
251
251
  version: z.ZodInt;
252
252
  members: z.ZodRecord<z.ZodUUID, z.ZodObject<{
253
253
  inviteSent: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
254
+ lastModified: z.ZodNullable<z.ZodInt>;
254
255
  email: z.ZodEmail;
255
256
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
256
257
  status: z.ZodEnum<{
@@ -258,6 +259,10 @@ declare const CompanyDetails: z.ZodObject<{
258
259
  active: "active";
259
260
  inactive: "inactive";
260
261
  }>;
262
+ isBusy: z.ZodObject<{
263
+ value: z.ZodBoolean;
264
+ lastModified: z.ZodNullable<z.ZodInt>;
265
+ }, z.core.$strip>;
261
266
  appointments: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
262
267
  roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
263
268
  doc: "doc";
@@ -672,6 +677,7 @@ type MutableCompanyPreferences = z.infer<typeof MutableCompanyPreferences>;
672
677
  declare const CompanyStaff: z.ZodObject<{
673
678
  members: z.ZodRecord<z.ZodUUID, z.ZodObject<{
674
679
  inviteSent: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
680
+ lastModified: z.ZodNullable<z.ZodInt>;
675
681
  email: z.ZodEmail;
676
682
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
677
683
  status: z.ZodEnum<{
@@ -679,6 +685,10 @@ declare const CompanyStaff: z.ZodObject<{
679
685
  active: "active";
680
686
  inactive: "inactive";
681
687
  }>;
688
+ isBusy: z.ZodObject<{
689
+ value: z.ZodBoolean;
690
+ lastModified: z.ZodNullable<z.ZodInt>;
691
+ }, z.core.$strip>;
682
692
  appointments: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
683
693
  roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
684
694
  doc: "doc";
@@ -740,7 +750,8 @@ declare const CompanyState: z.ZodObject<{
740
750
  type CompanyState = z.infer<typeof CompanyState>;
741
751
 
742
752
  declare const CompanyUserSession: z.ZodObject<{
743
- ip: z.ZodString;
753
+ _id: z.ZodUUID;
754
+ srcIp: z.ZodString;
744
755
  user: z.ZodObject<{
745
756
  _id: z.ZodUUID;
746
757
  email: z.ZodEmail;
@@ -763,12 +774,18 @@ declare const CompanyUserSession: z.ZodObject<{
763
774
  cshr: "cshr";
764
775
  founder: "founder";
765
776
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[]>>;
777
+ lastModified: z.ZodNullable<z.ZodInt>;
766
778
  expiresAfter: z.ZodDate;
767
779
  }, z.core.$strip>;
768
780
  declare const MiniCompanyUser: z.ZodObject<{
769
781
  lastActive: z.ZodNullable<z.ZodInt>;
770
782
  inviteSent: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
771
783
  inviteAccepted: z.ZodNullable<z.ZodInt>;
784
+ lastModified: z.ZodNullable<z.ZodInt>;
785
+ isBusy: z.ZodObject<{
786
+ value: z.ZodBoolean;
787
+ lastModified: z.ZodNullable<z.ZodInt>;
788
+ }, z.core.$strip>;
772
789
  appointments: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
773
790
  roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
774
791
  doc: "doc";
@@ -792,6 +809,11 @@ declare const CompanyUser: z.ZodObject<{
792
809
  lastActive: z.ZodNullable<z.ZodInt>;
793
810
  inviteSent: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
794
811
  inviteAccepted: z.ZodNullable<z.ZodInt>;
812
+ lastModified: z.ZodNullable<z.ZodInt>;
813
+ isBusy: z.ZodObject<{
814
+ value: z.ZodBoolean;
815
+ lastModified: z.ZodNullable<z.ZodInt>;
816
+ }, z.core.$strip>;
795
817
  appointments: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
796
818
  roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
797
819
  doc: "doc";
@@ -1652,9 +1674,14 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
1652
1674
  };
1653
1675
  staffDetails: {
1654
1676
  members: Record<string, {
1677
+ lastModified: number | null;
1655
1678
  email: string;
1656
1679
  name: string;
1657
1680
  status: "inviteSent" | "active" | "inactive";
1681
+ isBusy: {
1682
+ value: boolean;
1683
+ lastModified: number | null;
1684
+ };
1658
1685
  appointments: Record<"ongoing" | "completed", number>;
1659
1686
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[];
1660
1687
  lastActive: number | null;
@@ -1838,12 +1865,22 @@ declare const findConflictingPartners: (...partners: (CompanyUser | MiniCompanyU
1838
1865
  name: string;
1839
1866
  lastActive: number | null;
1840
1867
  inviteAccepted: number | null;
1868
+ lastModified: number | null;
1869
+ isBusy: {
1870
+ value: boolean;
1871
+ lastModified: number | null;
1872
+ };
1841
1873
  appointments: Record<"ongoing" | "completed", number>;
1842
1874
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[];
1843
1875
  inviteSent?: number | null | undefined;
1844
1876
  } | {
1845
1877
  lastActive: number | null;
1846
1878
  inviteAccepted: number | null;
1879
+ lastModified: number | null;
1880
+ isBusy: {
1881
+ value: boolean;
1882
+ lastModified: number | null;
1883
+ };
1847
1884
  appointments: Record<"ongoing" | "completed", number>;
1848
1885
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[];
1849
1886
  _id: string;
package/dist/main.js CHANGED
@@ -117,7 +117,10 @@ var CompanyState = z7.object({
117
117
  const getTemplate = (subject) => `${upperFirst(subject)} character must be a letter.`;
118
118
  const invalidCharIdx = data.search(/[^a-z1-9\-]/);
119
119
  if (invalidCharIdx >= 0) {
120
- ctx.addIssue(`(${data[invalidCharIdx]}) is not an allowed character.`);
120
+ const char = data[invalidCharIdx];
121
+ ctx.addIssue(
122
+ `${/"|'|`/.test(char) ? `(${char})` : `"${char}"`} is not an allowed character.`
123
+ );
121
124
  }
122
125
  if (!/[a-z]/.test(data[0])) {
123
126
  ctx.addIssue(getTemplate("first"));
@@ -452,7 +455,8 @@ var UserDetails = z13.object({
452
455
 
453
456
  // src/schemas/company/components/User.ts
454
457
  var CompanyUserSession = z14.object({
455
- ip: z14.string(),
458
+ _id: z14.uuidv4(),
459
+ srcIp: z14.string(),
456
460
  user: UserDetails.pick({ _id: true, name: true, email: true }),
457
461
  companyId: CompanyState.shape._id,
458
462
  isAvailable: z14.object({
@@ -475,13 +479,17 @@ var CompanyUserSession = z14.object({
475
479
  (role, i) => i === 0 || getCompatibleRoles(roles[0]).includes(role)
476
480
  );
477
481
  }, "A user is not allowed to have conflicting roles."),
482
+ lastModified: Timestamp.nullable(),
478
483
  expiresAfter: z14.date()
479
484
  });
480
485
  var MiniCompanyUser2 = z14.object({
481
486
  _id: UserDetails.shape._id,
482
487
  ...CompanyUserSession.pick({
483
- appointments: true,
484
- roles: true
488
+ roles: true,
489
+ /** Attached to help determine if a user is allowed to create a new session */
490
+ isBusy: true,
491
+ lastModified: true,
492
+ appointments: true
485
493
  }).shape,
486
494
  /** The time before the company session gets deleted */
487
495
  lastActive: Timestamp.nullable(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.77",
3
+ "version": "0.0.78",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",