@the-inkwell/shared 0.2.170 → 0.2.172

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.
@@ -211,32 +211,32 @@ export declare const AdminPersonCreateSchema: z.ZodObject<{
211
211
  in: {};
212
212
  }>;
213
213
  export declare const AdminPersonSelectSchema: z.ZodObject<{
214
- id: z.ZodUUID;
215
- idNano: z.ZodString;
216
- email: z.ZodString;
217
- emailIsVerified: z.ZodBoolean;
218
- firstName: z.ZodNullable<z.ZodString>;
219
- lastName: z.ZodNullable<z.ZodString>;
220
- fullName: z.ZodNullable<z.ZodString>;
221
- linkedInUrl: z.ZodNullable<z.ZodString>;
222
- phone: z.ZodNullable<z.ZodString>;
223
- phoneIsVerified: z.ZodBoolean;
224
- emailIsOptedOut: z.ZodBoolean;
225
- smsIsOptedOut: z.ZodBoolean;
226
- resumeUri: z.ZodNullable<z.ZodString>;
227
- resumeUriUpdatedAt: z.ZodNullable<z.ZodDate>;
228
- resumeText: z.ZodNullable<z.ZodString>;
229
- resumeData: z.ZodNullable<z.ZodDate | z.ZodType<Buffer<ArrayBufferLike>, unknown> | z.ZodType<any, any> | z.ZodType<any, unknown>>;
230
- photoUri: z.ZodNullable<z.ZodString>;
231
- isMember: z.ZodNullable<z.ZodBoolean>;
232
- lat: z.ZodNullable<z.ZodNumber>;
233
- lon: z.ZodNullable<z.ZodNumber>;
234
- city: z.ZodNullable<z.ZodString>;
235
- networksCommunities: z.ZodNullable<z.ZodString>;
236
- conferencesAttended: z.ZodNullable<z.ZodString>;
237
- whatsAppGroups: z.ZodNullable<z.ZodString>;
238
- otherCommunities: z.ZodNullable<z.ZodString>;
239
- state: z.ZodNullable<z.ZodEnum<{
214
+ id: z.ZodOptional<z.ZodUUID>;
215
+ idNano: z.ZodOptional<z.ZodString>;
216
+ email: z.ZodOptional<z.ZodString>;
217
+ emailIsVerified: z.ZodOptional<z.ZodBoolean>;
218
+ firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
219
+ lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
220
+ fullName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
221
+ linkedInUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
222
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
223
+ phoneIsVerified: z.ZodOptional<z.ZodBoolean>;
224
+ emailIsOptedOut: z.ZodOptional<z.ZodBoolean>;
225
+ smsIsOptedOut: z.ZodOptional<z.ZodBoolean>;
226
+ resumeUri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
227
+ resumeUriUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
228
+ resumeText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
229
+ resumeData: z.ZodOptional<z.ZodNullable<z.ZodDate | z.ZodType<Buffer<ArrayBufferLike>, unknown> | z.ZodType<any, any> | z.ZodType<any, unknown>>>;
230
+ photoUri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
231
+ isMember: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
232
+ lat: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
233
+ lon: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
234
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
235
+ networksCommunities: z.ZodOptional<z.ZodNullable<z.ZodString>>;
236
+ conferencesAttended: z.ZodOptional<z.ZodNullable<z.ZodString>>;
237
+ whatsAppGroups: z.ZodOptional<z.ZodNullable<z.ZodString>>;
238
+ otherCommunities: z.ZodOptional<z.ZodNullable<z.ZodString>>;
239
+ state: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
240
240
  AL: "AL";
241
241
  AK: "AK";
242
242
  AS: "AS";
@@ -309,73 +309,73 @@ export declare const AdminPersonSelectSchema: z.ZodObject<{
309
309
  QC: "QC";
310
310
  SK: "SK";
311
311
  YT: "YT";
312
- }>>;
313
- postalCode: z.ZodNullable<z.ZodString>;
314
- country: z.ZodNullable<z.ZodEnum<{
312
+ }>>>;
313
+ postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
314
+ country: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
315
315
  UNITED_STATES: "UNITED_STATES";
316
316
  CANADA: "CANADA";
317
- }>>;
318
- additionalEmails: z.ZodNullable<z.ZodArray<z.ZodString>>;
319
- additionalPhones: z.ZodNullable<z.ZodArray<z.ZodString>>;
320
- source: z.ZodNullable<z.ZodEnum<{
317
+ }>>>;
318
+ additionalEmails: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
319
+ additionalPhones: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
320
+ source: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
321
321
  NETWORK: "NETWORK";
322
322
  WEBSITE: "WEBSITE";
323
323
  SOCIAL_MEDIA: "SOCIAL_MEDIA";
324
324
  SOURCED: "SOURCED";
325
- }>>;
326
- sourcePersonId: z.ZodNullable<z.ZodUUID>;
327
- sourceCampaignId: z.ZodNullable<z.ZodUUID>;
328
- websiteUrl: z.ZodNullable<z.ZodString>;
329
- expectedSalary: z.ZodNullable<z.ZodInt>;
330
- memberReasons: z.ZodNullable<z.ZodArray<z.ZodEnum<{
325
+ }>>>;
326
+ sourcePersonId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
327
+ sourceCampaignId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
328
+ websiteUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
329
+ expectedSalary: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
330
+ memberReasons: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
331
331
  REFER: "REFER";
