lancer-shared 1.2.136 → 1.2.138

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 (208) hide show
  1. package/dist/bundle.cjs.js +10 -0
  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.js +24 -22
  20. package/dist/schemas/account/exceptions/no-bidder-accounts-available.d.ts +5 -0
  21. package/dist/schemas/account/index.js +19 -3
  22. package/dist/schemas/account/manager-account.d.ts +116 -0
  23. package/dist/schemas/account/manager-account.js +38 -0
  24. package/dist/schemas/account/scraper-account.js +24 -21
  25. package/dist/schemas/ai/ai-config.js +11 -8
  26. package/dist/schemas/ai/index.js +19 -3
  27. package/dist/schemas/ai/proposal.js +13 -10
  28. package/dist/schemas/ai/suitability.js +11 -8
  29. package/dist/schemas/ai-config/ai-config.d.ts +39 -0
  30. package/dist/schemas/ai-config/ai-config.js +12 -0
  31. package/dist/schemas/ai-config/index.d.ts +1 -0
  32. package/dist/schemas/ai-config/index.js +17 -0
  33. package/dist/schemas/bid/bid-result.js +13 -9
  34. package/dist/schemas/bid/bid-status.d.ts +30 -0
  35. package/dist/schemas/bid/bid-status.js +15 -0
  36. package/dist/schemas/bid/bid.js +30 -29
  37. package/dist/schemas/bid/exceptions/base-exception.d.ts +4 -0
  38. package/dist/schemas/bid/exceptions/evalute-element.exception.d.ts +5 -0
  39. package/dist/schemas/bid/exceptions/wait-for-function-timeout.d.ts +5 -0
  40. package/dist/schemas/bid/index.js +18 -2
  41. package/dist/schemas/bidding/index.d.ts +1 -0
  42. package/dist/schemas/bidding/index.js +17 -0
  43. package/dist/schemas/bidding/proposal-bidding-status.d.ts +26 -0
  44. package/dist/schemas/bidding/proposal-bidding-status.js +18 -0
  45. package/dist/schemas/bidding/proposal-dto.d.ts +26 -0
  46. package/dist/schemas/bidding/proposal-dto.js +18 -0
  47. package/dist/schemas/campaign/campaign-ai-metrics.js +8 -5
  48. package/dist/schemas/campaign/campaign-analytics.d.ts +0 -296
  49. package/dist/schemas/campaign/campaign-analytics.js +31 -32
  50. package/dist/schemas/campaign/campaign-expenses.js +8 -5
  51. package/dist/schemas/campaign/campaign-insights.js +30 -30
  52. package/dist/schemas/campaign/campaign-integrations.d.ts +0 -5
  53. package/dist/schemas/campaign/campaign-integrations.js +13 -10
  54. package/dist/schemas/campaign/campaign-job-count.js +6 -3
  55. package/dist/schemas/campaign/campaign.js +35 -32
  56. package/dist/schemas/campaign/index.js +23 -7
  57. package/dist/schemas/chat-message/chat-message.js +10 -7
  58. package/dist/schemas/chat-message/index.js +17 -1
  59. package/dist/schemas/config/agency-config.js +9 -6
  60. package/dist/schemas/config/index.js +17 -1
  61. package/dist/schemas/index.js +32 -17
  62. package/dist/schemas/infrastructure/index.d.ts +12 -2
  63. package/dist/schemas/job/feed-job.d.ts +866 -0
  64. package/dist/schemas/job/index.js +19 -0
  65. package/dist/schemas/job/job-details.js +29 -0
  66. package/dist/schemas/job/job-note.d.ts +83 -0
  67. package/dist/schemas/job/job-note.js +30 -0
  68. package/dist/schemas/job/job-pipeline.d.ts +74 -0
  69. package/dist/schemas/job/job-pipeline.js +29 -0
  70. package/dist/schemas/job/job-status.d.ts +3 -0
  71. package/dist/schemas/job/job-status.js +27 -0
  72. package/dist/schemas/job/job-suitability.d.ts +12 -0
  73. package/dist/schemas/job/job-suitability.js +13 -0
  74. package/dist/schemas/job/job.d.ts +1160 -0
  75. package/dist/schemas/job/job.js +90 -0
  76. package/dist/schemas/job/pipeline-job.d.ts +608 -0
  77. package/dist/schemas/job/pipeline-job.js +43 -0
  78. package/dist/schemas/job/upwork-job.d.ts +334 -0
  79. package/dist/schemas/job/upwork-job.js +60 -0
  80. package/dist/schemas/job-filters/index.js +17 -1
  81. package/dist/schemas/job-filters/job-filters.js +65 -62
  82. package/dist/schemas/knowledge-object/index.d.ts +1 -0
  83. package/dist/schemas/knowledge-object/index.js +17 -0
  84. package/dist/schemas/knowledge-object/knowledge-object.d.ts +128 -0
  85. package/dist/schemas/knowledge-object/knowledge-object.js +47 -0
  86. package/dist/schemas/lead/index.d.ts +14 -0
  87. package/dist/schemas/lead/index.js +19 -173
  88. package/dist/schemas/lead/lead-note.js +16 -13
  89. package/dist/schemas/lead/lead-status.js +6 -3
  90. package/dist/schemas/lead/lead.d.ts +1897 -0
  91. package/dist/schemas/lead/lead.js +143 -0
  92. package/dist/schemas/logger/index.js +17 -1
  93. package/dist/schemas/logger/log-event.js +49 -100
  94. package/dist/schemas/organization/index.js +17 -70
  95. package/dist/schemas/organization/organization.d.ts +7 -177
  96. package/dist/schemas/organization/organization.js +17 -14
  97. package/dist/schemas/proxy/index.js +17 -3
  98. package/dist/schemas/proxy/proxy.js +19 -25
  99. package/dist/schemas/saved-search/index.js +11 -8
  100. package/dist/schemas/scraper/index.js +18 -2
  101. package/dist/schemas/scraper/scrape-payload.d.ts +0 -78
  102. package/dist/schemas/scraper/scrape-payload.js +14 -19
  103. package/dist/schemas/scraper/scrape-response.d.ts +345 -0
  104. package/dist/schemas/scraper/scrape-response.js +9 -0
  105. package/dist/schemas/scraper/scrape-result.js +21 -21
  106. package/dist/schemas/shared.js +9 -12
  107. package/dist/schemas/time-filter/index.js +8 -5
  108. package/dist/schemas/upwork-account/index.d.ts +3 -0
  109. package/dist/schemas/upwork-account/index.js +19 -0
  110. package/dist/schemas/upwork-account/upwork-account-status.d.ts +2 -0
  111. package/dist/schemas/upwork-account/upwork-account-status.js +11 -0
  112. package/dist/schemas/upwork-account/upwork-business-manager-account.d.ts +95 -0
  113. package/dist/schemas/upwork-account/upwork-business-manager-account.js +35 -0
  114. package/dist/schemas/upwork-account/upwork-scraper-account.d.ts +92 -0
  115. package/dist/schemas/upwork-account/upwork-scraper-account.js +31 -0
  116. package/dist/schemas/upwork-account/upwork-scraping-account.d.ts +90 -0
  117. package/dist/schemas/upwork-account/upwork-scraping-account.js +30 -0
  118. package/dist/schemas/user/index.js +41 -38
  119. package/dist/types/account/account-status.js +2 -1
  120. package/dist/types/account/bidder-account.js +2 -1
  121. package/dist/types/account/index.js +19 -3
  122. package/dist/types/account/manager-account.d.ts +7 -0
  123. package/dist/types/account/manager-account.js +2 -0
  124. package/dist/types/account/scraper-account.js +2 -1
  125. package/dist/types/ai/ai-config.js +2 -1
  126. package/dist/types/ai/index.js +19 -3
  127. package/dist/types/ai/proposal.js +2 -1
  128. package/dist/types/ai/suitability.js +2 -1
  129. package/dist/types/ai-config/ai-config.d.ts +6 -0
  130. package/dist/types/ai-config/ai-config.js +2 -0
  131. package/dist/types/ai-config/index.d.ts +1 -0
  132. package/dist/types/ai-config/index.js +17 -0
  133. package/dist/types/bid/bid-result.js +2 -1
  134. package/dist/types/bid/bid-status.d.ts +5 -0
  135. package/dist/types/bid/bid-status.js +2 -0
  136. package/dist/types/bid/bid.js +2 -1
  137. package/dist/types/bid/index.js +18 -2
  138. package/dist/types/bidding/index.d.ts +1 -0
  139. package/dist/types/bidding/index.js +17 -0
  140. package/dist/types/bidding/proposal-bidding-status.d.ts +3 -0
  141. package/dist/types/bidding/proposal-bidding-status.js +2 -0
  142. package/dist/types/bidding/proposal-dto.d.ts +3 -0
  143. package/dist/types/bidding/proposal-dto.js +2 -0
  144. package/dist/types/campaign/campaign-analytics.js +2 -1
  145. package/dist/types/campaign/campaign-expenses.js +2 -1
  146. package/dist/types/campaign/campaign-insights.js +2 -1
  147. package/dist/types/campaign/campaign-integrations.js +2 -1
  148. package/dist/types/campaign/campaign-job-count.js +2 -1
  149. package/dist/types/campaign/campaign.js +2 -1
  150. package/dist/types/campaign/index.js +22 -6
  151. package/dist/types/chat-message/chat-message.js +2 -1
  152. package/dist/types/chat-message/index.js +17 -1
  153. package/dist/types/config/agency-config.js +2 -1
  154. package/dist/types/config/index.js +17 -1
  155. package/dist/types/index.js +29 -15
  156. package/dist/types/job/index.js +19 -3
  157. package/dist/types/job/job-details.d.ts +36 -0
  158. package/dist/types/job/job-details.js +2 -0
  159. package/dist/types/job/job-note.js +2 -1
  160. package/dist/types/job/job-pipeline.d.ts +4 -0
  161. package/dist/types/job/job-pipeline.js +2 -0
  162. package/dist/types/job/job-status.js +4 -1
  163. package/dist/types/job/job-suitability.d.ts +3 -0
  164. package/dist/types/job/job-suitability.js +2 -0
  165. package/dist/types/job/job.d.ts +36 -0
  166. package/dist/types/job/job.js +2 -0
  167. package/dist/types/job-filters/index.js +17 -1
  168. package/dist/types/job-filters/job-filters.js +2 -1
  169. package/dist/types/knowledge-object/index.d.ts +1 -0
  170. package/dist/types/knowledge-object/index.js +17 -0
  171. package/dist/types/knowledge-object/knowledge-object.d.ts +4 -0
  172. package/dist/types/knowledge-object/knowledge-object.js +2 -0
  173. package/dist/types/logger/index.js +17 -1
  174. package/dist/types/logger/log-event.js +2 -1
  175. package/dist/types/saved-search/index.js +2 -1
  176. package/dist/types/scraper/index.js +18 -2
  177. package/dist/types/scraper/scrape-payload.js +2 -1
  178. package/dist/types/scraper/scrape-response.d.ts +4 -0
  179. package/dist/types/scraper/scrape-response.js +2 -0
  180. package/dist/types/scraper/scrape-result.js +2 -1
  181. package/dist/types/time-filter/index.js +2 -1
  182. package/dist/types/upwork-account/index.d.ts +3 -0
  183. package/dist/types/upwork-account/index.js +19 -0
  184. package/dist/types/upwork-account/upwork-account-status.d.ts +3 -0
  185. package/dist/types/upwork-account/upwork-account-status.js +2 -0
  186. package/dist/types/upwork-account/upwork-business-manager-account.d.ts +7 -0
  187. package/dist/types/upwork-account/upwork-business-manager-account.js +2 -0
  188. package/dist/types/upwork-account/upwork-scraping-account.d.ts +5 -0
  189. package/dist/types/upwork-account/upwork-scraping-account.js +2 -0
  190. package/dist/types/user/index.js +2 -1
  191. package/dist/utils/index.js +17 -1
  192. package/dist/utils/try-catch.js +23 -8
  193. package/package.json +1 -1
  194. package/dist/schemas/event/index.d.ts +0 -58
  195. package/dist/schemas/job/haha.json +0 -581
  196. package/dist/schemas/lead/nuxt.js +0 -287
  197. package/dist/schemas/meter-event/index.d.ts +0 -12
  198. package/dist/schemas/organization/member.js +0 -7
  199. package/dist/schemas/organization/subscription.js +0 -17
  200. package/dist/schemas/proxy/proxy-available-replacements.js +0 -3
  201. package/dist/schemas/proxy/proxy-country.js +0 -249
  202. package/dist/schemas/tier/index.d.ts +0 -119
  203. package/dist/schemas/transaction/index.js +0 -17
  204. package/dist/schemas/usage/index.js +0 -18
  205. package/dist/types/job/nuxt.js +0 -1
  206. package/dist/types/shared.js +0 -1
  207. package/dist/types/transaction/index.js +0 -1
  208. 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
