@bizmap/sdk 0.0.114 → 0.0.116

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
@@ -750,7 +750,7 @@ declare const CompanyInviteList: z.ZodRecord<z.ZodEmail, z.ZodObject<{
750
750
  }, z.core.$strip>>;
751
751
  type CompanyInviteList = z.infer<typeof CompanyInviteList>;
752
752
 
753
- declare const CreateCompanyForm: z.ZodPipe<z.ZodObject<{
753
+ declare const CreateCompanyForm: z.ZodObject<{
754
754
  industry: z.ZodReadonly<z.ZodEnum<{
755
755
  healthcare: "healthcare";
756
756
  }>>;
@@ -766,35 +766,7 @@ declare const CreateCompanyForm: z.ZodPipe<z.ZodObject<{
766
766
  _id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
767
767
  alias: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
768
768
  logo: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
769
- }, z.core.$strip>, z.ZodTransform<{
770
- industry: "healthcare";
771
- sector: string;
772
- address: {
773
- streetAddress: string;
774
- parish: string;
775
- country: string;
776
- city?: string | undefined;
777
- };
778
- email: string;
779
- _id: string;
780
- phoneNumber?: string | undefined;
781
- alias?: string | undefined;
782
- logo?: string | null | undefined;
783
- }, {
784
- industry: "healthcare";
785
- sector: string;
786
- address: {
787
- streetAddress: string;
788
- parish: string;
789
- country: string;
790
- city?: string | undefined;
791
- };
792
- email: string;
793
- _id: string;
794
- phoneNumber?: string | undefined;
795
- alias?: string | undefined;
796
- logo?: string | null | undefined;
797
- }>>;
769
+ }, z.core.$strip>;
798
770
  type CreateCompanyForm = z.infer<typeof CreateCompanyForm>;
799
771
 
800
772
  /** industry -> sectors */
package/dist/main.js CHANGED
@@ -125,11 +125,11 @@ var Receipts = z6.array(
125
125
 
126
126
  // src/schemas/company/components/State.ts
127
127
  import * as z7 from "zod";
128
- import { upperFirst } from "@wavy/fn";
129
128
  var CompanyState = z7.object({
130
- _id: z7.string().toLowerCase().trim().min(3).max(63).transform((data) => data.replace(/-+/g, "-").replace(/\s+/g, "")).superRefine((data, ctx) => {
131
- const getTemplate = (subject) => `${upperFirst(subject)} character must be a letter.`;
132
- const invalidCharIdx = data.search(/[^a-z1-9\-]/);
129
+ _id: z7.string().toLowerCase().trim().min(3).max(63).transform(
130
+ (data) => data.replace(/-+/g, "-").replace(/_+/g, "_").replace(/\.+/g, ".").replace(/\s+/g, "")
131
+ ).superRefine((data, ctx) => {
132
+ const invalidCharIdx = data.search(/[^a-z0-9\-_\.]/);
133
133
  if (invalidCharIdx >= 0) {
134
134
  const char = data[invalidCharIdx];
135
135
  ctx.addIssue(
@@ -137,10 +137,10 @@ var CompanyState = z7.object({
137
137
  );
138
138
  }
139
139
  if (!/[a-z]/.test(data[0])) {
140
- ctx.addIssue(getTemplate("first"));
140
+ ctx.addIssue("The first character must be a letter.");
141
141
  }
142
- if (!/[a-z]/.test(data[data.length - 1])) {
143
- ctx.addIssue(getTemplate("last"));
142
+ if (!/[a-z0-9]/.test(data[data.length - 1])) {
143
+ ctx.addIssue("The last character must either be a letter or a number.");
144
144
  }
145
145
  }),
146
146
  credits: z7.object({
@@ -423,7 +423,7 @@ import * as z17 from "zod";
423
423
  import * as z16 from "zod";
424
424
 
425
425
  // src/functions/helper-functions.ts
426
- import { camelCaseToLetter, upperFirst as upperFirst2 } from "@wavy/fn";
426
+ import { camelCaseToLetter, upperFirst } from "@wavy/fn";
427
427
 
428
428
  // src/schemas/profiles/Client.ts
429
429
  import * as z15 from "zod";
@@ -552,7 +552,7 @@ var getIncompatibleRoles = (role) => {
552
552
  );
553
553
  };
554
554
  var normalizeCompanyId = (id) => {
555
- return id.split("-").map((value) => upperFirst2(value.toLowerCase())).join(" ");
555
+ return id.split("-").map((value) => upperFirst(value.toLowerCase())).join(" ");
556
556
  };
557
557
  var normalizeNidKey = (value) => {
558
558
  value = ClientIdentity.shape.nid.unwrap().keyof().parse(value);
@@ -751,11 +751,6 @@ var CreateCompanyForm = z20.object({
751
751
  industry: CompanyIdentity.shape.industry,
752
752
  sector: CompanyIdentity.shape.sector,
753
753
  address: CompanyIdentity.shape.address.nonoptional()
754
- }).transform((data) => {
755
- if (!("alias" in data)) {
756
- data.alias = normalizeCompanyId(data._id);
757
- }
758
- return data;
759
754
  }).superRefine((data, ctx) => {
760
755
  if (!CompanyIndustry.shape[data.industry].safeParse(data.sector).success) {
761
756
  ctx.addIssue(getInvalidSectorError(data.industry, data.sector));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.114",
3
+ "version": "0.0.116",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",