@the-inkwell/shared 0.2.175 → 0.2.176

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.
@@ -1480,6 +1480,7 @@ export declare const AdminPersonListQuerySchema: z.ZodObject<{
1480
1480
  }, z.core.$strip>>;
1481
1481
  filter: z.ZodOptional<z.ZodObject<{
1482
1482
  nameEmail: z.ZodOptional<z.ZodString>;
1483
+ clientId: z.ZodOptional<z.ZodString>;
1483
1484
  hasLinkedInUrl: z.ZodOptional<z.ZodBoolean>;
1484
1485
  source: z.ZodOptional<z.ZodEnum<{
1485
1486
  NETWORK: "NETWORK";
@@ -174,6 +174,7 @@ exports.AdminPersonListQuerySchema = utils_1.ListQuerySchema.extend({
174
174
  filter: v4_1.z
175
175
  .object({
176
176
  nameEmail: v4_1.z.string(),
177
+ clientId: v4_1.z.string(),
177
178
  hasLinkedInUrl: v4_1.z.boolean(),
178
179
  source: v4_1.z.enum(core_1.PersonSources.enumValues),
179
180
  location: v4_1.z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/admin/persons/index.ts"],"names":[],"mappings":";;;;;;AAAA,6CAIoB;AACpB,qCAWmB;AACnB,0CAKuB;AACvB,+BAA0B;AAC1B,kDAG2B;AAC3B,kDAAyB;AAEzB,eAAe;AAEf,MAAM,WAAW,GAAG,MAAC,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;AAClD,MAAM,WAAW,GAAG,MAAC;KAClB,MAAM,EAAE;KACR,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,eAAK,EAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC;KACjD,IAAI,CAAC,MAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;KAChC,QAAQ,EAAE,CAAA;AAEA,QAAA,gCAAgC,GAAG,IAAA,gCAAkB,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AAA,gCAAkB,EAAC,aAAM,CAAC;aAC/B,IAAI,CAAC;YACJ,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,IAAI;SACX,CAAC;aACD,QAAQ,EAAE;KACd,CAAC,CACH;IACD,WAAW,EAAE,MAAC,CAAC,KAAK,CAClB,MAAC,CAAC,MAAM,CAAC;QACP,QAAQ,EAAE,MAAC;aACR,MAAM,CAAC,EAAE,QAAQ,EAAE,0CAAkC,EAAE,CAAC;aACxD,QAAQ,EAAE;KACd,CAAC,CACH;CACF,CAAC,CAAA;AAkDW,QAAA,kBAAkB,GAAG,+BAAuB,CAAC,IAAI,CAAC;IAC7D,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,IAAI;IACZ,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,IAAI;CACjB,CAAC,CAAC,MAAM,CAAC;IACR,MAAM,EAAE,MAAC,CAAC,KAAK,CAAC,MAAC,CAAC,MAAM,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAC,CAAC,KAAK,CAClB,yCAAiC,CAAC,MAAM,CAAC;QACvC,WAAW,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACnC,CAAC,CACH;CACF,CAAC,CAAA","sourcesContent":["import {\n createInsertSchema,\n createSelectSchema,\n createUpdateSchema\n} from 'drizzle-zod'\nimport {\n campaign,\n client,\n education,\n experience,\n industry,\n jobFunction,\n person,\n PersonSources,\n skill,\n tag\n} from '../../core'\nimport {\n EmailSchema,\n ListQuerySchema,\n OptionalPhoneSchema,\n type ListResponse\n} from '../../../utils'\nimport { z } from 'zod/v4'\nimport {\n LIST_REQUEST_SORT_DIRECTIONS,\n PERSON_LIST_OPERATORS\n} from '../../../constants'\nimport phone from 'phone'\n\n//// validators\n\nconst emailSchema = z.email().trim().toLowerCase()\nconst phoneSchema = z\n .string()\n .transform((val) => phone(val.trim()).phoneNumber)\n .pipe(z.string().startsWith('+'))\n .nullable()\n\nexport const AdminPersonEducationSelectSchema = createSelectSchema(education, {\n field: (schema) => schema.describe('Field of study'),\n graduatedAt: z\n .date()\n .nullable()\n .describe('Graduation date, use June 1 if exact date unknown')\n}).pick({\n id: true,\n degree: true,\n field: true,\n school: true,\n graduatedAt: true\n})\n\nexport const AdminPersonExperienceSelectSchema = createSelectSchema(\n experience,\n {\n startDate: z.date().nullable(),\n endDate: z.date().nullable()\n }\n)\n .pick({\n id: true,\n title: true,\n company: true,\n level: true,\n salary: true,\n startDate: true,\n endDate: true,\n isCurrent: true\n })\n .extend({\n jobFunction: z.string().nullable(),\n industry: z.string().nullable()\n })\n\nexport const AdminPersonCreateSchema = createInsertSchema(person)\n .extend({\n email: emailSchema\n })\n .omit({\n idNano: true\n })\nexport const AdminPersonSelectSchema = createSelectSchema(person)\n .partial()\n .extend({\n skills: z\n .array(\n createSelectSchema(skill).pick({\n id: true,\n name: true\n })\n )\n .optional(),\n tags: z\n .array(\n createSelectSchema(tag).pick({\n id: true,\n name: true\n })\n )\n .optional(),\n sourceCampaign: createSelectSchema(campaign)\n .pick({\n id: true,\n name: true\n })\n .nullable()\n .optional(),\n client: createSelectSchema(client)\n .pick({\n id: true,\n name: true\n })\n .nullable()\n .optional(),\n educations: z.array(AdminPersonEducationSelectSchema).optional(),\n experiences: z.array(AdminPersonExperienceSelectSchema).optional(),\n _referralsCount: z.number().nullable().optional(),\n _referredIndustries: z.array(z.string()).nullable().optional(),\n _referredLocations: z.array(z.string()).nullable().optional(),\n _referredSkills: z.array(z.string()).nullable().optional(),\n _currentTitle: z.string().nullable().optional(),\n _currentEmployer: z.string().nullable().optional(),\n _currentSalary: z.number().nullable().optional(),\n _careerLevel: z.number().nullable().optional(),\n _currentJobFunction: z.string().nullable().optional(),\n _currentIndustry: z.string().nullable().optional(),\n _calculatedIsMember: z.boolean().optional(),\n industries: z\n .array(\n createSelectSchema(industry).pick({\n id: true,\n name: true,\n slug: true\n })\n )\n .optional(),\n jobFunctions: z\n .array(\n createSelectSchema(jobFunction).pick({\n id: true,\n name: true,\n slug: true\n })\n )\n .optional()\n })\n\nexport const AdminPersonUpdateSchema = createUpdateSchema(person, {\n email: EmailSchema.optional(),\n addedAt: z.coerce.date().optional(),\n phone: OptionalPhoneSchema\n})\n\nexport const AdminPersonParamsSchema = createSelectSchema(person).pick({\n id: true\n})\nexport const AdminPersonByEmailParamsSchema = createSelectSchema(person).pick({\n email: true\n})\nexport const AdminPersonByPhoneParamsSchema = createSelectSchema(person, {\n phone: z.string()\n}).pick({\n phone: true\n})\nexport const AdminPersonByIdNanoSchema = createSelectSchema(person, {\n idNano: z.string()\n}).pick({\n idNano: true\n})\n\nexport const AdminPersonUpdateParamsSchema = AdminPersonParamsSchema\n\nexport const AdminPersonDeleteParamsSchema = AdminPersonParamsSchema\n\nconst FilterSchema = z.object({\n field: z.string(),\n isDynamicColumn: z.boolean(),\n operator: z.enum(PERSON_LIST_OPERATORS),\n value: z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])\n})\nconst GeoSchema = z.object({\n operator: z.string(),\n referenceLat: z.number(),\n referenceLon: z.number(),\n radius: z.number()\n})\nconst CustomQuerySchema = z.object({\n custom: z.string(),\n value: z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])\n})\n// TODO - add type\nconst NestedFilterSchema: z.ZodType<any> = z.lazy(() =>\n z.object({\n and: z\n .array(\n z.union([\n FilterSchema,\n GeoSchema,\n CustomQuerySchema,\n NestedFilterSchema\n ])\n )\n .optional(),\n or: z\n .array(\n z.union([\n FilterSchema,\n GeoSchema,\n CustomQuerySchema,\n NestedFilterSchema\n ])\n )\n .optional()\n })\n)\n\nexport const AdminPersonListQuerySchema = ListQuerySchema.extend({\n filter: z\n .object({\n nameEmail: z.string(),\n hasLinkedInUrl: z.boolean(),\n source: z.enum(PersonSources.enumValues),\n location: z.object({\n miles: z.number(),\n lat: z.number(),\n lon: z.number()\n })\n })\n .partial()\n .optional()\n})\n\nexport const AdminPersonListAdvancedQuerySchema = ListQuerySchema.extend({\n sort: z\n .array(\n z.object({\n field: z.string(),\n direction: z.enum(LIST_REQUEST_SORT_DIRECTIONS)\n })\n )\n .optional(),\n filter: z\n .union([FilterSchema, GeoSchema, CustomQuerySchema, NestedFilterSchema])\n .optional()\n})\n\nexport const AdminPersonConnectionsParamsSchema = createSelectSchema(\n person\n).pick({\n id: true\n})\nexport const AdminPersonConnectionsPersonSchema = createSelectSchema(\n person\n).pick({\n id: true,\n email: true,\n fullName: true\n})\nexport const AdminPersonConnectionsResultSchema = z.object({\n sourcedPersons: z.array(AdminPersonConnectionsPersonSchema),\n sourcedBy: AdminPersonConnectionsPersonSchema.nullable(),\n bestPersons: z.array(\n z.object({ bestPerson: AdminPersonConnectionsPersonSchema })\n ),\n bestiedBy: z.array(\n z.object({ bestiedBy: AdminPersonConnectionsPersonSchema })\n ),\n referrals: z.array(\n z.object({\n candidacy: z\n .object({ person: AdminPersonConnectionsPersonSchema })\n .nullable(),\n client: createSelectSchema(client)\n .pick({\n id: true,\n name: true\n })\n .nullable()\n })\n ),\n candidacies: z.array(\n z.object({\n referral: z\n .object({ referrer: AdminPersonConnectionsPersonSchema })\n .nullable()\n })\n )\n})\n\n//// types\n\ntype AdminPerson = z.infer<typeof AdminPersonSelectSchema>\n\nexport type AdminPersonExperienceResult = z.infer<\n typeof AdminPersonExperienceSelectSchema\n>\nexport type AdminPersonEducationResult = z.infer<\n typeof AdminPersonEducationSelectSchema\n>\n\n// detail\nexport type AdminPersonParams = z.infer<typeof AdminPersonParamsSchema>\nexport type AdminPersonByEmailParams = z.infer<\n typeof AdminPersonByEmailParamsSchema\n>\nexport type AdminPersonByPhoneParams = z.infer<\n typeof AdminPersonByPhoneParamsSchema\n>\nexport type AdminPersonByIdNanoParams = z.infer<\n typeof AdminPersonByIdNanoSchema\n>\nexport type AdminPersonResult = AdminPerson\n\n// list\nexport type AdminPersonListQuery = z.infer<typeof AdminPersonListQuerySchema>\nexport type AdminPersonListAdvancedQuery = z.infer<\n typeof AdminPersonListAdvancedQuerySchema\n>\nexport type AdminPersonListResult = ListResponse<\n z.infer<typeof AdminPersonSelectSchema>\n>\n\n// create\nexport type AdminPersonCreateInput = z.infer<typeof AdminPersonCreateSchema>\nexport type AdminPersonCreateResult = Pick<AdminPerson, 'id'>\n\n// update\nexport type AdminPersonUpdateParams = z.infer<\n typeof AdminPersonUpdateParamsSchema\n>\nexport type AdminPersonUpdateInput = Partial<AdminPerson>\n\n// delete\nexport type AdminPersonDeleteParams = z.infer<\n typeof AdminPersonDeleteParamsSchema\n>\n\nexport const ResumeParserSchema = AdminPersonSelectSchema.pick({\n firstName: true,\n lastName: true,\n email: true,\n phone: true,\n city: true,\n state: true,\n country: true,\n gender: true,\n linkedInUrl: true,\n websiteUrl: true,\n skills: true,\n experiences: true,\n educations: true\n}).extend({\n skills: z.array(z.string()),\n experiences: z.array(\n AdminPersonExperienceSelectSchema.extend({\n jobFunction: z.string().nullable()\n })\n )\n})\n\nexport type AdminPersonResumeParseResult = z.infer<typeof ResumeParserSchema>\n\nexport type AdminPersonConnectionsParams = z.infer<\n typeof AdminPersonConnectionsParamsSchema\n>\nexport type AdminPersonConnectionsPerson = z.infer<\n typeof AdminPersonConnectionsPersonSchema\n>\nexport type AdminPersonConnectionsResult = z.infer<\n typeof AdminPersonConnectionsResultSchema\n>\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/admin/persons/index.ts"],"names":[],"mappings":";;;;;;AAAA,6CAIoB;AACpB,qCAWmB;AACnB,0CAKuB;AACvB,+BAA0B;AAC1B,kDAG2B;AAC3B,kDAAyB;AAEzB,eAAe;AAEf,MAAM,WAAW,GAAG,MAAC,CAAC,KAAK,EAAE,CAAC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CAAiC,CAAC,MAAM,CAAC;QACvC,WAAW,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACnC,CAAC,CACH;CACF,CAAC,CAAA","sourcesContent":["import {\n createInsertSchema,\n createSelectSchema,\n createUpdateSchema\n} from 'drizzle-zod'\nimport {\n campaign,\n client,\n education,\n experience,\n industry,\n jobFunction,\n person,\n PersonSources,\n skill,\n tag\n} from '../../core'\nimport {\n EmailSchema,\n ListQuerySchema,\n OptionalPhoneSchema,\n type ListResponse\n} from '../../../utils'\nimport { z } from 'zod/v4'\nimport {\n LIST_REQUEST_SORT_DIRECTIONS,\n PERSON_LIST_OPERATORS\n} from '../../../constants'\nimport phone from 'phone'\n\n//// validators\n\nconst emailSchema = z.email().trim().toLowerCase()\nconst phoneSchema = z\n .string()\n .transform((val) => phone(val.trim()).phoneNumber)\n .pipe(z.string().startsWith('+'))\n .nullable()\n\nexport const AdminPersonEducationSelectSchema = createSelectSchema(education, {\n field: (schema) => schema.describe('Field of study'),\n graduatedAt: z\n .date()\n .nullable()\n .describe('Graduation date, use June 1 if exact date unknown')\n}).pick({\n id: true,\n degree: true,\n field: true,\n school: true,\n graduatedAt: true\n})\n\nexport const AdminPersonExperienceSelectSchema = createSelectSchema(\n experience,\n {\n startDate: z.date().nullable(),\n endDate: z.date().nullable()\n }\n)\n .pick({\n id: true,\n title: true,\n company: true,\n level: true,\n salary: true,\n startDate: true,\n endDate: true,\n isCurrent: true\n })\n .extend({\n jobFunction: z.string().nullable(),\n industry: z.string().nullable()\n })\n\nexport const AdminPersonCreateSchema = createInsertSchema(person)\n .extend({\n email: emailSchema\n })\n .omit({\n idNano: true\n })\nexport const AdminPersonSelectSchema = createSelectSchema(person)\n .partial()\n .extend({\n skills: z\n .array(\n createSelectSchema(skill).pick({\n id: true,\n name: true\n })\n )\n .optional(),\n tags: z\n .array(\n createSelectSchema(tag).pick({\n id: true,\n name: true\n })\n )\n .optional(),\n sourceCampaign: createSelectSchema(campaign)\n .pick({\n id: true,\n name: true\n })\n .nullable()\n .optional(),\n client: createSelectSchema(client)\n .pick({\n id: true,\n name: true\n })\n .nullable()\n .optional(),\n educations: z.array(AdminPersonEducationSelectSchema).optional(),\n experiences: z.array(AdminPersonExperienceSelectSchema).optional(),\n _referralsCount: z.number().nullable().optional(),\n _referredIndustries: z.array(z.string()).nullable().optional(),\n _referredLocations: z.array(z.string()).nullable().optional(),\n _referredSkills: z.array(z.string()).nullable().optional(),\n _currentTitle: z.string().nullable().optional(),\n _currentEmployer: z.string().nullable().optional(),\n _currentSalary: z.number().nullable().optional(),\n _careerLevel: z.number().nullable().optional(),\n _currentJobFunction: z.string().nullable().optional(),\n _currentIndustry: z.string().nullable().optional(),\n _calculatedIsMember: z.boolean().optional(),\n industries: z\n .array(\n createSelectSchema(industry).pick({\n id: true,\n name: true,\n slug: true\n })\n )\n .optional(),\n jobFunctions: z\n .array(\n createSelectSchema(jobFunction).pick({\n id: true,\n name: true,\n slug: true\n })\n )\n .optional()\n })\n\nexport const AdminPersonUpdateSchema = createUpdateSchema(person, {\n email: EmailSchema.optional(),\n addedAt: z.coerce.date().optional(),\n phone: OptionalPhoneSchema\n})\n\nexport const AdminPersonParamsSchema = createSelectSchema(person).pick({\n id: true\n})\nexport const AdminPersonByEmailParamsSchema = createSelectSchema(person).pick({\n email: true\n})\nexport const AdminPersonByPhoneParamsSchema = createSelectSchema(person, {\n phone: z.string()\n}).pick({\n phone: true\n})\nexport const AdminPersonByIdNanoSchema = createSelectSchema(person, {\n idNano: z.string()\n}).pick({\n idNano: true\n})\n\nexport const AdminPersonUpdateParamsSchema = AdminPersonParamsSchema\n\nexport const AdminPersonDeleteParamsSchema = AdminPersonParamsSchema\n\nconst FilterSchema = z.object({\n field: z.string(),\n isDynamicColumn: z.boolean(),\n operator: z.enum(PERSON_LIST_OPERATORS),\n value: z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])\n})\nconst GeoSchema = z.object({\n operator: z.string(),\n referenceLat: z.number(),\n referenceLon: z.number(),\n radius: z.number()\n})\nconst CustomQuerySchema = z.object({\n custom: z.string(),\n value: z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])\n})\n// TODO - add type\nconst NestedFilterSchema: z.ZodType<any> = z.lazy(() =>\n z.object({\n and: z\n .array(\n z.union([\n FilterSchema,\n GeoSchema,\n CustomQuerySchema,\n NestedFilterSchema\n ])\n )\n .optional(),\n or: z\n .array(\n z.union([\n FilterSchema,\n GeoSchema,\n CustomQuerySchema,\n NestedFilterSchema\n ])\n )\n .optional()\n })\n)\n\nexport const AdminPersonListQuerySchema = ListQuerySchema.extend({\n filter: z\n .object({\n nameEmail: z.string(),\n clientId: z.string(),\n hasLinkedInUrl: z.boolean(),\n source: z.enum(PersonSources.enumValues),\n location: z.object({\n miles: z.number(),\n lat: z.number(),\n lon: z.number()\n })\n })\n .partial()\n .optional()\n})\n\nexport const AdminPersonListAdvancedQuerySchema = ListQuerySchema.extend({\n sort: z\n .array(\n z.object({\n field: z.string(),\n direction: z.enum(LIST_REQUEST_SORT_DIRECTIONS)\n })\n )\n .optional(),\n filter: z\n .union([FilterSchema, GeoSchema, CustomQuerySchema, NestedFilterSchema])\n .optional()\n})\n\nexport const AdminPersonConnectionsParamsSchema = createSelectSchema(\n person\n).pick({\n id: true\n})\nexport const AdminPersonConnectionsPersonSchema = createSelectSchema(\n person\n).pick({\n id: true,\n email: true,\n fullName: true\n})\nexport const AdminPersonConnectionsResultSchema = z.object({\n sourcedPersons: z.array(AdminPersonConnectionsPersonSchema),\n sourcedBy: AdminPersonConnectionsPersonSchema.nullable(),\n bestPersons: z.array(\n z.object({ bestPerson: AdminPersonConnectionsPersonSchema })\n ),\n bestiedBy: z.array(\n z.object({ bestiedBy: AdminPersonConnectionsPersonSchema })\n ),\n referrals: z.array(\n z.object({\n candidacy: z\n .object({ person: AdminPersonConnectionsPersonSchema })\n .nullable(),\n client: createSelectSchema(client)\n .pick({\n id: true,\n name: true\n })\n .nullable()\n })\n ),\n candidacies: z.array(\n z.object({\n referral: z\n .object({ referrer: AdminPersonConnectionsPersonSchema })\n .nullable()\n })\n )\n})\n\n//// types\n\ntype AdminPerson = z.infer<typeof AdminPersonSelectSchema>\n\nexport type AdminPersonExperienceResult = z.infer<\n typeof AdminPersonExperienceSelectSchema\n>\nexport type AdminPersonEducationResult = z.infer<\n typeof AdminPersonEducationSelectSchema\n>\n\n// detail\nexport type AdminPersonParams = z.infer<typeof AdminPersonParamsSchema>\nexport type AdminPersonByEmailParams = z.infer<\n typeof AdminPersonByEmailParamsSchema\n>\nexport type AdminPersonByPhoneParams = z.infer<\n typeof AdminPersonByPhoneParamsSchema\n>\nexport type AdminPersonByIdNanoParams = z.infer<\n typeof AdminPersonByIdNanoSchema\n>\nexport type AdminPersonResult = AdminPerson\n\n// list\nexport type AdminPersonListQuery = z.infer<typeof AdminPersonListQuerySchema>\nexport type AdminPersonListAdvancedQuery = z.infer<\n typeof AdminPersonListAdvancedQuerySchema\n>\nexport type AdminPersonListResult = ListResponse<\n z.infer<typeof AdminPersonSelectSchema>\n>\n\n// create\nexport type AdminPersonCreateInput = z.infer<typeof AdminPersonCreateSchema>\nexport type AdminPersonCreateResult = Pick<AdminPerson, 'id'>\n\n// update\nexport type AdminPersonUpdateParams = z.infer<\n typeof AdminPersonUpdateParamsSchema\n>\nexport type AdminPersonUpdateInput = Partial<AdminPerson>\n\n// delete\nexport type AdminPersonDeleteParams = z.infer<\n typeof AdminPersonDeleteParamsSchema\n>\n\nexport const ResumeParserSchema = AdminPersonSelectSchema.pick({\n firstName: true,\n lastName: true,\n email: true,\n phone: true,\n city: true,\n state: true,\n country: true,\n gender: true,\n linkedInUrl: true,\n websiteUrl: true,\n skills: true,\n experiences: true,\n educations: true\n}).extend({\n skills: z.array(z.string()),\n experiences: z.array(\n AdminPersonExperienceSelectSchema.extend({\n jobFunction: z.string().nullable()\n })\n )\n})\n\nexport type AdminPersonResumeParseResult = z.infer<typeof ResumeParserSchema>\n\nexport type AdminPersonConnectionsParams = z.infer<\n typeof AdminPersonConnectionsParamsSchema\n>\nexport type AdminPersonConnectionsPerson = z.infer<\n typeof AdminPersonConnectionsPersonSchema\n>\nexport type AdminPersonConnectionsResult = z.infer<\n typeof AdminPersonConnectionsResultSchema\n>\n"]}
@@ -0,0 +1,72 @@
1
+ import { z } from 'zod/v4';
2
+ import { ListResponse } from '../../../utils';
3
+ export declare const PublicAccountSelectSchema: z.ZodObject<{
4
+ email: z.ZodString;
5
+ idNano: z.ZodString;
6
+ firstName: z.ZodNullable<z.ZodString>;
7
+ lastName: z.ZodNullable<z.ZodString>;
8
+ phone: z.ZodNullable<z.ZodString>;
9
+ }, {
10
+ out: {};
11
+ in: {};
12
+ }>;
13
+ export declare const PublicAccountUpdateSchema: z.ZodObject<{
14
+ email: z.ZodEmail;
15
+ firstName: z.ZodString;
16
+ lastName: z.ZodString;
17
+ phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
18
+ }, z.core.$strict>;
19
+ export declare const PublicAccountReferralSelectSchema: z.ZodObject<{
20
+ person: z.ZodOptional<z.ZodObject<{
21
+ wasHired: z.ZodOptional<z.ZodBoolean>;
22
+ firstName: z.ZodNullable<z.ZodString>;
23
+ lastName: z.ZodNullable<z.ZodString>;
24
+ }, z.core.$strict>>;
25
+ client: z.ZodOptional<z.ZodObject<{
26
+ hasHired: z.ZodOptional<z.ZodBoolean>;
27
+ name: z.ZodString;
28
+ }, z.core.$strict>>;
29
+ position: z.ZodOptional<z.ZodObject<{
30
+ client: z.ZodOptional<z.ZodObject<{
31
+ name: z.ZodString;
32
+ }, {
33
+ out: {};
34
+ in: {};
35
+ }>>;
36
+ candidacy: z.ZodOptional<z.ZodObject<{
37
+ person: z.ZodObject<{
38
+ firstName: z.ZodNullable<z.ZodString>;
39
+ lastName: z.ZodNullable<z.ZodString>;
40
+ }, z.core.$strict>;
41
+ stage: z.ZodString;
42
+ }, z.core.$strict>>;
43
+ name: z.ZodString;
44
+ }, z.core.$strict>>;
45
+ createdAt: z.ZodDate;
46
+ referralType: z.ZodNullable<z.ZodEnum<{
47
+ CLIENT: "CLIENT";
48
+ PERSON: "PERSON";
49
+ CANDIDACY: "CANDIDACY";
50
+ }>>;
51
+ }, z.core.$strict>;
52
+ export declare const PublicAccountApplicationSelectSchema: z.ZodObject<{
53
+ client: z.ZodOptional<z.ZodObject<{
54
+ name: z.ZodString;
55
+ }, {
56
+ out: {};
57
+ in: {};
58
+ }>>;
59
+ position: z.ZodObject<{
60
+ name: z.ZodString;
61
+ }, {
62
+ out: {};
63
+ in: {};
64
+ }>;
65
+ candidacy: {
66
+ stage: z.ZodString;
67
+ };
68
+ }, z.core.$strict>;
69
+ export type PublicAccountResult = z.infer<typeof PublicAccountSelectSchema>;
70
+ export type PublicAccountUpdateInput = z.infer<typeof PublicAccountUpdateSchema>;
71
+ export type PublicAccountReferralListResult = ListResponse<z.infer<typeof PublicAccountReferralSelectSchema>>;
72
+ export type PublicAccountApplicationListResult = ListResponse<z.infer<typeof PublicAccountApplicationSelectSchema>>;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PublicAccountApplicationSelectSchema = exports.PublicAccountReferralSelectSchema = exports.PublicAccountUpdateSchema = exports.PublicAccountSelectSchema = void 0;
4
+ const drizzle_zod_1 = require("drizzle-zod");
5
+ const core_1 = require("../../core");
6
+ const v4_1 = require("zod/v4");
7
+ const utils_1 = require("../../../utils");
8
+ //// validators
9
+ exports.PublicAccountSelectSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.person).pick({
10
+ idNano: true,
11
+ firstName: true,
12
+ lastName: true,
13
+ email: true,
14
+ phone: true
15
+ });
16
+ exports.PublicAccountUpdateSchema = v4_1.z.strictObject({
17
+ ...(0, drizzle_zod_1.createUpdateSchema)(core_1.person, {
18
+ firstName: utils_1.PersonFirstNameSchema,
19
+ lastName: utils_1.PersonLastNameSchema,
20
+ phone: utils_1.OptionalPhoneSchema,
21
+ email: utils_1.EmailSchema
22
+ }).pick({
23
+ firstName: true,
24
+ lastName: true,
25
+ phone: true,
26
+ email: true
27
+ }).shape
28
+ });
29
+ exports.PublicAccountReferralSelectSchema = v4_1.z.strictObject({
30
+ ...(0, drizzle_zod_1.createSelectSchema)(core_1.referral).pick({
31
+ referralType: true,
32
+ createdAt: true
33
+ }).shape,
34
+ person: v4_1.z
35
+ .strictObject({
36
+ ...(0, drizzle_zod_1.createSelectSchema)(core_1.person).pick({
37
+ firstName: true,
38
+ lastName: true
39
+ }).shape,
40
+ wasHired: v4_1.z.boolean().optional()
41
+ })
42
+ .optional(),
43
+ client: v4_1.z
44
+ .strictObject({
45
+ ...(0, drizzle_zod_1.createSelectSchema)(core_1.client).pick({
46
+ name: true
47
+ }).shape,
48
+ hasHired: v4_1.z.boolean().optional()
49
+ })
50
+ .optional(),
51
+ position: v4_1.z
52
+ .strictObject({
53
+ ...(0, drizzle_zod_1.createSelectSchema)(core_1.position).pick({
54
+ name: true
55
+ }).shape,
56
+ client: (0, drizzle_zod_1.createSelectSchema)(core_1.client)
57
+ .pick({
58
+ name: true
59
+ })
60
+ .optional(),
61
+ candidacy: v4_1.z
62
+ .strictObject({
63
+ person: v4_1.z.strictObject({
64
+ ...(0, drizzle_zod_1.createSelectSchema)(core_1.person).pick({
65
+ firstName: true,
66
+ lastName: true
67
+ }).shape
68
+ }),
69
+ stage: v4_1.z.string()
70
+ })
71
+ .optional()
72
+ })
73
+ .optional()
74
+ });
75
+ exports.PublicAccountApplicationSelectSchema = v4_1.z.strictObject({
76
+ client: (0, drizzle_zod_1.createSelectSchema)(core_1.client)
77
+ .pick({
78
+ name: true
79
+ })
80
+ .optional(),
81
+ position: (0, drizzle_zod_1.createSelectSchema)(core_1.position).pick({
82
+ name: true
83
+ }),
84
+ candidacy: {
85
+ stage: v4_1.z.string()
86
+ }
87
+ });
88
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources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CAAC,IAAI,CAAC;YACjC,IAAI,EAAE,IAAI;SACX,CAAC,CAAC,KAAK;QACR,QAAQ,EAAE,MAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;KACjC,CAAC;SACD,QAAQ,EAAE;IACb,QAAQ,EAAE,MAAC;SACR,YAAY,CAAC;QACZ,GAAG,IAAA,gCAAkB,EAAC,eAAQ,CAAC,CAAC,IAAI,CAAC;YACnC,IAAI,EAAE,IAAI;SACX,CAAC,CAAC,KAAK;QACR,MAAM,EAAE,IAAA,gCAAkB,EAAC,aAAM,CAAC;aAC/B,IAAI,CAAC;YACJ,IAAI,EAAE,IAAI;SACX,CAAC;aACD,QAAQ,EAAE;QACb,SAAS,EAAE,MAAC;aACT,YAAY,CAAC;YACZ,MAAM,EAAE,MAAC,CAAC,YAAY,CAAC;gBACrB,GAAG,IAAA,gCAAkB,EAAC,aAAM,CAAC,CAAC,IAAI,CAAC;oBACjC,SAAS,EAAE,IAAI;oBACf,QAAQ,EAAE,IAAI;iBACf,CAAC,CAAC,KAAK;aACT,CAAC;YACF,KAAK,EAAE,MAAC,CAAC,MAAM,EAAE;SAClB,CAAC;aACD,QAAQ,EAAE;KACd,CAAC;SACD,QAAQ,EAAE;CACd,CAAC,CAAA;AAEW,QAAA,oCAAoC,GAAG,MAAC,CAAC,YAAY,CAAC;IACjE,MAAM,EAAE,IAAA,gCAAkB,EAAC,aAAM,CAAC;SAC/B,IAAI,CAAC;QACJ,IAAI,EAAE,IAAI;KACX,CAAC;SACD,QAAQ,EAAE;IACb,QAAQ,EAAE,IAAA,gCAAkB,EAAC,eAAQ,CAAC,CAAC,IAAI,CAAC;QAC1C,IAAI,EAAE,IAAI;KACX,CAAC;IACF,SAAS,EAAE;QACT,KAAK,EAAE,MAAC,CAAC,MAAM,EAAE;KAClB;CACF,CAAC,CAAA","sourcesContent":["import { createSelectSchema, createUpdateSchema } from 'drizzle-zod'\nimport { client, person, position, referral } from '../../core'\nimport { z } from 'zod/v4'\nimport {\n EmailSchema,\n ListResponse,\n OptionalPhoneSchema,\n PersonFirstNameSchema,\n PersonLastNameSchema\n} from '../../../utils'\n\n//// validators\n\nexport const PublicAccountSelectSchema = createSelectSchema(person).pick({\n idNano: true,\n firstName: true,\n lastName: true,\n email: true,\n phone: true\n})\n\nexport const PublicAccountUpdateSchema = z.strictObject({\n ...createUpdateSchema(person, {\n firstName: PersonFirstNameSchema,\n lastName: PersonLastNameSchema,\n phone: OptionalPhoneSchema,\n email: EmailSchema\n }).pick({\n firstName: true,\n lastName: true,\n phone: true,\n email: true\n }).shape\n})\n\nexport const PublicAccountReferralSelectSchema = z.strictObject({\n ...createSelectSchema(referral).pick({\n referralType: true,\n createdAt: true\n }).shape,\n person: z\n .strictObject({\n ...createSelectSchema(person).pick({\n firstName: true,\n lastName: true\n }).shape,\n wasHired: z.boolean().optional()\n })\n .optional(),\n client: z\n .strictObject({\n ...createSelectSchema(client).pick({\n name: true\n }).shape,\n hasHired: z.boolean().optional()\n })\n .optional(),\n position: z\n .strictObject({\n ...createSelectSchema(position).pick({\n name: true\n }).shape,\n client: createSelectSchema(client)\n .pick({\n name: true\n })\n .optional(),\n candidacy: z\n .strictObject({\n person: z.strictObject({\n ...createSelectSchema(person).pick({\n firstName: true,\n lastName: true\n }).shape\n }),\n stage: z.string()\n })\n .optional()\n })\n .optional()\n})\n\nexport const PublicAccountApplicationSelectSchema = z.strictObject({\n client: createSelectSchema(client)\n .pick({\n name: true\n })\n .optional(),\n position: createSelectSchema(position).pick({\n name: true\n }),\n candidacy: {\n stage: z.string()\n }\n})\n\n//// types\n\nexport type PublicAccountResult = z.infer<typeof PublicAccountSelectSchema>\n\nexport type PublicAccountUpdateInput = z.infer<typeof PublicAccountUpdateSchema>\n\nexport type PublicAccountReferralListResult = ListResponse<\n z.infer<typeof PublicAccountReferralSelectSchema>\n>\n\nexport type PublicAccountApplicationListResult = ListResponse<\n z.infer<typeof PublicAccountApplicationSelectSchema>\n>\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-inkwell/shared",
3
- "version": "0.2.175",
3
+ "version": "0.2.176",
4
4
  "description": "Shared code for Inkwell",
5
5
  "license": "ISC",
6
6
  "author": "Inkwell (Rob Yedlin & Saimon Alam)",