@bizmap/sdk 0.0.109 → 0.0.111

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
@@ -244,10 +244,10 @@ declare const CompanyDetails: z.ZodObject<{
244
244
  "a/r": "a/r";
245
245
  founder: "founder";
246
246
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[]>>;
247
- lastOnline: z.ZodNullable<z.ZodISODateTime>;
247
+ lastActive: z.ZodNullable<z.ZodISODateTime>;
248
248
  inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
249
249
  inviteAccepted: z.ZodNullable<z.ZodISODateTime>;
250
- isOnline: z.ZodBoolean;
250
+ isActive: z.ZodBoolean;
251
251
  }, z.core.$strip>>;
252
252
  partnerMap: z.ZodRecord<z.ZodUUID, z.ZodRecord<z.ZodUUID, z.ZodObject<{
253
253
  addedAt: z.ZodISODateTime;
@@ -616,10 +616,10 @@ declare const CompanyStaff: z.ZodObject<{
616
616
  "a/r": "a/r";
617
617
  founder: "founder";
618
618
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[]>>;
619
- lastOnline: z.ZodNullable<z.ZodISODateTime>;
619
+ lastActive: z.ZodNullable<z.ZodISODateTime>;
620
620
  inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
621
621
  inviteAccepted: z.ZodNullable<z.ZodISODateTime>;
622
- isOnline: z.ZodBoolean;
622
+ isActive: z.ZodBoolean;
623
623
  }, z.core.$strip>>;
624
624
  _id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
625
625
  partnerMap: z.ZodRecord<z.ZodUUID, z.ZodRecord<z.ZodUUID, z.ZodObject<{
@@ -704,7 +704,7 @@ declare const CompanyUserSession: z.ZodObject<{
704
704
  }, z.core.$strip>;
705
705
  type CompanyUserSession = z.infer<typeof CompanyUserSession>;
706
706
  declare const MiniCompanyUser: z.ZodObject<{
707
- lastOnline: z.ZodNullable<z.ZodISODateTime>;
707
+ lastActive: z.ZodNullable<z.ZodISODateTime>;
708
708
  inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
709
709
  inviteAccepted: z.ZodNullable<z.ZodISODateTime>;
710
710
  lastModified: z.ZodNullable<z.ZodISODateTime>;
@@ -725,11 +725,11 @@ declare const MiniCompanyUser: z.ZodObject<{
725
725
  }, z.core.$strip>;
726
726
  type MiniCompanyUser = z.infer<typeof MiniCompanyUser>;
727
727
  declare const CompanyUser: z.ZodObject<{
728
- isOnline: z.ZodBoolean;
728
+ isActive: z.ZodBoolean;
729
729
  _id: z.ZodUUID;
730
730
  email: z.ZodEmail;
731
731
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
732
- lastOnline: z.ZodNullable<z.ZodISODateTime>;
732
+ lastActive: z.ZodNullable<z.ZodISODateTime>;
733
733
  inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
734
734
  inviteAccepted: z.ZodNullable<z.ZodISODateTime>;
735
735
  lastModified: z.ZodNullable<z.ZodISODateTime>;
@@ -986,35 +986,25 @@ declare const Receipts: z.ZodArray<z.ZodObject<{
986
986
  declare const UserDetails: z.ZodObject<{
987
987
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
988
988
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
989
- version: z.ZodInt;
989
+ version: z.ZodDefault<z.ZodInt>;
990
990
  _id: z.ZodUUID;
991
991
  email: z.ZodEmail;
992
992
  phoneNumber: z.ZodOptional<z.ZodString>;
993
993
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
994
994
  photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
995
995
  publicKey: z.ZodNullable<z.ZodString>;
996
- notifications: z.ZodArray<z.ZodObject<{
997
- _id: z.ZodString;
998
- code: z.ZodLiteral<"INVITE_RESPONSE" | "COMPANY_INVITE" | "DEV_MESSAGE" | "ALERT">;
999
- payload: z.ZodString;
1000
- isArchived: z.ZodOptional<z.ZodBoolean>;
1001
- rcpt: z.ZodNullable<z.ZodUnion<[z.ZodUUID, z.ZodUUID]>>;
1002
- src: z.ZodObject<{
1003
- _id: z.ZodUnion<[z.ZodUUID, z.ZodUUID]>;
1004
- name: z.ZodString;
1005
- photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1006
- }, z.core.$strip>;
1007
- createdAt: z.ZodISODateTime;
1008
- }, z.core.$strip>>;
996
+ lastSignedIn: z.ZodObject<{
997
+ auto: z.ZodOptional<z.ZodISODateTime>;
998
+ manual: z.ZodOptional<z.ZodISODateTime>;
999
+ }, z.core.$strip>;
1009
1000
  companyUids: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
1010
- resumeToken: z.ZodOptional<z.ZodUUID>;
1011
1001
  }, z.core.$strip>;
1012
1002
  type UserDetails = z.infer<typeof UserDetails>;
1013
1003
 
1014
1004
  declare const ClientIdentity: z.ZodObject<{
1015
1005
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
1016
1006
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1017
- version: z.ZodInt;
1007
+ version: z.ZodDefault<z.ZodInt>;
1018
1008
  _id: z.ZodUUID;
1019
1009
  photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1020
1010
  firstName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
@@ -1351,7 +1341,7 @@ declare const AppointmentDetails: z.ZodObject<{
1351
1341
  client: z.ZodObject<{
1352
1342
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
1353
1343
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1354
- version: z.ZodInt;
1344
+ version: z.ZodDefault<z.ZodInt>;
1355
1345
  _id: z.ZodUUID;
1356
1346
  photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1357
1347
  firstName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
@@ -1530,7 +1520,7 @@ declare const MutableAppointmentDetails: z.ZodObject<{
1530
1520
  client: z.ZodObject<{
1531
1521
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
1532
1522
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1533
- version: z.ZodInt;
1523
+ version: z.ZodDefault<z.ZodInt>;
1534
1524
  _id: z.ZodUUID;
1535
1525
  photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1536
1526
  firstName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
@@ -1672,9 +1662,9 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
1672
1662
  };
1673
1663
  appointments: Record<"ongoing" | "completed", number>;
1674
1664
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[];
1675
- lastOnline: string | null;
1665
+ lastActive: string | null;
1676
1666
  inviteAccepted: string | null;
1677
- isOnline: boolean;
1667
+ isActive: boolean;
1678
1668
  inviteSent?: string | null | undefined;
1679
1669
  }>;
1680
1670
  _id: string;
@@ -1876,11 +1866,11 @@ declare function findNextAvailableStaff(userUids: string[], algorithm: CompanyPr
1876
1866
  * @returns {(CompanyUser|MiniCompanyUser)[]|null} an array of the users that have conflicting roles or roles that are
1877
1867
  * incompatible with the other partners, or null if none was found. */
1878
1868
  declare const findConflictingPartners: (...partners: (CompanyUser | MiniCompanyUser)[]) => ({
1879
- isOnline: boolean;
1869
+ isActive: boolean;
1880
1870
  _id: string;
1881
1871
  email: string;
1882
1872
  name: string;
1883
- lastOnline: string | null;
1873
+ lastActive: string | null;
1884
1874
  inviteAccepted: string | null;
1885
1875
  lastModified: string | null;
1886
1876
  isBusy: {
@@ -1891,7 +1881,7 @@ declare const findConflictingPartners: (...partners: (CompanyUser | MiniCompanyU
1891
1881
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[];
1892
1882
  inviteSent?: string | null | undefined;
1893
1883
  } | {
1894
- lastOnline: string | null;
1884
+ lastActive: string | null;
1895
1885
  inviteAccepted: string | null;
1896
1886
  lastModified: string | null;
1897
1887
  isBusy: {
package/dist/main.js CHANGED
@@ -430,16 +430,22 @@ var UserDetails = z13.object({
430
430
  ctx.addIssue(`${nty} name must have at least (2) characters.`);
431
431
  }
432
432
  if (name.length > MAX_NAME_LENGTH) {
433
- ctx.addIssue(`${nty} name can't have more than (${MAX_NAME_LENGTH}) characters.`);
433
+ ctx.addIssue(
434
+ `${nty} name can't have more than (${MAX_NAME_LENGTH}) characters.`
435
+ );
434
436
  }
435
437
  });
436
438
  }),
437
439
  email: UserModel.shape.email,
438
440
  publicKey: z13.string().nullable(),
439
- notifications: z13.array(Notification),
440
- version: Version,
441
+ // notifications: z.array(Notification),
442
+ version: Version.default(1),
443
+ lastSignedIn: z13.object({
444
+ auto: Timestamp,
445
+ manual: Timestamp
446
+ }).partial(),
441
447
  companyUids: z13.array(CompanyState.shape._id).min(1).optional(),
442
- resumeToken: z13.uuidv4().optional(),
448
+ // resumeToken: z.uuidv4().optional(),
443
449
  ...TimeLog.shape
444
450
  }).omit({ uid: true });
445
451
 
@@ -590,7 +596,7 @@ var MiniCompanyUser2 = z15.object({
590
596
  appointments: true
591
597
  }).shape,
592
598
  /** The time before the company session gets deleted */
593
- lastOnline: Timestamp.nullable(),
599
+ lastActive: Timestamp.nullable(),
594
600
  inviteSent: Timestamp.nullish(),
595
601
  inviteAccepted: Timestamp.nullable()
596
602
  });
@@ -598,8 +604,8 @@ var CompanyUser2 = z15.object({
598
604
  ...MiniCompanyUser2.shape,
599
605
  ...CompanyUserSession.shape.user.shape,
600
606
  // Only true when the user's data is retrieved from the session pool
601
- // NB: This property is purely cosmetic (so need to store this on the server)
602
- isOnline: z15.boolean()
607
+ // NB: This property is purely cosmetic (so no need to store this on the server)
608
+ isActive: z15.boolean()
603
609
  });
604
610
 
605
611
  // src/schemas/company/components/Staff.ts
@@ -923,7 +929,7 @@ function findAvailableStaff(role, staff) {
923
929
  return Object.keys(role === "doc" ? staff.partnerMap : staff.members).filter(
924
930
  (uid) => {
925
931
  const user = staff.members[uid];
926
- return !(uid in staff.updateQueue) && user.roles.includes(role) && user.isOnline;
932
+ return !(uid in staff.updateQueue) && user.roles.includes(role) && user.isActive;
927
933
  }
928
934
  );
929
935
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.109",
3
+ "version": "0.0.111",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",
@@ -16,13 +16,13 @@
16
16
  "author": "",
17
17
  "license": "MIT",
18
18
  "peerDependencies": {
19
- "@wavy/fn": "^0.0.41",
19
+ "@wavy/fn": "^0.0.42",
20
20
  "@wavy/util": ">=0.0.12",
21
21
  "zod": "^4.2.1"
22
22
  },
23
23
  "description": "",
24
24
  "devDependencies": {
25
- "@wavy/fn": "^0.0.41",
25
+ "@wavy/fn": "^0.0.42",
26
26
  "@wavy/util": "^0.0.18",
27
27
  "tsup": "^8.5.0",
28
28
  "typescript": "^5.9.2",