lancer-shared 1.2.37 → 1.2.39

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.
Files changed (209) hide show
  1. package/dist/bundle.cjs.js +9 -14
  2. package/dist/constants/account-status.d.ts +3 -0
  3. package/dist/constants/account-status.js +17 -0
  4. package/dist/constants/collections.js +13 -11
  5. package/dist/constants/common-questions.js +4 -1
  6. package/dist/constants/index.js +32 -10
  7. package/dist/constants/job-filter-options.js +4 -1
  8. package/dist/constants/job-status.js +12 -7
  9. package/dist/constants/mappings/countryMapping.js +3 -1
  10. package/dist/constants/mappings/regionMapping.js +3 -1
  11. package/dist/constants/organization.d.ts +2 -2
  12. package/dist/constants/proxies.d.ts +4 -0
  13. package/dist/constants/routes.js +37 -39
  14. package/dist/constants/upwork-accounts.js +6 -3
  15. package/dist/constants/upwork-filters.d.ts +5 -0
  16. package/dist/constants/upwork-filters.js +75 -0
  17. package/dist/index.js +20 -4
  18. package/dist/schemas/account/account-status.js +5 -2
  19. package/dist/schemas/account/bidder-account.d.ts +9 -10
  20. package/dist/schemas/account/bidder-account.js +24 -22
  21. package/dist/schemas/account/exceptions/no-bidder-accounts-available.d.ts +5 -0
  22. package/dist/schemas/account/index.js +19 -3
  23. package/dist/schemas/account/manager-account.d.ts +116 -0
  24. package/dist/schemas/account/manager-account.js +38 -0
  25. package/dist/schemas/account/scraper-account.d.ts +2 -6
  26. package/dist/schemas/account/scraper-account.js +24 -21
  27. package/dist/schemas/ai/ai-config.js +11 -8
  28. package/dist/schemas/ai/index.js +19 -3
  29. package/dist/schemas/ai/proposal.js +13 -10
  30. package/dist/schemas/ai/suitability.js +11 -8
  31. package/dist/schemas/ai-config/ai-config.d.ts +39 -0
  32. package/dist/schemas/ai-config/ai-config.js +12 -0
  33. package/dist/schemas/ai-config/index.d.ts +1 -0
  34. package/dist/schemas/ai-config/index.js +17 -0
  35. package/dist/schemas/bid/bid-result.js +13 -9
  36. package/dist/schemas/bid/bid-status.d.ts +30 -0
  37. package/dist/schemas/bid/bid-status.js +15 -0
  38. package/dist/schemas/bid/bid.js +30 -29
  39. package/dist/schemas/bid/exceptions/base-exception.d.ts +4 -0
  40. package/dist/schemas/bid/exceptions/evalute-element.exception.d.ts +5 -0
  41. package/dist/schemas/bid/exceptions/wait-for-function-timeout.d.ts +5 -0
  42. package/dist/schemas/bid/index.js +18 -2
  43. package/dist/schemas/bidding/index.d.ts +1 -0
  44. package/dist/schemas/bidding/index.js +17 -0
  45. package/dist/schemas/bidding/proposal-bidding-status.d.ts +26 -0
  46. package/dist/schemas/bidding/proposal-bidding-status.js +18 -0
  47. package/dist/schemas/bidding/proposal-dto.d.ts +26 -0
  48. package/dist/schemas/bidding/proposal-dto.js +18 -0
  49. package/dist/schemas/campaign/campaign-ai-metrics.js +8 -5
  50. package/dist/schemas/campaign/campaign-analytics.d.ts +0 -8
  51. package/dist/schemas/campaign/campaign-analytics.js +31 -32
  52. package/dist/schemas/campaign/campaign-expenses.js +8 -5
  53. package/dist/schemas/campaign/campaign-insights.js +30 -30
  54. package/dist/schemas/campaign/campaign-integrations.d.ts +0 -5
  55. package/dist/schemas/campaign/campaign-integrations.js +13 -10
  56. package/dist/schemas/campaign/campaign-job-count.js +6 -3
  57. package/dist/schemas/campaign/campaign.d.ts +1 -22
  58. package/dist/schemas/campaign/campaign.js +35 -32
  59. package/dist/schemas/campaign/index.js +23 -7
  60. package/dist/schemas/chat-message/chat-message.js +10 -7
  61. package/dist/schemas/chat-message/index.js +17 -1
  62. package/dist/schemas/config/agency-config.js +9 -6
  63. package/dist/schemas/config/index.js +17 -1
  64. package/dist/schemas/index.js +32 -17
  65. package/dist/schemas/job/index.js +19 -0
  66. package/dist/schemas/job/job-details.d.ts +335 -0
  67. package/dist/schemas/job/job-details.js +29 -0
  68. package/dist/schemas/job/job-note.d.ts +83 -0
  69. package/dist/schemas/job/job-note.js +30 -0
  70. package/dist/schemas/job/job-pipeline.d.ts +74 -0
  71. package/dist/schemas/job/job-pipeline.js +29 -0
  72. package/dist/schemas/job/job-status.d.ts +3 -0
  73. package/dist/schemas/job/job-status.js +27 -0
  74. package/dist/schemas/job/job-suitability.d.ts +12 -0
  75. package/dist/schemas/job/job-suitability.js +13 -0
  76. package/dist/schemas/job/job.d.ts +1160 -0
  77. package/dist/schemas/job/job.js +90 -0
  78. package/dist/schemas/job/pipeline-job.d.ts +608 -0
  79. package/dist/schemas/job/pipeline-job.js +43 -0
  80. package/dist/schemas/job/upwork-job.d.ts +334 -0
  81. package/dist/schemas/job/upwork-job.js +60 -0
  82. package/dist/schemas/job-filters/index.js +17 -1
  83. package/dist/schemas/job-filters/job-filters.js +65 -62
  84. package/dist/schemas/knowledge-object/index.d.ts +1 -0
  85. package/dist/schemas/knowledge-object/index.js +17 -0
  86. package/dist/schemas/knowledge-object/knowledge-object.d.ts +128 -0
  87. package/dist/schemas/knowledge-object/knowledge-object.js +47 -0
  88. package/dist/schemas/lead/index.js +19 -173
  89. package/dist/schemas/lead/lead-note.js +16 -13
  90. package/dist/schemas/lead/lead-status.js +6 -3
  91. package/dist/schemas/lead/lead.d.ts +1897 -0
  92. package/dist/schemas/lead/lead.js +143 -0
  93. package/dist/schemas/logger/index.js +17 -1
  94. package/dist/schemas/logger/log-event.js +49 -100
  95. package/dist/schemas/organization/index.js +17 -70
  96. package/dist/schemas/organization/organization.d.ts +7 -177
  97. package/dist/schemas/organization/organization.js +17 -14
  98. package/dist/schemas/proxy/index.js +17 -3
  99. package/dist/schemas/proxy/proxy.d.ts +5 -5
  100. package/dist/schemas/proxy/proxy.js +19 -25
  101. package/dist/schemas/saved-search/index.js +11 -8
  102. package/dist/schemas/scraper/index.js +18 -2
  103. package/dist/schemas/scraper/scrape-payload.d.ts +0 -5
  104. package/dist/schemas/scraper/scrape-payload.js +14 -19
  105. package/dist/schemas/scraper/scrape-response.d.ts +345 -0
  106. package/dist/schemas/scraper/scrape-response.js +9 -0
  107. package/dist/schemas/scraper/scrape-result.js +21 -21
  108. package/dist/schemas/shared.js +9 -12
  109. package/dist/schemas/time-filter/index.js +8 -5
  110. package/dist/schemas/upwork-account/index.d.ts +3 -0
  111. package/dist/schemas/upwork-account/index.js +19 -0
  112. package/dist/schemas/upwork-account/upwork-account-status.d.ts +2 -0
  113. package/dist/schemas/upwork-account/upwork-account-status.js +11 -0
  114. package/dist/schemas/upwork-account/upwork-business-manager-account.d.ts +95 -0
  115. package/dist/schemas/upwork-account/upwork-business-manager-account.js +35 -0
  116. package/dist/schemas/upwork-account/upwork-scraper-account.d.ts +92 -0
  117. package/dist/schemas/upwork-account/upwork-scraper-account.js +31 -0
  118. package/dist/schemas/upwork-account/upwork-scraping-account.d.ts +90 -0
  119. package/dist/schemas/upwork-account/upwork-scraping-account.js +30 -0
  120. package/dist/schemas/user/index.js +41 -38
  121. package/dist/types/account/account-status.js +2 -1
  122. package/dist/types/account/bidder-account.js +2 -1
  123. package/dist/types/account/index.js +19 -3
  124. package/dist/types/account/manager-account.d.ts +7 -0
  125. package/dist/types/account/manager-account.js +2 -0
  126. package/dist/types/account/scraper-account.js +2 -1
  127. package/dist/types/ai/ai-config.js +2 -1
  128. package/dist/types/ai/index.js +19 -3
  129. package/dist/types/ai/proposal.js +2 -1
  130. package/dist/types/ai/suitability.js +2 -1
  131. package/dist/types/ai-config/ai-config.d.ts +6 -0
  132. package/dist/types/ai-config/ai-config.js +2 -0
  133. package/dist/types/ai-config/index.d.ts +1 -0
  134. package/dist/types/ai-config/index.js +17 -0
  135. package/dist/types/bid/bid-result.js +2 -1
  136. package/dist/types/bid/bid-status.d.ts +5 -0
  137. package/dist/types/bid/bid-status.js +2 -0
  138. package/dist/types/bid/bid.js +2 -1
  139. package/dist/types/bid/index.js +18 -2
  140. package/dist/types/bidding/index.d.ts +1 -0
  141. package/dist/types/bidding/index.js +17 -0
  142. package/dist/types/bidding/proposal-bidding-status.d.ts +3 -0
  143. package/dist/types/bidding/proposal-bidding-status.js +2 -0
  144. package/dist/types/bidding/proposal-dto.d.ts +3 -0
  145. package/dist/types/bidding/proposal-dto.js +2 -0
  146. package/dist/types/campaign/campaign-analytics.js +2 -1
  147. package/dist/types/campaign/campaign-expenses.js +2 -1
  148. package/dist/types/campaign/campaign-insights.js +2 -1
  149. package/dist/types/campaign/campaign-integrations.js +2 -1
  150. package/dist/types/campaign/campaign-job-count.js +2 -1
  151. package/dist/types/campaign/campaign.js +2 -1
  152. package/dist/types/campaign/index.js +22 -6
  153. package/dist/types/chat-message/chat-message.js +2 -1
  154. package/dist/types/chat-message/index.js +17 -1
  155. package/dist/types/config/agency-config.js +2 -1
  156. package/dist/types/config/index.js +17 -1
  157. package/dist/types/index.js +29 -15
  158. package/dist/types/job/index.js +19 -3
  159. package/dist/types/job/job-details.d.ts +36 -0
  160. package/dist/types/job/job-details.js +2 -0
  161. package/dist/types/job/job-note.js +2 -1
  162. package/dist/types/job/job-pipeline.d.ts +4 -0
  163. package/dist/types/job/job-pipeline.js +2 -0
  164. package/dist/types/job/job-status.js +4 -1
  165. package/dist/types/job/job-suitability.d.ts +3 -0
  166. package/dist/types/job/job-suitability.js +2 -0
  167. package/dist/types/job/job.d.ts +36 -0
  168. package/dist/types/job/job.js +2 -0
  169. package/dist/types/job-filters/index.js +17 -1
  170. package/dist/types/job-filters/job-filters.js +2 -1
  171. package/dist/types/knowledge-object/index.d.ts +1 -0
  172. package/dist/types/knowledge-object/index.js +17 -0
  173. package/dist/types/knowledge-object/knowledge-object.d.ts +4 -0
  174. package/dist/types/knowledge-object/knowledge-object.js +2 -0
  175. package/dist/types/logger/index.js +17 -1
  176. package/dist/types/logger/log-event.js +2 -1
  177. package/dist/types/saved-search/index.js +2 -1
  178. package/dist/types/scraper/index.js +18 -2
  179. package/dist/types/scraper/scrape-payload.js +2 -1
  180. package/dist/types/scraper/scrape-response.d.ts +4 -0
  181. package/dist/types/scraper/scrape-response.js +2 -0
  182. package/dist/types/scraper/scrape-result.js +2 -1
  183. package/dist/types/time-filter/index.js +2 -1
  184. package/dist/types/upwork-account/index.d.ts +3 -0
  185. package/dist/types/upwork-account/index.js +19 -0
  186. package/dist/types/upwork-account/upwork-account-status.d.ts +3 -0
  187. package/dist/types/upwork-account/upwork-account-status.js +2 -0
  188. package/dist/types/upwork-account/upwork-business-manager-account.d.ts +7 -0
  189. package/dist/types/upwork-account/upwork-business-manager-account.js +2 -0
  190. package/dist/types/upwork-account/upwork-scraping-account.d.ts +5 -0
  191. package/dist/types/upwork-account/upwork-scraping-account.js +2 -0
  192. package/dist/types/user/index.js +2 -1
  193. package/dist/utils/index.js +17 -1
  194. package/dist/utils/try-catch.js +23 -8
  195. package/package.json +1 -1
  196. package/dist/schemas/event/index.d.ts +0 -58
  197. package/dist/schemas/lead/nuxt.js +0 -287
  198. package/dist/schemas/meter-event/index.d.ts +0 -12
  199. package/dist/schemas/organization/member.js +0 -7
  200. package/dist/schemas/organization/subscription.js +0 -17
  201. package/dist/schemas/proxy/proxy-available-replacements.js +0 -3
  202. package/dist/schemas/proxy/proxy-country.js +0 -249
  203. package/dist/schemas/tier/index.d.ts +0 -119
  204. package/dist/schemas/transaction/index.js +0 -17
  205. package/dist/schemas/usage/index.js +0 -18
  206. package/dist/types/job/nuxt.js +0 -1
  207. package/dist/types/shared.js +0 -1
  208. package/dist/types/transaction/index.js +0 -1
  209. package/dist/types/usage/index.js +0 -1