332
332
  HIRE: "HIRE";
333
333
  APPLY: "APPLY";
334
- }>>>;
335
- preferredEmploymentType: z.ZodNullable<z.ZodEnum<{
334
+ }>>>>;
335
+ preferredEmploymentType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
336
336
  FULL_TIME: "FULL_TIME";
337
337
  PART_TIME: "PART_TIME";
338
- }>>;
339
- preferredEmploymentLocationType: z.ZodNullable<z.ZodEnum<{
338
+ }>>>;
339
+ preferredEmploymentLocationType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
340
340
  REMOTE: "REMOTE";
341
341
  ONSITE: "ONSITE";
342
342
  HYBRID: "HYBRID";
343
- }>>;
344
- preferredMessageChannel: z.ZodNullable<z.ZodEnum<{
343
+ }>>>;
344
+ preferredMessageChannel: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
345
345
  SMS: "SMS";
346
346
  EMAIL: "EMAIL";
347
- }>>;
348
- isOpenToRelocate: z.ZodNullable<z.ZodBoolean>;
349
- gender: z.ZodNullable<z.ZodEnum<{
347
+ }>>>;
348
+ isOpenToRelocate: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
349
+ gender: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
350
350
  MAN: "MAN";
351
351
  WOMAN: "WOMAN";
352
352
  NON_BINARY: "NON_BINARY";
353
353
  UNDISCLOSED: "UNDISCLOSED";
354
- }>>;
355
- discoveredThrough: z.ZodNullable<z.ZodString>;
356
- deactivatedAt: z.ZodNullable<z.ZodDate>;
357
- signedUpAt: z.ZodNullable<z.ZodDate>;
358
- lastSignedInAt: z.ZodNullable<z.ZodDate>;
359
- signInCount: z.ZodInt;
360
- clientId: z.ZodNullable<z.ZodUUID>;
361
- addedAt: z.ZodDate;
362
- deletedAt: z.ZodNullable<z.ZodDate>;
363
- createdAt: z.ZodDate;
364
- updatedAt: z.ZodDate;
365
- skills: z.ZodArray<z.ZodObject<{
354
+ }>>>;
355
+ discoveredThrough: z.ZodOptional<z.ZodNullable<z.ZodString>>;
356
+ deactivatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
357
+ signedUpAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
358
+ lastSignedInAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
359
+ signInCount: z.ZodOptional<z.ZodInt>;
360
+ clientId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
361
+ addedAt: z.ZodOptional<z.ZodDate>;
362
+ deletedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
363
+ createdAt: z.ZodOptional<z.ZodDate>;
364
+ updatedAt: z.ZodOptional<z.ZodDate>;
365
+ skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
366
366
  name: z.ZodString;
367
367
  id: z.ZodUUID;
368
368
  }, {
369
369
  out: {};
370
370
  in: {};
371
- }>>;
372
- tags: z.ZodArray<z.ZodObject<{
371
+ }>>>;
372
+ tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
373
373
  name: z.ZodString;
374
374
  id: z.ZodUUID;
