@the-inkwell/shared 0.2.180 → 0.2.181
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/schema/public/apply/index.d.ts +1 -0
- package/dist/schema/public/apply/index.js +4 -2
- package/dist/schema/public/apply/index.js.map +1 -1
- package/dist/schema/public/hire/index.js +2 -1
- package/dist/schema/public/hire/index.js.map +1 -1
- package/dist/schema/public/refer/index.d.ts +3 -0
- package/dist/schema/public/refer/index.js +17 -11
- package/dist/schema/public/refer/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export declare const PublicApplySignedOutCreateSchema: z.ZodObject<{
|
|
|
8
8
|
firstName: z.ZodString;
|
|
9
9
|
lastName: z.ZodString;
|
|
10
10
|
phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
11
|
+
discoveredThrough: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
11
12
|
}, z.core.$strict>;
|
|
12
13
|
affiliateIdNano: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
13
14
|
}, z.core.$strict>;
|
|
@@ -17,13 +17,15 @@ exports.PublicApplySignedOutCreateSchema = v4_1.z.strictObject({
|
|
|
17
17
|
lastName: utils_1.PersonLastNameSchema,
|
|
18
18
|
phone: utils_1.OptionalPhoneSchema,
|
|
19
19
|
email: utils_1.EmailSchema,
|
|
20
|
-
linkedInUrl: utils_1.LinkedInUrlSchema
|
|
20
|
+
linkedInUrl: utils_1.LinkedInUrlSchema,
|
|
21
|
+
discoveredThrough: v4_1.z.string().optional().nullable()
|
|
21
22
|
}).pick({
|
|
22
23
|
firstName: true,
|
|
23
24
|
lastName: true,
|
|
24
25
|
email: true,
|
|
25
26
|
phone: true,
|
|
26
|
-
linkedInUrl: true
|
|
27
|
+
linkedInUrl: true,
|
|
28
|
+
discoveredThrough: true
|
|
27
29
|
}).shape
|
|
28
30
|
}),
|
|
29
31
|
affiliateIdNano: utils_1.OptionalStringSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/public/apply/index.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAChD,qCAAmC;AACnC,+BAA0B;AAC1B,0CAOuB;AAEvB,eAAe;AAEf,MAAM,eAAe,GAAG,MAAC,CAAC,YAAY,CAAC;IACrC,cAAc,EAAE,MAAC,CAAC,MAAM,EAAE;IAC1B,cAAc,EAAE,4BAAoB;CACrC,CAAC,CAAA;AAEW,QAAA,gCAAgC,GAAG,MAAC,CAAC,YAAY,CAAC;IAC7D,SAAS,EAAE,MAAC,CAAC,YAAY,CAAC;QACxB,GAAG,IAAA,gCAAkB,EAAC,aAAM,EAAE;YAC5B,SAAS,EAAE,6BAAqB;YAChC,QAAQ,EAAE,4BAAoB;YAC9B,KAAK,EAAE,2BAAmB;YAC1B,KAAK,EAAE,mBAAW;YAClB,WAAW,EAAE,yBAAiB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/public/apply/index.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAChD,qCAAmC;AACnC,+BAA0B;AAC1B,0CAOuB;AAEvB,eAAe;AAEf,MAAM,eAAe,GAAG,MAAC,CAAC,YAAY,CAAC;IACrC,cAAc,EAAE,MAAC,CAAC,MAAM,EAAE;IAC1B,cAAc,EAAE,4BAAoB;CACrC,CAAC,CAAA;AAEW,QAAA,gCAAgC,GAAG,MAAC,CAAC,YAAY,CAAC;IAC7D,SAAS,EAAE,MAAC,CAAC,YAAY,CAAC;QACxB,GAAG,IAAA,gCAAkB,EAAC,aAAM,EAAE;YAC5B,SAAS,EAAE,6BAAqB;YAChC,QAAQ,EAAE,4BAAoB;YAC9B,KAAK,EAAE,2BAAmB;YAC1B,KAAK,EAAE,mBAAW;YAClB,WAAW,EAAE,yBAAiB;YAC9B,iBAAiB,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;SACpD,CAAC,CAAC,IAAI,CAAC;YACN,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,IAAI;YACX,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,IAAI;SACxB,CAAC,CAAC,KAAK;KACT,CAAC;IACF,eAAe,EAAE,4BAAoB;IACrC,GAAG,eAAe,CAAC,KAAK;CACzB,CAAC,CAAA;AAEW,QAAA,+BAA+B,GAAG,eAAe,CAAA","sourcesContent":["import { createInsertSchema } from 'drizzle-zod'\nimport { person } from '../../core'\nimport { z } from 'zod/v4'\nimport {\n EmailSchema,\n LinkedInUrlSchema,\n OptionalPhoneSchema,\n OptionalStringSchema,\n PersonFirstNameSchema,\n PersonLastNameSchema\n} from '../../../utils'\n\n//// validators\n\nconst BaseApplySchema = z.strictObject({\n positionIdNano: z.string(),\n campaignIdNano: OptionalStringSchema\n})\n\nexport const PublicApplySignedOutCreateSchema = z.strictObject({\n candidate: z.strictObject({\n ...createInsertSchema(person, {\n firstName: PersonFirstNameSchema,\n lastName: PersonLastNameSchema,\n phone: OptionalPhoneSchema,\n email: EmailSchema,\n linkedInUrl: LinkedInUrlSchema,\n discoveredThrough: z.string().optional().nullable()\n }).pick({\n firstName: true,\n lastName: true,\n email: true,\n phone: true,\n linkedInUrl: true,\n discoveredThrough: true\n }).shape\n }),\n affiliateIdNano: OptionalStringSchema,\n ...BaseApplySchema.shape\n})\n\nexport const PublicApplySignedInCreateSchema = BaseApplySchema\n\n//// types\n\nexport type PublicApplySignedOutCreateInput = z.infer<\n typeof PublicApplySignedOutCreateSchema\n>\nexport type PublicApplySignedInCreateInput = z.infer<\n typeof PublicApplySignedInCreateSchema\n>\n"]}
|
|
@@ -13,7 +13,8 @@ exports.PublicHireCreateSchema = v4_1.z.strictObject({
|
|
|
13
13
|
lastName: utils_1.PersonLastNameSchema,
|
|
14
14
|
phone: utils_1.OptionalPhoneSchema,
|
|
15
15
|
email: utils_1.EmailSchema,
|
|
16
|
-
linkedInUrl: utils_1.LinkedInUrlSchema
|
|
16
|
+
linkedInUrl: utils_1.LinkedInUrlSchema,
|
|
17
|
+
discoveredThrough: v4_1.z.string().optional().nullable()
|
|
17
18
|
}).pick({
|
|
18
19
|
firstName: true,
|
|
19
20
|
lastName: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/public/hire/index.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAChD,qCAA2C;AAC3C,+BAA0B;AAC1B,0CAOuB;AAEvB,eAAe;AAEF,QAAA,sBAAsB,GAAG,MAAC,CAAC,YAAY,CAAC;IACnD,OAAO,EAAE,MAAC,CAAC,YAAY,CAAC;QACtB,GAAG,IAAA,gCAAkB,EAAC,aAAM,EAAE;YAC5B,SAAS,EAAE,6BAAqB;YAChC,QAAQ,EAAE,4BAAoB;YAC9B,KAAK,EAAE,2BAAmB;YAC1B,KAAK,EAAE,mBAAW;YAClB,WAAW,EAAE,yBAAiB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/public/hire/index.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAChD,qCAA2C;AAC3C,+BAA0B;AAC1B,0CAOuB;AAEvB,eAAe;AAEF,QAAA,sBAAsB,GAAG,MAAC,CAAC,YAAY,CAAC;IACnD,OAAO,EAAE,MAAC,CAAC,YAAY,CAAC;QACtB,GAAG,IAAA,gCAAkB,EAAC,aAAM,EAAE;YAC5B,SAAS,EAAE,6BAAqB;YAChC,QAAQ,EAAE,4BAAoB;YAC9B,KAAK,EAAE,2BAAmB;YAC1B,KAAK,EAAE,mBAAW;YAClB,WAAW,EAAE,yBAAiB;YAC9B,iBAAiB,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;SACpD,CAAC,CAAC,IAAI,CAAC;YACN,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,IAAI;YACX,WAAW,EAAE,IAAI;SAClB,CAAC,CAAC,KAAK;KACT,CAAC;IACF,eAAe,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,+BAA+B,CAAC;IACnE,eAAe,EAAE,4BAAoB;IACrC,cAAc,EAAE,4BAAoB;IACpC,OAAO,EAAE,MAAC,CAAC,YAAY,CAAC;QACtB,GAAG,IAAA,gCAAkB,EAAC,aAAM,EAAE;YAC5B,IAAI,EAAE,MAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,0BAA0B,CAAC;YACnD,UAAU,EAAE,MAAC,CAAC,GAAG,CAAC,aAAa,CAAC;SACjC,CAAC,CAAC,IAAI,CAAC;YACN,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC,KAAK;KACT,CAAC;CACH,CAAC,CAAA","sourcesContent":["import { createInsertSchema } from 'drizzle-zod'\nimport { client, person } from '../../core'\nimport { z } from 'zod/v4'\nimport {\n EmailSchema,\n LinkedInUrlSchema,\n OptionalPhoneSchema,\n OptionalStringSchema,\n PersonFirstNameSchema,\n PersonLastNameSchema\n} from '../../../utils'\n\n//// validators\n\nexport const PublicHireCreateSchema = z.strictObject({\n contact: z.strictObject({\n ...createInsertSchema(person, {\n firstName: PersonFirstNameSchema,\n lastName: PersonLastNameSchema,\n phone: OptionalPhoneSchema,\n email: EmailSchema,\n linkedInUrl: LinkedInUrlSchema,\n discoveredThrough: z.string().optional().nullable()\n }).pick({\n firstName: true,\n lastName: true,\n email: true,\n phone: true,\n linkedInUrl: true\n }).shape\n }),\n positionDetails: z.string().min(1, 'Position details are required'),\n affiliateIdNano: OptionalStringSchema,\n campaignIdNano: OptionalStringSchema,\n company: z.strictObject({\n ...createInsertSchema(client, {\n name: z.string().min(1, 'Company name is required'),\n websiteUrl: z.url('Invalid URL')\n }).pick({\n name: true,\n websiteUrl: true\n }).shape\n })\n})\n\n//// types\n\nexport type PublicHireCreateInput = z.infer<typeof PublicHireCreateSchema>\n"]}
|
|
@@ -20,6 +20,7 @@ export declare const PublicReferClientSignedOutCreateSchema: z.ZodObject<{
|
|
|
20
20
|
firstName: z.ZodString;
|
|
21
21
|
lastName: z.ZodString;
|
|
22
22
|
phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
23
|
+
discoveredThrough: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
23
24
|
}, z.core.$strict>;
|
|
24
25
|
contact: z.ZodObject<{
|
|
25
26
|
email: z.ZodEmail;
|
|
@@ -52,6 +53,7 @@ export declare const PublicReferCandidacySignedOutCreateSchema: z.ZodObject<{
|
|
|
52
53
|
firstName: z.ZodString;
|
|
53
54
|
lastName: z.ZodString;
|
|
54
55
|
phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
56
|
+
discoveredThrough: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
55
57
|
}, z.core.$strict>;
|
|
56
58
|
referred: z.ZodObject<{
|
|
57
59
|
email: z.ZodEmail;
|
|
@@ -82,6 +84,7 @@ export declare const PublicReferCandidacyPositionSignedOutCreateSchema: z.ZodObj
|
|
|
82
84
|
firstName: z.ZodString;
|
|
83
85
|
lastName: z.ZodString;
|
|
84
86
|
phone: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
87
|
+
discoveredThrough: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
85
88
|
}, z.core.$strict>;
|
|
86
89
|
referred: z.ZodObject<{
|
|
87
90
|
email: z.ZodEmail;
|
|
@@ -12,15 +12,21 @@ const PersonSchema = v4_1.z.strictObject({
|
|
|
12
12
|
lastName: utils_1.PersonLastNameSchema,
|
|
13
13
|
phone: utils_1.OptionalPhoneSchema,
|
|
14
14
|
email: utils_1.EmailSchema,
|
|
15
|
-
linkedInUrl: utils_1.LinkedInUrlSchema
|
|
15
|
+
linkedInUrl: utils_1.LinkedInUrlSchema,
|
|
16
|
+
discoveredThrough: v4_1.z.string().optional().nullable()
|
|
16
17
|
}).pick({
|
|
17
18
|
firstName: true,
|
|
18
19
|
lastName: true,
|
|
19
20
|
email: true,
|
|
20
21
|
phone: true,
|
|
21
|
-
linkedInUrl: true
|
|
22
|
+
linkedInUrl: true,
|
|
23
|
+
discoveredThrough: true
|
|
22
24
|
}).shape
|
|
23
25
|
});
|
|
26
|
+
const ReferredPersonSchema = PersonSchema.omit({
|
|
27
|
+
discoveredThrough: true
|
|
28
|
+
});
|
|
29
|
+
const ReferrerPersonSchema = PersonSchema;
|
|
24
30
|
const ClientSchema = v4_1.z.strictObject({
|
|
25
31
|
...(0, drizzle_zod_1.createInsertSchema)(core_1.client, {
|
|
26
32
|
name: v4_1.z.string().min(1, 'Company name is required'),
|
|
@@ -31,36 +37,36 @@ const ClientSchema = v4_1.z.strictObject({
|
|
|
31
37
|
}).shape
|
|
32
38
|
});
|
|
33
39
|
exports.PublicReferClientSignedInCreateSchema = v4_1.z.strictObject({
|
|
34
|
-
contact:
|
|
40
|
+
contact: ReferredPersonSchema,
|
|
35
41
|
company: ClientSchema,
|
|
36
42
|
campaignIdNano: utils_1.OptionalStringSchema
|
|
37
43
|
});
|
|
38
44
|
exports.PublicReferClientSignedOutCreateSchema = v4_1.z.strictObject({
|
|
39
|
-
referrer:
|
|
40
|
-
contact:
|
|
45
|
+
referrer: ReferrerPersonSchema,
|
|
46
|
+
contact: ReferredPersonSchema,
|
|
41
47
|
company: ClientSchema,
|
|
42
48
|
affiliateIdNano: utils_1.OptionalStringSchema,
|
|
43
49
|
campaignIdNano: utils_1.OptionalStringSchema
|
|
44
50
|
});
|
|
45
51
|
exports.PublicReferCandidacySignedInCreateSchema = v4_1.z.strictObject({
|
|
46
|
-
referred:
|
|
52
|
+
referred: ReferredPersonSchema,
|
|
47
53
|
campaignIdNano: utils_1.OptionalStringSchema
|
|
48
54
|
});
|
|
49
55
|
exports.PublicReferCandidacySignedOutCreateSchema = v4_1.z.strictObject({
|
|
50
|
-
referrer:
|
|
51
|
-
referred:
|
|
56
|
+
referrer: ReferrerPersonSchema,
|
|
57
|
+
referred: ReferredPersonSchema,
|
|
52
58
|
affiliateIdNano: utils_1.OptionalStringSchema,
|
|
53
59
|
campaignIdNano: utils_1.OptionalStringSchema
|
|
54
60
|
});
|
|
55
61
|
exports.PublicReferCandidacyPositionSignedInCreateSchema = v4_1.z.strictObject({
|
|
56
62
|
positionIdNano: v4_1.z.string(),
|
|
57
|
-
referred:
|
|
63
|
+
referred: ReferredPersonSchema,
|
|
58
64
|
campaignIdNano: utils_1.OptionalStringSchema
|
|
59
65
|
});
|
|
60
66
|
exports.PublicReferCandidacyPositionSignedOutCreateSchema = v4_1.z.strictObject({
|
|
61
67
|
positionIdNano: v4_1.z.string(),
|
|
62
|
-
referrer:
|
|
63
|
-
referred:
|
|
68
|
+
referrer: ReferrerPersonSchema,
|
|
69
|
+
referred: ReferredPersonSchema,
|
|
64
70
|
affiliateIdNano: utils_1.OptionalStringSchema,
|
|
65
71
|
campaignIdNano: utils_1.OptionalStringSchema
|
|
66
72
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/public/refer/index.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAChD,+BAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/public/refer/index.ts"],"names":[],"mappings":"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","sourcesContent":["import { createInsertSchema } from 'drizzle-zod'\nimport { z } from 'zod/v4'\nimport { client, person } from '../../core'\nimport {\n EmailSchema,\n LinkedInUrlSchema,\n OptionalPhoneSchema,\n OptionalStringSchema,\n PersonFirstNameSchema,\n PersonLastNameSchema\n} from '../../../utils'\n\n//// validators\n\nconst PersonSchema = z.strictObject({\n ...createInsertSchema(person, {\n firstName: PersonFirstNameSchema,\n lastName: PersonLastNameSchema,\n phone: OptionalPhoneSchema,\n email: EmailSchema,\n linkedInUrl: LinkedInUrlSchema,\n discoveredThrough: z.string().optional().nullable()\n }).pick({\n firstName: true,\n lastName: true,\n email: true,\n phone: true,\n linkedInUrl: true,\n discoveredThrough: true\n }).shape\n})\n\nconst ReferredPersonSchema = PersonSchema.omit({\n discoveredThrough: true\n})\n\nconst ReferrerPersonSchema = PersonSchema\n\nconst ClientSchema = z.strictObject({\n ...createInsertSchema(client, {\n name: z.string().min(1, 'Company name is required'),\n websiteUrl: z.url('Invalid URL')\n }).pick({\n name: true,\n websiteUrl: true\n }).shape\n})\n\nexport const PublicReferClientSignedInCreateSchema = z.strictObject({\n contact: ReferredPersonSchema,\n company: ClientSchema,\n campaignIdNano: OptionalStringSchema\n})\n\nexport const PublicReferClientSignedOutCreateSchema = z.strictObject({\n referrer: ReferrerPersonSchema,\n contact: ReferredPersonSchema,\n company: ClientSchema,\n affiliateIdNano: OptionalStringSchema,\n campaignIdNano: OptionalStringSchema\n})\n\nexport const PublicReferCandidacySignedInCreateSchema = z.strictObject({\n referred: ReferredPersonSchema,\n campaignIdNano: OptionalStringSchema\n})\n\nexport const PublicReferCandidacySignedOutCreateSchema = z.strictObject({\n referrer: ReferrerPersonSchema,\n referred: ReferredPersonSchema,\n affiliateIdNano: OptionalStringSchema,\n campaignIdNano: OptionalStringSchema\n})\n\nexport const PublicReferCandidacyPositionSignedInCreateSchema = z.strictObject({\n positionIdNano: z.string(),\n referred: ReferredPersonSchema,\n campaignIdNano: OptionalStringSchema\n})\n\nexport const PublicReferCandidacyPositionSignedOutCreateSchema = z.strictObject(\n {\n positionIdNano: z.string(),\n referrer: ReferrerPersonSchema,\n referred: ReferredPersonSchema,\n affiliateIdNano: OptionalStringSchema,\n campaignIdNano: OptionalStringSchema\n }\n)\n\nexport const PublicReferCreateResultSchema = z.strictObject({\n referralId: z.uuid()\n})\n\nexport const PublicReferWarmIntroCreateSchema = z.strictObject({\n referralId: z.uuid(),\n message: z.string().min(1, 'Message is required')\n})\n\n//// types\n\n// referral\n\nexport type PublicReferClientSignedInCreateInput = z.infer<\n typeof PublicReferClientSignedInCreateSchema\n>\nexport type PublicReferClientSignedOutCreateInput = z.infer<\n typeof PublicReferClientSignedOutCreateSchema\n>\nexport type PublicReferCandidacySignedInCreateInput = z.infer<\n typeof PublicReferCandidacySignedInCreateSchema\n>\nexport type PublicReferCandidacySignedOutCreateInput = z.infer<\n typeof PublicReferCandidacySignedOutCreateSchema\n>\nexport type PublicReferCandidacyPositionSignedInCreateInput = z.infer<\n typeof PublicReferCandidacyPositionSignedInCreateSchema\n>\nexport type PublicReferCandidacyPositionSignedOutCreateInput = z.infer<\n typeof PublicReferCandidacyPositionSignedOutCreateSchema\n>\n\nexport type PublicReferCreateResult = z.infer<\n typeof PublicReferCreateResultSchema\n>\n\n// warm intro\n\nexport type PublicReferWarmIntroCreateInput = z.infer<\n typeof PublicReferWarmIntroCreateSchema\n>\n"]}
|