@@ -0,0 +1,128 @@
1
+ import { z } from 'zod';
2
+ export declare const KnowledgeObjectSchema: z.ZodObject<{
3
+ categories: z.ZodObject<any, "strip", z.ZodTypeAny, {
4
+ [x: string]: any;
5
+ }, {
6
+ [x: string]: any;
7
+ }>;
8
+ experienceLevels: z.ZodObject<any, "strip", z.ZodTypeAny, {
9
+ [x: string]: any;
10
+ }, {
11
+ [x: string]: any;
12
+ }>;
13
+ minHourlyRate: z.ZodNullable<z.ZodNumber>;
14
+ fixedPriceMin: z.ZodNullable<z.ZodNumber>;
15
+ clientHistory: z.ZodObject<any, "strip", z.ZodTypeAny, {
16
+ [x: string]: any;
17
+ }, {
18
+ [x: string]: any;
19
+ }>;
20
+ keywords: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ categories: {
23
+ [x: string]: any;
24
+ };
25
+ experienceLevels: {
26
+ [x: string]: any;
27
+ };
28
+ minHourlyRate: number | null;
29
+ fixedPriceMin: number | null;
30
+ clientHistory: {
31
+ [x: string]: any;
32
+ };
33
+ keywords: string[] | null;
34
+ }, {
35
+ categories: {
36
+ [x: string]: any;
37
+ };
38
+ experienceLevels: {
39
+ [x: string]: any;
40
+ };
41
+ minHourlyRate: number | null;
42
+ fixedPriceMin: number | null;
43
+ clientHistory: {
44
+ [x: string]: any;
45
+ };
46
+ keywords: string[] | null;
47
+ }>;
48
+ export declare const chatResponseSchema: z.ZodObject<{
49
+ followUpQuestion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
+ knowledgeObject: z.ZodOptional<z.ZodObject<{
51
+ categories: z.ZodObject<any, "strip", z.ZodTypeAny, {
52
+ [x: string]: any;
53
+ }, {
54
+ [x: string]: any;
55
+ }>;
56
+ experienceLevels: z.ZodObject<any, "strip", z.ZodTypeAny, {
57
+ [x: string]: any;
58
+ }, {
59
+ [x: string]: any;
60
+ }>;
61
+ minHourlyRate: z.ZodNullable<z.ZodNumber>;
62
+ fixedPriceMin: z.ZodNullable<z.ZodNumber>;
63
+ clientHistory: z.ZodObject<any, "strip", z.ZodTypeAny, {
64
+ [x: string]: any;
65
+ }, {
66
+ [x: string]: any;
67
+ }>;
68
+ keywords: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
69
+ }, "strip", z.ZodTypeAny, {
70
+ categories: {
71
+ [x: string]: any;
72
+ };
73
+ experienceLevels: {
74
+ [x: string]: any;
75
+ };
76
+ minHourlyRate: number | null;
77
+ fixedPriceMin: number | null;
78
+ clientHistory: {
79
+ [x: string]: any;
80
+ };
81
+ keywords: string[] | null;
82
+ }, {
83
+ categories: {
84
+ [x: string]: any;
85
+ };
86
+ experienceLevels: {
87
+ [x: string]: any;
88
+ };
89
+ minHourlyRate: number | null;
90
+ fixedPriceMin: number | null;
91
+ clientHistory: {
92
+ [x: string]: any;
93
+ };
94
+ keywords: string[] | null;
95
+ }>>;
96
+ }, "strip", z.ZodTypeAny, {
97
+ followUpQuestion?: string | null | undefined;
98
+ knowledgeObject?: {
99
+ categories: {
100
+ [x: string]: any;
101
+ };
102
+ experienceLevels: {
103
+ [x: string]: any;
104
+ };
105
+ minHourlyRate: number | null;
106
+ fixedPriceMin: number | null;
107
+ clientHistory: {
108
+ [x: string]: any;
109
+ };
110
+ keywords: string[] | null;
111
+ } | undefined;
112
+ }, {
113
+ followUpQuestion?: string | null | undefined;
114
+ knowledgeObject?: {
115
+ categories: {
116
+ [x: string]: any;
117
+ };
118
+ experienceLevels: {
119
+ [x: string]: any;
120
+ };
121
+ minHourlyRate: number | null;
122
+ fixedPriceMin: number | null;
123
+ clientHistory: {
124
+ [x: string]: any;
125
+ };
126
+ keywords: string[] | null;
127
+ } | undefined;
128
+ }>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.chatResponseSchema = exports.KnowledgeObjectSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const job_filter_options_1 = require("../../constants/job-filter-options");
6
+ exports.KnowledgeObjectSchema = zod_1.z.object({
7
+ categories: zod_1.z
8
+ .object(job_filter_options_1.CATEGORIES.reduce((acc, category) => (Object.assign(Object.assign({}, acc), { [category]: zod_1.z
9
+ .boolean()
10
+ .nullable()
11
+ .describe(`Indicates if ${category} category is suitable based on skills and services`) })), {}))
12
+ .describe('Job categories for the agency'),
13
+ experienceLevels: zod_1.z
14
+ .object(job_filter_options_1.EXPERIENCE_LEVELS.reduce((acc, level) => (Object.assign(Object.assign({}, acc), { [level]: zod_1.z
15
+ .boolean()
16
+ .nullable()
17
+ .describe(`Has ${level} experience level`) })), {}))
18
+ .describe('Experience level of the agency in the services they offer'),
19
+ minHourlyRate: zod_1.z
20
+ .number()
21
+ .min(0)
22
+ .nullable()
23
+ .describe('Minimum hourly rate in USD that the agency is willing to accept for providing their services'),
24
+ fixedPriceMin: zod_1.z
25
+ .number()
26
+ .min(0)
27
+ .nullable()
28
+ .describe('Minimum budget of the project in USD that the agency is willing to accept for providing their services'),
29
+ clientHistory: zod_1.z
30
+ .object(job_filter_options_1.CLIENT_HISTORY.reduce((acc, history) => (Object.assign(Object.assign({}, acc), { [history]: zod_1.z
31
+ .boolean()
32
+ .nullable()
33
+ .describe(`Whether the job poster (client) has made ${history} hires on Upwork. This refers to the client's hiring history, not the agency's experience.`) })), {}))
34
+ .describe("Filters for the job poster's (client's) hiring history on Upwork - indicates how many previous hires the client should have made to be considered suitable"),
35
+ keywords: zod_1.z
36
+ .array(zod_1.z.string())
37
+ .nullable()
38
+ .describe('List of search keywords that best match the agency\'s expertise and services. These keywords will be used when searching for job posts on Upwork to find the most relevant opportunities. Examples might include specific technologies, skills, or service areas like "React.js", "mobile development", or "UI/UX design".'),
39
+ });
40
+ exports.chatResponseSchema = zod_1.z.object({
41
+ followUpQuestion: zod_1.z
42
+ .string()
43
+ .nullable()
44
+ .optional()
45
+ .describe('This is a question that you should ask a user for a field that you left null. This is important. Always ask this if there is a null field.'),
46
+ knowledgeObject: exports.KnowledgeObjectSchema.optional(),
47
+ });
@@ -1,173 +1,19 @@
1
- import { array, boolean, custom, number, object, record, string, z } from "zod";
2
- import { regionSchema } from "../shared";
3
- import { leadNoteSchema } from "./lead-note";
4
- import { agentStatusSchema, leadStatusSchema } from "./lead-status";
5
- export const jobSkillsSchema = object({
6
- name: string(),
7
- });
8
- export const vendorQualificationSchema = object({
9
- location: string().nullable(),
10
- talentType: z.enum(["Agency", "Independent", "unspecified"]).nullable(),
11
- englishLevel: string().nullable(),
12
- minimumEarnings: number().nullable(),
13
- jobSuccessScore: string().nullable(),
14
- includeRisingTalent: string().nullable(),
15
- });
16
- export const clientInfoSchema = object({
17
- isPaymentVerified: boolean().nullable(),
18
- isPhoneVerified: boolean().nullable(),
19
- numberOfReviews: number().nullable(),
20
- rating: number().nullable(),
21
- country: string().nullable(),
22
- region: string().nullable(),
23
- jobsPosted: number().nullable(),
24
- totalSpent: number().nullable(),
25
- numberOfHires: number().nullable(),
26
- activeEngagements: number().nullable(),
27
- openJobs: number().nullable(),
28
- hireRate: number().nullable(),
29
- memberSince: string().nullable(),
30
- companyIndustry: string().nullable(),
31
- companySize: string().nullable(),
32
- enterpriseClient: boolean().nullable(),
33
- avgHourlyRatePaid: number().nullable(),
34
- });
35
- export const clientReviewSchema = object({
36
- jobTitle: string().nullable(),
37
- freelancerName: string().nullable(),
38
- freelancerRating: number().nullable(),
39
- freelancerFeedback: string().nullable(),
40
- clientFeedback: string().nullable(),
41
- clientFeedbackRating: number().nullable(),
42
- dateRange: string().nullable(),
43
- paymentType: string().nullable(),
44
- fixedPrice: number().nullable(),
45
- hourlyRate: number().nullable(),
46
- numHours: number().nullable(),
47
- totalBilled: number().nullable(),
48
- });
49
- export const bidRangeSchema = object({
50
- high: number().nullable(),
51
- avg: number().nullable(),
52
- low: number().nullable(),
53
- });
54
- export const jobActivitySchema = object({
55
- proposals: object({
56
- min: number().nullable(),
57
- max: number().nullable(),
58
- }),
59
- lastViewedByClient: string().nullable(),
60
- lastViewedByClientTimestamp: number().nullable(),
61
- hires: number().nullable(),
62
- interviewing: number().nullable(),
63
- invitesSent: number().nullable(),
64
- unansweredInvites: number().nullable(),
65
- updatedAt: number().nullable(),
66
- });
67
- export const jobActivityDeltaSchema = object({
68
- proposals: number(),
69
- interviewing: number(),
70
- hires: number(),
71
- invitesSent: number(),
72
- unansweredInvites: number(),
73
- });
74
- export const metadataSchema = object({
75
- hours: string().nullable(),
76
- duration: string().nullable(),
77
- experienceLevel: string().nullable(),
78
- hourlyRate: z
79
- .object({
80
- min: number().nullable(),
81
- max: number().nullable(),
82
- })
83
- .nullable(),
84
- paymentType: string().nullable(),
85
- fixedPrice: number().nullable(),
86
- });
87
- export const jobActivityOffsetHours = [4, 24];
88
- export const jobActivityOffsetEnum = z.enum(jobActivityOffsetHours.map((h) => `${h}h`));
89
- export const upworkJobSchema = object({
90
- id: string().nullable(),
91
- uid: string().nullable(),
92
- createdAt: number().nullable(),
93
- title: string().nullable(),
94
- category: string().nullable(),
95
- skills: array(jobSkillsSchema).nullable(),
96
- datetime: number().nullable(),
97
- description: string().nullable(),
98
- descriptionLength: number().nullable(),
99
- connectsRequired: number().nullable(),
100
- projectType: string().nullable(),
101
- projectDuration: string().nullable(),
102
- questions: array(string()).nullable(),
103
- jobUrl: string().nullable(),
104
- metadata: metadataSchema.nullable(),
105
- clientInfo: clientInfoSchema.nullable(),
106
- vendorQualifications: vendorQualificationSchema.nullable(),
107
- processed: boolean().nullable(),
108
- isFeatured: boolean().nullable(),
109
- clientReviews: array(clientReviewSchema).nullable(),
110
- region: regionSchema.nullable(),
111
- bidRange: bidRangeSchema.nullable(),
112
- jobActivity: jobActivitySchema.nullable(),
113
- activityUpdates: z
114
- .union([z.literal(1), z.literal(2), z.literal(3)])
115
- .nullable(),
116
- activity: record(jobActivityOffsetEnum, jobActivitySchema).nullish(),
117
- activityDelta: jobActivityDeltaSchema.nullish(),
118
- });
119
- export const questionAnswerPairSchema = z.object({
120
- question: z.string(),
121
- answer: z.string(),
122
- });
123
- export const leadSchema = upworkJobSchema
124
- .extend({
125
- jobId: string(),
126
- updatedAt: number().nullable(),
127
- suitabilityRating: number().nullable(),
128
- suitabilityReason: string().nullable(),
129
- proposal: string().nullable(),
130
- questionAnswerPairs: array(questionAnswerPairSchema).nullable(),
131
- agentStatus: agentStatusSchema.nullable(),
132
- leadStatus: leadStatusSchema.nullable(),
133
- notes: array(leadNoteSchema).nullable(),
134
- biddingAmount: number().nullable(),
135
- boosted: boolean().nullable(),
136
- boostingAmount: number().nullable(),
137
- biddingTaskScheduled: boolean().nullable(),
138
- scheduledBiddingTime: number().nullable(),
139
- })
140
- .omit({
141
- processed: true,
142
- });
143
- export const leadResponseSchema = object({
144
- leads: array(leadSchema),
145
- nextCursor: string().nullable(),
146
- hasMore: boolean(),
147
- leadCounts: number().nullable(),
148
- });
149
- export const jobListingSchema = object({
150
- uid: string().nullable(),
151
- title: string().nullable(),
152
- jobUrl: string().nullable(),
153
- datetime: string().nullable(),
154
- isFeatured: boolean().nullable(),
155
- region: regionSchema.nullable(),
156
- });
157
- export const jobActivityOffsetHourSchema = custom((val) => jobActivityOffsetHours.includes(val));
158
- export const jobActivityUpdateSchema = object({
159
- jobUrl: string(),
160
- data: jobActivitySchema,
161
- offsetHour: jobActivityOffsetHourSchema,
162
- scrapedAt: number(),
163
- });
164
- export const jobActivitySnapshotSchema = object({
165
- jobUrl: string(),
166
- activity: jobActivitySchema,
167
- postedAt: number(),
168
- scrapedAt: number(),
169
- hoursSincePosted: number(),
170
- });
171
- export * from "./lead-note";
172
- export * from "./lead-status";
173
- export * from "./nuxt";
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./lead"), exports);
18
+ __exportStar(require("./lead-note"), exports);
19
+ __exportStar(require("./lead-status"), exports);
@@ -1,20 +1,23 @@
1
- import { z } from "zod";
2
- export const leadNoteSchema = z.object({
3
- id: z.string(),
4
- jobId: z.string(),
5
- content: z.string(),
6
- order: z.number(),
7
- bgColor: z.string(),
8
- createdAt: z.number(),
9
- updatedAt: z.number(),
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateLeadNotesOrderSchema = exports.updateLeadNoteSchema = exports.createLeadNoteSchema = exports.leadNoteSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.leadNoteSchema = zod_1.z.object({
6
+ id: zod_1.z.string(),
7
+ jobId: zod_1.z.string(),
8
+ content: zod_1.z.string(),
9
+ order: zod_1.z.number(),
10
+ bgColor: zod_1.z.string(),
11
+ createdAt: zod_1.z.number(),
12
+ updatedAt: zod_1.z.number(),
10
13
  });
11
- export const createLeadNoteSchema = leadNoteSchema.pick({
14
+ exports.createLeadNoteSchema = exports.leadNoteSchema.pick({
12
15
  id: true,
13
16
  content: true,
14
17
  order: true,
15
18
  bgColor: true,
16
19
  });
17
- export const updateLeadNoteSchema = leadNoteSchema
20
+ exports.updateLeadNoteSchema = exports.leadNoteSchema
18
21
  .pick({
19
22
  id: true,
20
23
  content: true,
@@ -22,6 +25,6 @@ export const updateLeadNoteSchema = leadNoteSchema
22
25
  bgColor: true,
23
26
  })
24
27
  .partial({ content: true, order: true, bgColor: true });
25
- export const updateLeadNotesOrderSchema = z.object({
26
- order: z.array(z.object({ id: z.string(), order: z.number() })),
28
+ exports.updateLeadNotesOrderSchema = zod_1.z.object({
29
+ order: zod_1.z.array(zod_1.z.object({ id: zod_1.z.string(), order: zod_1.z.number() })),
27
30
  });
@@ -1,5 +1,8 @@
1
- import { z } from "zod";
2
- export const agentStatusSchema = z.enum([
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.leadStatusSchema = exports.agentStatusSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.agentStatusSchema = zod_1.z.enum([
3
6
  "suitabilityPending",
4
7
  "suitabilityProcessing",
5
8
  "suitabilityComplete",
@@ -12,7 +15,7 @@ export const agentStatusSchema = z.enum([
12
15
  "biddingFailed",
13
16
  "jobArchived",
14
17
  ]);
15
- export const leadStatusSchema = z.enum([
18
+ exports.leadStatusSchema = zod_1.z.enum([
16
19
  "leads",
17
20
  "contacted",
18
21
  "viewed",