@bizmap/sdk 0.0.75 → 0.0.77

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
@@ -1044,6 +1044,8 @@ declare const UserDetails: z.ZodObject<{
1044
1044
  }, z.core.$strip>;
1045
1045
  createdAt: z.ZodInt;
1046
1046
  }, z.core.$strip>>;
1047
+ companyUids: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
1048
+ resumeToken: z.ZodOptional<z.ZodUUID>;
1047
1049
  }, z.core.$strip>;
1048
1050
  type UserDetails = z.infer<typeof UserDetails>;
1049
1051
 
@@ -1055,6 +1057,8 @@ declare const ClientIdentity: z.ZodObject<{
1055
1057
  phoneNumber: z.ZodOptional<z.ZodString>;
1056
1058
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1057
1059
  photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1060
+ companyUids: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
1061
+ resumeToken: z.ZodOptional<z.ZodUUID>;
1058
1062
  email: z.ZodOptional<z.ZodEmail>;
1059
1063
  dob: z.ZodOptional<z.ZodInt>;
1060
1064
  address: z.ZodOptional<z.ZodObject<{
@@ -1372,6 +1376,8 @@ declare const AppointmentDetails: z.ZodObject<{
1372
1376
  phoneNumber: z.ZodOptional<z.ZodString>;
1373
1377
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1374
1378
  photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1379
+ companyUids: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
1380
+ resumeToken: z.ZodOptional<z.ZodUUID>;
1375
1381
  email: z.ZodOptional<z.ZodEmail>;
1376
1382
  dob: z.ZodOptional<z.ZodInt>;
1377
1383
  address: z.ZodOptional<z.ZodObject<{
@@ -1539,6 +1545,8 @@ declare const MutableAppointmentDetails: z.ZodObject<{
1539
1545
  phoneNumber: z.ZodOptional<z.ZodString>;
1540
1546
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1541
1547
  photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1548
+ companyUids: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
1549
+ resumeToken: z.ZodOptional<z.ZodUUID>;
1542
1550
  email: z.ZodOptional<z.ZodEmail>;
1543
1551
  dob: z.ZodOptional<z.ZodInt>;
1544
1552
  address: z.ZodOptional<z.ZodObject<{
@@ -1741,6 +1749,8 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
1741
1749
  lastModified?: number | null | undefined;
1742
1750
  phoneNumber?: string | undefined;
1743
1751
  photoUrl?: string | null | undefined;
1752
+ companyUids?: string[] | undefined;
1753
+ resumeToken?: string | undefined;
1744
1754
  email?: string | undefined;
1745
1755
  dob?: number | undefined;
1746
1756
  address?: {
package/dist/main.js CHANGED
@@ -111,12 +111,19 @@ var Receipts = z6.array(
111
111
 
112
112
  // src/schemas/company/components/State.ts
113
113
  import * as z7 from "zod";
114
+ import { upperFirst } from "@wavy/fn";
114
115
  var CompanyState = z7.object({
115
- _id: z7.string().toLowerCase().trim().min(3).max(63).regex(/[a-z1-9\-]/).transform((data) => data.replace(/-+/g, "-").replace(/\s+/g, "")).superRefine((data, ctx) => {
116
- if (!/[a-z]/.test(data[0]) || !/[a-z]/.test(data[data.length - 1])) {
117
- ctx.addIssue(
118
- "The first and last character of a company's name must be a letter."
119
- );
116
+ _id: z7.string().toLowerCase().trim().min(3).max(63).transform((data) => data.replace(/-+/g, "-").replace(/\s+/g, "")).superRefine((data, ctx) => {
117
+ const getTemplate = (subject) => `${upperFirst(subject)} character must be a letter.`;
118
+ const invalidCharIdx = data.search(/[^a-z1-9\-]/);
119
+ if (invalidCharIdx >= 0) {
120
+ ctx.addIssue(`(${data[invalidCharIdx]}) is not an allowed character.`);
121
+ }
122
+ if (!/[a-z]/.test(data[0])) {
123
+ ctx.addIssue(getTemplate("first"));
124
+ }
125
+ if (!/[a-z]/.test(data[data.length - 1])) {
126
+ ctx.addIssue(getTemplate("last"));
120
127
  }
121
128
  }),
122
129
  credits: z7.object({
@@ -188,9 +195,16 @@ import * as z9 from "zod";
188
195
  import { Address, PhoneNumber } from "@wavy/util";
189
196
  var CompanyIdentity = z9.object({
190
197
  _id: CompanyState.shape._id,
191
- alias: z9.string().trim().min(3).max(63).regex(/[a-z1-9 ]/gi).transform(
198
+ alias: z9.string().trim().min(3).max(63).transform(
192
199
  (data) => data.replace(/[^a-z1-9 ]/gi, "").replace(/\s+/g, " ")
193
- ),
200
+ ).superRefine((data, ctx) => {
201
+ const invalidCharIdx = data.search(/[^a-z1-9 ]/i);
202
+ if (invalidCharIdx >= 0) {
203
+ ctx.addIssue(
204
+ `Invalid format: expected a character between a-z or 1-9, but received " ${data[invalidCharIdx]} ".`
205
+ );
206
+ }
207
+ }),
194
208
  address: Address.optional(),
195
209
  logo: z9.string().nullish(),
196
210
  type: companyTypes.readonly(),
@@ -373,7 +387,7 @@ import * as z15 from "zod";
373
387
  import * as z14 from "zod";
374
388
 
375
389
  // src/functions/helper-functions.ts
376
- import { upperFirst } from "@wavy/fn";
390
+ import { upperFirst as upperFirst2 } from "@wavy/fn";
377
391
  var findConflictingPartners = (...partners) => {
378
392
  let hasSingleDoctor = false;
379
393
  const conflicts = [];
@@ -404,7 +418,7 @@ var getCompatibleRoles = (role) => {
404
418
  return companyUserRoles.exclude([role]).options;
405
419
  };
406
420
  var normalizeCompanyId = (id) => {
407
- return id.split("-").map((value) => upperFirst(value.toLowerCase())).join(" ");
421
+ return id.split("-").map((value) => upperFirst2(value.toLowerCase())).join(" ");
408
422
  };
409
423
 
410
424
  // src/schemas/profiles/User.ts
@@ -431,6 +445,8 @@ var UserDetails = z13.object({
431
445
  publicKey: z13.string().nullable(),
432
446
  notifications: z13.array(Notification),
433
447
  version: Version,
448
+ companyUids: z13.array(CompanyState.shape._id).min(1).optional(),
449
+ resumeToken: z13.uuidv4().optional(),
434
450
  ...TimeLog.shape
435
451
  }).omit({ uid: true });
436
452
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.75",
3
+ "version": "0.0.77",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",