375
375
  }, {
376
376
  out: {};
377
377
  in: {};
378
- }>>;
378
+ }>>>;
379
379
  sourceCampaign: z.ZodOptional<z.ZodNullable<z.ZodObject<{
380
380
  name: z.ZodString;
381
381
  id: z.ZodUUID;
@@ -383,14 +383,14 @@ export declare const AdminPersonSelectSchema: z.ZodObject<{
383
383
  out: {};
384
384
  in: {};
385
385
  }>>>;
386
- client: z.ZodObject<{
386
+ client: z.ZodOptional<z.ZodNullable<z.ZodObject<{
387
387
  name: z.ZodString;
388
388
  id: z.ZodUUID;
389
389
  }, {
390
390
  out: {};
391
391
  in: {};
392
- }>;
393
- educations: z.ZodArray<z.ZodObject<{
392
+ }>>>;
393
+ educations: z.ZodOptional<z.ZodArray<z.ZodObject<{
394
394
  field: z.ZodNullable<z.ZodEnum<{
395
395
  ACCOUNTING: "ACCOUNTING";
396
396
  ARCHITECTURE: "ARCHITECTURE";
@@ -422,8 +422,8 @@ export declare const AdminPersonSelectSchema: z.ZodObject<{
422
422
  }, {
423
423
  out: {};
424
424
  in: {};
425
- }>>;
426
- experiences: z.ZodArray<z.ZodObject<{
425
+ }>>>;
426
+ experiences: z.ZodOptional<z.ZodArray<z.ZodObject<{
427
427
  id: z.ZodUUID;
428
428
  company: z.ZodNullable<z.ZodString>;
429
429
  level: z.ZodNullable<z.ZodEnum<{
@@ -445,7 +445,7 @@ export declare const AdminPersonSelectSchema: z.ZodObject<{
445
445
  }, {
446
446
  out: {};
447
447
  in: {};
448
- }>>;
448
+ }>>>;
449
449
  _referralsCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
450
450
  _referredIndustries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
451
451
  _referredLocations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
@@ -457,22 +457,22 @@ export declare const AdminPersonSelectSchema: z.ZodObject<{
457
457
  _currentJobFunction: z.ZodOptional<z.ZodNullable<z.ZodString>>;
458
458
  _currentIndustry: z.ZodOptional<z.ZodNullable<z.ZodString>>;
459
459
  _calculatedIsMember: z.ZodOptional<z.ZodBoolean>;
460
- industries: z.ZodArray<z.ZodObject<{
460
+ industries: z.ZodOptional<z.ZodArray<z.ZodObject<{
461
461
  name: z.ZodString;
462
462
  id: z.ZodUUID;
463
463
  slug: z.ZodString;
464
464
  }, {
465
465
  out: {};
466
466
  in: {};
467
- }>>;
468
- jobFunctions: z.ZodArray<z.ZodObject<{
467
+ }>>>;
468
+ jobFunctions: z.ZodOptional<z.ZodArray<z.ZodObject<{
469
469
  name: z.ZodString;
470
470
  id: z.ZodUUID;
471
471
  slug: z.ZodString;
472
472
  }, {
473
473
  out: {};
474
474
  in: {};
475
- }>>;
475
+ }>>>;
476
476
  }, {
477
477
  out: {};
478
478
  in: {};
@@ -1446,10 +1446,16 @@ export declare const AdminPersonByEmailParamsSchema: z.ZodObject<{
1446
1446
  }>;
1447
1447
  export declare const AdminPersonByPhoneParamsSchema: z.ZodObject<{
1448
1448
  phone: z.ZodString;
1449
- }, z.core.$strip>;
1449
+ }, {
1450
+ out: {};
1451
+ in: {};
1452
+ }>;
1450
1453
  export declare const AdminPersonByIdNanoSchema: z.ZodObject<{
1451
1454
  idNano: z.ZodString;
1452
- }, z.core.$strip>;
1455
+ }, {
1456
+ out: {};
1457
+ in: {};
1458
+ }>;
1453
1459
  export declare const AdminPersonUpdateParamsSchema: z.ZodObject<{
1454
1460
  id: z.ZodUUID;
1455
1461
  }, {
@@ -1463,6 +1469,32 @@ export declare const AdminPersonDeleteParamsSchema: z.ZodObject<{
1463
1469
  in: {};
1464
1470
  }>;
1465
1471
  export declare const AdminPersonListQuerySchema: z.ZodObject<{
1472
+ limit: z.ZodOptional<z.ZodNumber>;
1473
+ offset: z.ZodOptional<z.ZodNumber>;
1474
+ sort: z.ZodOptional<z.ZodObject<{
1475
+ field: z.ZodString;
1476
+ direction: z.ZodEnum<{
1477
+ asc: "asc";
1478
+ desc: "desc";
1479
+ }>;
1480
+ }, z.core.$strip>>;
1481
+ filter: z.ZodOptional<z.ZodObject<{
1482
+ nameEmail: z.ZodOptional<z.ZodString>;
1483
+ hasLinkedInUrl: z.ZodOptional<z.ZodBoolean>;
1484
+ source: z.ZodOptional<z.ZodEnum<{
1485
+ NETWORK: "NETWORK";
1486
+ WEBSITE: "WEBSITE";
1487
+ SOCIAL_MEDIA: "SOCIAL_MEDIA";
1488
+ SOURCED: "SOURCED";
1489
+ }>>;
1490
+ location: z.ZodOptional<z.ZodObject<{
1491
+ miles: z.ZodNumber;
1492
+ lat: z.ZodNumber;
1493
+ lon: z.ZodNumber;
1494
+ }, z.core.$strip>>;
1495
+ }, z.core.$strip>>;
1496
+ }, z.core.$strip>;
1497
+ export declare const AdminPersonListAdvancedQuerySchema: z.ZodObject<{
1466
1498
  limit: z.ZodOptional<z.ZodNumber>;
1467
1499
  offset: z.ZodOptional<z.ZodNumber>;
1468
1500
  sort: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -1599,7 +1631,7 @@ export type AdminPersonByEmailParams = z.infer<typeof AdminPersonByEmailParamsSc
1599
1631
  export type AdminPersonByPhoneParams = z.infer<typeof AdminPersonByPhoneParamsSchema>;
1600
1632
  export type AdminPersonByIdNanoParams = z.infer<typeof AdminPersonByIdNanoSchema>;
1601
1633
  export type AdminPersonResult = AdminPerson;
1602
- export type AdminPersonListQuery = z.infer<typeof AdminPersonListQuerySchema>;
1634
+ export type AdminPersonListAdvancedQuery = z.infer<typeof AdminPersonListAdvancedQuerySchema>;
1603
1635
  export type AdminPersonListResult = ListResponse<z.infer<typeof AdminPersonSelectSchema>>;
1604
1636
  export type AdminPersonCreateInput = z.infer<typeof AdminPersonCreateSchema>;
1605
1637
  export type AdminPersonCreateResult = Pick<AdminPerson, 'id'>;
@@ -1607,18 +1639,18 @@ export type AdminPersonUpdateParams = z.infer<typeof AdminPersonUpdateParamsSche
1607
1639
  export type AdminPersonUpdateInput = Partial<AdminPerson>;
1608
1640
  export type AdminPersonDeleteParams = z.infer<typeof AdminPersonDeleteParamsSchema>;
1609
1641
  export declare const ResumeParserSchema: z.ZodObject<{
1610
- email: z.ZodString;
1611
- country: z.ZodNullable<z.ZodEnum<{
1642
+ email: z.ZodOptional<z.ZodString>;
1643
+ country: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1612
1644
  UNITED_STATES: "UNITED_STATES";
1613
1645
  CANADA: "CANADA";
1614
- }>>;
1615
- gender: z.ZodNullable<z.ZodEnum<{
1646
+ }>>>;
1647
+ gender: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1616
1648
  MAN: "MAN";
1617
1649
  WOMAN: "WOMAN";
1618
1650
  NON_BINARY: "NON_BINARY";
1619
1651
  UNDISCLOSED: "UNDISCLOSED";
1620
- }>>;
1621
- state: z.ZodNullable<z.ZodEnum<{
1652
+ }>>>;
1653
+ state: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1622
1654
  AL: "AL";
1623
1655
  AK: "AK";
1624
1656
  AS: "AS";
@@ -1691,14 +1723,14 @@ export declare const ResumeParserSchema: z.ZodObject<{
1691
1723
  QC: "QC";
1692
1724
  SK: "SK";
1693
1725
  YT: "YT";
1694
- }>>;
1695
- city: z.ZodNullable<z.ZodString>;
1696
- websiteUrl: z.ZodNullable<z.ZodString>;
1697
- linkedInUrl: z.ZodNullable<z.ZodString>;
1698
- firstName: z.ZodNullable<z.ZodString>;
1699
- lastName: z.ZodNullable<z.ZodString>;
1700
- phone: z.ZodNullable<z.ZodString>;
1701
- educations: z.ZodArray<z.ZodObject<{
1726
+ }>>>;
1727
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1728
+ websiteUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1729
+ linkedInUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1730
+ firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1731
+ lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1732
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1733
+ educations: z.ZodOptional<z.ZodArray<z.ZodObject<{
1702
1734
  field: z.ZodNullable<z.ZodEnum<{
1703
1735
  ACCOUNTING: "ACCOUNTING";
1704
1736
  ARCHITECTURE: "ARCHITECTURE";
@@ -1730,7 +1762,7 @@ export declare const ResumeParserSchema: z.ZodObject<{
1730
1762
  }, {
1731
1763
  out: {};
1732
1764
  in: {};
1733
- }>>;
1765
+ }>>>;
1734
1766
  skills: z.ZodArray<z.ZodString>;
1735
1767
  experiences: z.ZodArray<z.ZodObject<{
1736
1768
  id: z.ZodUUID;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ResumeParserSchema = exports.AdminPersonConnectionsResultSchema = exports.AdminPersonConnectionsPersonSchema = exports.AdminPersonConnectionsParamsSchema = exports.AdminPersonListQuerySchema = exports.AdminPersonDeleteParamsSchema = exports.AdminPersonUpdateParamsSchema = exports.AdminPersonByIdNanoSchema = exports.AdminPersonByPhoneParamsSchema = exports.AdminPersonByEmailParamsSchema = exports.AdminPersonParamsSchema = exports.AdminPersonUpdateSchema = exports.AdminPersonSelectSchema = exports.AdminPersonCreateSchema = exports.AdminPersonExperienceSelectSchema = exports.AdminPersonEducationSelectSchema = void 0;
6
+ exports.ResumeParserSchema = exports.AdminPersonConnectionsResultSchema = exports.AdminPersonConnectionsPersonSchema = exports.AdminPersonConnectionsParamsSchema = exports.AdminPersonListAdvancedQuerySchema = exports.AdminPersonListQuerySchema = exports.AdminPersonDeleteParamsSchema = exports.AdminPersonUpdateParamsSchema = exports.AdminPersonByIdNanoSchema = exports.AdminPersonByPhoneParamsSchema = exports.AdminPersonByEmailParamsSchema = exports.AdminPersonParamsSchema = exports.AdminPersonUpdateSchema = exports.AdminPersonSelectSchema = exports.AdminPersonCreateSchema = exports.AdminPersonExperienceSelectSchema = exports.AdminPersonEducationSelectSchema = void 0;
7
7
  const drizzle_zod_1 = require("drizzle-zod");
8
8
  const core_1 = require("../../core");
9
9
  const utils_1 = require("../../../utils");
@@ -55,15 +55,21 @@ exports.AdminPersonCreateSchema = (0, drizzle_zod_1.createInsertSchema)(core_1.p
55
55
  .omit({
56
56
  idNano: true
57
57
  });
58
- exports.AdminPersonSelectSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.person).extend({
59
- skills: v4_1.z.array((0, drizzle_zod_1.createSelectSchema)(core_1.skill).pick({
58
+ exports.AdminPersonSelectSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.person)
59
+ .partial()
60
+ .extend({
61
+ skills: v4_1.z
62
+ .array((0, drizzle_zod_1.createSelectSchema)(core_1.skill).pick({
60
63
  id: true,
61
64
  name: true
62
- })),
63
- tags: v4_1.z.array((0, drizzle_zod_1.createSelectSchema)(core_1.tag).pick({
65
+ }))
66
+ .optional(),
67
+ tags: v4_1.z
68
+ .array((0, drizzle_zod_1.createSelectSchema)(core_1.tag).pick({
64
69
  id: true,
65
70
  name: true
66
- })),
71
+ }))
72
+ .optional(),
67
73
  sourceCampaign: (0, drizzle_zod_1.createSelectSchema)(core_1.campaign)
68
74
  .pick({
69
75
  id: true,
@@ -71,12 +77,15 @@ exports.AdminPersonSelectSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.p
71
77
  })
72
78
  .nullable()
73
79
  .optional(),
74
- client: (0, drizzle_zod_1.createSelectSchema)(core_1.client).pick({
80
+ client: (0, drizzle_zod_1.createSelectSchema)(core_1.client)
81
+ .pick({
75
82
  id: true,
76
83
  name: true
77
- }),
78
- educations: v4_1.z.array(exports.AdminPersonEducationSelectSchema),
79
- experiences: v4_1.z.array(exports.AdminPersonExperienceSelectSchema),
84
+ })
85
+ .nullable()
86
+ .optional(),
87
+ educations: v4_1.z.array(exports.AdminPersonEducationSelectSchema).optional(),
88
+ experiences: v4_1.z.array(exports.AdminPersonExperienceSelectSchema).optional(),
80
89
  _referralsCount: v4_1.z.number().nullable().optional(),
81
90
  _referredIndustries: v4_1.z.array(v4_1.z.string()).nullable().optional(),
82
91
  _referredLocations: v4_1.z.array(v4_1.z.string()).nullable().optional(),
@@ -88,40 +97,44 @@ exports.AdminPersonSelectSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.p
88
97
  _currentJobFunction: v4_1.z.string().nullable().optional(),
89
98
  _currentIndustry: v4_1.z.string().nullable().optional(),
90
99
  _calculatedIsMember: v4_1.z.boolean().optional(),
91
- industries: v4_1.z.array((0, drizzle_zod_1.createSelectSchema)(core_1.industry).pick({
100
+ industries: v4_1.z
101
+ .array((0, drizzle_zod_1.createSelectSchema)(core_1.industry).pick({
92
102
  id: true,
93
103
  name: true,
94
104
  slug: true
95
- })),
96
- jobFunctions: v4_1.z.array((0, drizzle_zod_1.createSelectSchema)(core_1.jobFunction).pick({
105
+ }))
106
+ .optional(),
107
+ jobFunctions: v4_1.z
108
+ .array((0, drizzle_zod_1.createSelectSchema)(core_1.jobFunction).pick({
97
109
  id: true,
98
110
  name: true,
99
111
  slug: true
100
112
  }))
113
+ .optional()
101
114
  });
102
115
  exports.AdminPersonUpdateSchema = (0, drizzle_zod_1.createUpdateSchema)(core_1.person, {
103
116
  email: utils_1.EmailSchema.optional(),
104
117
  addedAt: v4_1.z.coerce.date().optional(),
105
118
  phone: utils_1.OptionalPhoneSchema
106
119
  });
107
- exports.AdminPersonParamsSchema = exports.AdminPersonSelectSchema.pick({
120
+ exports.AdminPersonParamsSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.person).pick({
108
121
  id: true
109
122
  });
110
- exports.AdminPersonByEmailParamsSchema = exports.AdminPersonSelectSchema.pick({
123
+ exports.AdminPersonByEmailParamsSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.person).pick({
111
124
  email: true
112
125
  });
113
- exports.AdminPersonByPhoneParamsSchema = v4_1.z.object({
126
+ exports.AdminPersonByPhoneParamsSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.person, {
114
127
  phone: v4_1.z.string()
128
+ }).pick({
129
+ phone: true
115
130
  });
116
- exports.AdminPersonByIdNanoSchema = v4_1.z.object({
131
+ exports.AdminPersonByIdNanoSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.person, {
117
132
  idNano: v4_1.z.string()
133
+ }).pick({
134
+ idNano: true
118
135
  });
119
- exports.AdminPersonUpdateParamsSchema = exports.AdminPersonSelectSchema.pick({
120
- id: true
121
- });
122
- exports.AdminPersonDeleteParamsSchema = exports.AdminPersonSelectSchema.pick({
123
- id: true
124
- });
136
+ exports.AdminPersonUpdateParamsSchema = exports.AdminPersonParamsSchema;
137
+ exports.AdminPersonDeleteParamsSchema = exports.AdminPersonParamsSchema;
125
138
  const FilterSchema = v4_1.z.object({
126
139
  field: v4_1.z.string(),
127
140
  isDynamicColumn: v4_1.z.boolean(),
@@ -158,6 +171,21 @@ const NestedFilterSchema = v4_1.z.lazy(() => v4_1.z.object({
158
171
  .optional()
159
172
  }));
160
173
  exports.AdminPersonListQuerySchema = utils_1.ListQuerySchema.extend({
174
+ filter: v4_1.z
175
+ .object({
176
+ nameEmail: v4_1.z.string(),
177
+ hasLinkedInUrl: v4_1.z.boolean(),
178
+ source: v4_1.z.enum(core_1.PersonSources.enumValues),
179
+ location: v4_1.z.object({
180
+ miles: v4_1.z.number(),
181
+ lat: v4_1.z.number(),
182
+ lon: v4_1.z.number()
183
+ })
184
+ })
185
+ .partial()
186
+ .optional()
187
+ });
188
+ exports.AdminPersonListAdvancedQuerySchema = utils_1.ListQuerySchema.extend({
161
189
  sort: v4_1.z
162
190
  .array(v4_1.z.object({
163
191
  field: v4_1.z.string(),
@@ -168,10 +196,10 @@ exports.AdminPersonListQuerySchema = utils_1.ListQuerySchema.extend({
168
196
  .union([FilterSchema, GeoSchema, CustomQuerySchema, NestedFilterSchema])
169
197
  .optional()
170
198
  });
171
- exports.AdminPersonConnectionsParamsSchema = exports.AdminPersonSelectSchema.pick({
199
+ exports.AdminPersonConnectionsParamsSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.person).pick({
172
200
  id: true
173
201
  });
174
- exports.AdminPersonConnectionsPersonSchema = exports.AdminPersonSelectSchema.pick({
202
+ exports.AdminPersonConnectionsPersonSchema = (0, drizzle_zod_1.createSelectSchema)(core_1.person).pick({
175
203
  id: true,
176
204
  email: true,
177
205
  fullName: true
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/admin/persons/index.ts"],"names":[],"mappings":";;;;;;AAAA,6CAIoB;AACpB,qCAUmB;AACnB,0CAKuB;AACvB,+BAA0B;AAC1B,kDAG2B;AAC3B,kDAAyB;AAGzB,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,EAAC,gBA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C,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 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'\nimport { create } from 'domain'\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).extend({\n skills: z.array(\n createSelectSchema(skill).pick({\n id: true,\n name: true\n })\n ),\n tags: z.array(\n createSelectSchema(tag).pick({\n id: true,\n name: true\n })\n ),\n sourceCampaign: createSelectSchema(campaign)\n .pick({\n id: true,\n name: true\n })\n .nullable()\n .optional(),\n client: createSelectSchema(client).pick({\n id: true,\n name: true\n }),\n educations: z.array(AdminPersonEducationSelectSchema),\n experiences: z.array(AdminPersonExperienceSelectSchema),\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.array(\n createSelectSchema(industry).pick({\n id: true,\n name: true,\n slug: true\n })\n ),\n jobFunctions: z.array(\n createSelectSchema(jobFunction).pick({\n id: true,\n name: true,\n slug: true\n })\n )\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 = AdminPersonSelectSchema.pick({\n id: true\n})\nexport const AdminPersonByEmailParamsSchema = AdminPersonSelectSchema.pick({\n email: true\n})\nexport const AdminPersonByPhoneParamsSchema = z.object({\n phone: z.string()\n})\nexport const AdminPersonByIdNanoSchema = z.object({\n idNano: z.string()\n})\n\nexport const AdminPersonUpdateParamsSchema = AdminPersonSelectSchema.pick({\n id: true\n})\n\nexport const AdminPersonDeleteParamsSchema = AdminPersonSelectSchema.pick({\n id: true\n})\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 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 = AdminPersonSelectSchema.pick({\n id: true\n})\nexport const AdminPersonConnectionsPersonSchema = AdminPersonSelectSchema.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 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,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C,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 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@the-inkwell/shared",
3
- "version": "0.2.170",
3
+ "version": "0.2.172",
4
4
  "description": "Shared code for Inkwell",
5
5
  "license": "ISC",
6
6
  "author": "Inkwell (Rob Yedlin & Saimon Alam)",