+ });
@@ -3125,6 +3125,19 @@ export declare const findLeadsResponseSchema: z.ZodObject<{
3125
3125
  lastMonthTotal?: number | undefined;
3126
3126
  error?: string | undefined;
3127
3127
  }>;
3128
+ export declare const getCampaignLeadsRequestQuerySchema: z.ZodObject<{
3129
+ cursor: z.ZodOptional<z.ZodString>;
3130
+ limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
3131
+ status: z.ZodOptional<z.ZodEnum<["all", "suitable", "contacted", "viewed", "replied"]>>;
3132
+ }, "strip", z.ZodTypeAny, {
3133
+ status?: "contacted" | "viewed" | "replied" | "all" | "suitable" | undefined;
3134
+ limit?: number | undefined;
3135
+ cursor?: string | undefined;
3136
+ }, {
3137
+ status?: "contacted" | "viewed" | "replied" | "all" | "suitable" | undefined;
3138
+ limit?: number | undefined;
3139
+ cursor?: string | undefined;
3140
+ }>;
3128
3141
  export declare const generateLeadCountsRequestSchema: z.ZodObject<{
3129
3142
  filters: z.ZodOptional<z.ZodType<JobFilters, z.ZodTypeDef, JobFilters>>;
3130
3143
  campaignId: z.ZodOptional<z.ZodString>;
@@ -3151,5 +3164,6 @@ export interface LeadResponse extends z.infer<typeof leadResponseSchema> {
3151
3164
  }
3152
3165
  export type FindLeadsRequest = z.infer<typeof findLeadsRequestSchema>;
3153
3166
  export type FindLeadsResponse = z.infer<typeof findLeadsResponseSchema>;
3167
+ export type GetCampaignLeadsRequestQuery = z.infer<typeof getCampaignLeadsRequestQuerySchema>;
3154
3168
  export type GenerateLeadCountsRequest = z.infer<typeof generateLeadCountsRequestSchema>;
3155
3169
  export * from './lead-status';
@@ -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",