lancer-shared 1.0.169 → 1.0.171

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 (194) hide show
  1. package/dist/bundle.cjs.js +399 -135
  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 +4 -1
  5. package/dist/constants/common-questions.js +4 -1
  6. package/dist/constants/index.d.ts +3 -4
  7. package/dist/constants/index.js +32 -10
  8. package/dist/constants/job-filter-options.js +4 -1
  9. package/dist/constants/job-status.js +12 -7
  10. package/dist/constants/mappings/countryMapping.js +3 -1
  11. package/dist/constants/mappings/regionMapping.js +3 -1
  12. package/dist/constants/proxies.d.ts +4 -0
  13. package/dist/constants/routes.d.ts +3 -2
  14. package/dist/constants/routes.js +37 -39
  15. package/dist/constants/upwork-accounts.js +6 -3
  16. package/dist/constants/upwork-filters.d.ts +5 -0
  17. package/dist/constants/upwork-filters.js +75 -0
  18. package/dist/index.js +20 -4
  19. package/dist/schemas/account/account-status.js +5 -2
  20. package/dist/schemas/account/bidder-account.d.ts +1 -8
  21. package/dist/schemas/account/bidder-account.js +22 -19
  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.js +24 -21
  26. package/dist/schemas/ai/ai-config.js +11 -8
  27. package/dist/schemas/ai/index.js +19 -3
  28. package/dist/schemas/ai/proposal.js +13 -10
  29. package/dist/schemas/ai/suitability.js +11 -8
  30. package/dist/schemas/ai-config/ai-config.d.ts +39 -0
  31. package/dist/schemas/ai-config/ai-config.js +12 -0
  32. package/dist/schemas/ai-config/index.d.ts +1 -0
  33. package/dist/schemas/ai-config/index.js +17 -0
  34. package/dist/schemas/bid/bid-result.js +13 -10
  35. package/dist/schemas/bid/bid-status.d.ts +30 -0
  36. package/dist/schemas/bid/bid-status.js +15 -0
  37. package/dist/schemas/bid/bid.d.ts +12 -12
  38. package/dist/schemas/bid/bid.js +30 -27
  39. package/dist/schemas/bid/index.js +18 -2
  40. package/dist/schemas/bidding/index.d.ts +1 -0
  41. package/dist/schemas/bidding/index.js +17 -0
  42. package/dist/schemas/bidding/proposal-bidding-status.d.ts +26 -0
  43. package/dist/schemas/bidding/proposal-bidding-status.js +18 -0
  44. package/dist/schemas/bidding/proposal-dto.d.ts +26 -0
  45. package/dist/schemas/bidding/proposal-dto.js +18 -0
  46. package/dist/schemas/campaign/campaign-ai-metrics.js +8 -5
  47. package/dist/schemas/campaign/campaign-analytics.js +31 -28
  48. package/dist/schemas/campaign/campaign-expenses.js +8 -5
  49. package/dist/schemas/campaign/campaign-insights.js +30 -30
  50. package/dist/schemas/campaign/campaign-integrations.js +13 -10
  51. package/dist/schemas/campaign/campaign-job-count.js +6 -3
  52. package/dist/schemas/campaign/campaign.js +35 -32
  53. package/dist/schemas/campaign/index.js +23 -7
  54. package/dist/schemas/chat-message/chat-message.js +10 -7
  55. package/dist/schemas/chat-message/index.js +17 -1
  56. package/dist/schemas/config/agency-config.js +9 -6
  57. package/dist/schemas/config/index.js +17 -1
  58. package/dist/schemas/index.js +32 -16
  59. package/dist/schemas/job/index.d.ts +3 -95
  60. package/dist/schemas/job/index.js +19 -0
  61. package/dist/schemas/job/job-details.d.ts +335 -0
  62. package/dist/schemas/job/job-details.js +29 -0
  63. package/dist/schemas/job/job-note.d.ts +83 -0
  64. package/dist/schemas/job/job-note.js +30 -0
  65. package/dist/schemas/job/job-pipeline.d.ts +74 -0
  66. package/dist/schemas/job/job-pipeline.js +29 -0
  67. package/dist/schemas/job/job-status.d.ts +3 -0
  68. package/dist/schemas/job/job-status.js +27 -0
  69. package/dist/schemas/job/job-suitability.d.ts +12 -0
  70. package/dist/schemas/job/job-suitability.js +13 -0
  71. package/dist/schemas/job/job.d.ts +1160 -0
  72. package/dist/schemas/job/job.js +90 -0
  73. package/dist/schemas/job/pipeline-job.d.ts +608 -0
  74. package/dist/schemas/job/pipeline-job.js +43 -0
  75. package/dist/schemas/job/upwork-job.d.ts +334 -0
  76. package/dist/schemas/job/upwork-job.js +60 -0
  77. package/dist/schemas/job-filters/index.js +17 -1
  78. package/dist/schemas/job-filters/job-filters.js +65 -62
  79. package/dist/schemas/knowledge-object/index.d.ts +1 -0
  80. package/dist/schemas/knowledge-object/index.js +17 -0
  81. package/dist/schemas/knowledge-object/knowledge-object.d.ts +128 -0
  82. package/dist/schemas/knowledge-object/knowledge-object.js +47 -0
  83. package/dist/schemas/lead/index.d.ts +6 -6
  84. package/dist/schemas/lead/index.js +19 -166
  85. package/dist/schemas/lead/lead-note.js +16 -13
  86. package/dist/schemas/lead/lead-status.js +6 -3
  87. package/dist/schemas/lead/lead.d.ts +1897 -0
  88. package/dist/schemas/lead/lead.js +143 -0
  89. package/dist/schemas/logger/index.js +17 -1
  90. package/dist/schemas/logger/log-event.js +19 -38
  91. package/dist/schemas/organization/index.js +17 -1
  92. package/dist/schemas/organization/organization.js +17 -14
  93. package/dist/schemas/proxy/index.d.ts +2 -0
  94. package/dist/schemas/proxy/index.js +17 -1
  95. package/dist/schemas/proxy/proxy-available-replacements.d.ts +4 -0
  96. package/dist/schemas/proxy/proxy-country.d.ts +2 -0
  97. package/dist/schemas/proxy/proxy.d.ts +23 -8
  98. package/dist/schemas/proxy/proxy.js +19 -14
  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.js +14 -19
  102. package/dist/schemas/scraper/scrape-response.d.ts +345 -0
  103. package/dist/schemas/scraper/scrape-response.js +9 -0
  104. package/dist/schemas/scraper/scrape-result.js +21 -21
  105. package/dist/schemas/shared.js +9 -12
  106. package/dist/schemas/time-filter/index.js +8 -5
  107. package/dist/schemas/upwork-account/index.d.ts +3 -0
  108. package/dist/schemas/upwork-account/index.js +19 -0
  109. package/dist/schemas/upwork-account/upwork-account-status.d.ts +2 -0
  110. package/dist/schemas/upwork-account/upwork-account-status.js +11 -0
  111. package/dist/schemas/upwork-account/upwork-business-manager-account.d.ts +95 -0
  112. package/dist/schemas/upwork-account/upwork-business-manager-account.js +35 -0
  113. package/dist/schemas/upwork-account/upwork-scraper-account.d.ts +92 -0
  114. package/dist/schemas/upwork-account/upwork-scraper-account.js +31 -0
  115. package/dist/schemas/upwork-account/upwork-scraping-account.d.ts +90 -0
  116. package/dist/schemas/upwork-account/upwork-scraping-account.js +30 -0
  117. package/dist/schemas/user/index.js +41 -38
  118. package/dist/types/account/account-status.js +2 -1
  119. package/dist/types/account/bidder-account.js +2 -1
  120. package/dist/types/account/index.js +19 -3
  121. package/dist/types/account/manager-account.d.ts +7 -0
  122. package/dist/types/account/manager-account.js +2 -0
  123. package/dist/types/account/scraper-account.js +2 -1
  124. package/dist/types/ai/ai-config.js +2 -1
  125. package/dist/types/ai/index.js +19 -3
  126. package/dist/types/ai/proposal.js +2 -1
  127. package/dist/types/ai/suitability.js +2 -1
  128. package/dist/types/ai-config/ai-config.d.ts +6 -0
  129. package/dist/types/ai-config/ai-config.js +2 -0
  130. package/dist/types/ai-config/index.d.ts +1 -0
  131. package/dist/types/ai-config/index.js +17 -0
  132. package/dist/types/bid/bid-result.js +2 -1
  133. package/dist/types/bid/bid-status.d.ts +5 -0
  134. package/dist/types/bid/bid-status.js +2 -0
  135. package/dist/types/bid/bid.js +2 -1
  136. package/dist/types/bid/index.js +18 -2
  137. package/dist/types/bidding/index.d.ts +1 -0
  138. package/dist/types/bidding/index.js +17 -0
  139. package/dist/types/bidding/proposal-bidding-status.d.ts +3 -0
  140. package/dist/types/bidding/proposal-bidding-status.js +2 -0
  141. package/dist/types/bidding/proposal-dto.d.ts +3 -0
  142. package/dist/types/bidding/proposal-dto.js +2 -0
  143. package/dist/types/campaign/campaign-analytics.js +2 -1
  144. package/dist/types/campaign/campaign-expenses.js +2 -1
  145. package/dist/types/campaign/campaign-insights.js +2 -1
  146. package/dist/types/campaign/campaign-integrations.js +2 -1
  147. package/dist/types/campaign/campaign-job-count.js +2 -1
  148. package/dist/types/campaign/campaign.js +2 -1
  149. package/dist/types/campaign/index.js +22 -6
  150. package/dist/types/chat-message/chat-message.js +2 -1
  151. package/dist/types/chat-message/index.js +17 -1
  152. package/dist/types/config/agency-config.js +2 -1
  153. package/dist/types/config/index.js +17 -1
  154. package/dist/types/index.js +29 -14
  155. package/dist/types/job/index.js +19 -2
  156. package/dist/types/job/job-details.d.ts +36 -0
  157. package/dist/types/job/job-details.js +2 -0
  158. package/dist/types/job/job-note.js +2 -1
  159. package/dist/types/job/job-pipeline.d.ts +4 -0
  160. package/dist/types/job/job-pipeline.js +2 -0
  161. package/dist/types/job/job-status.js +4 -1
  162. package/dist/types/job/job-suitability.d.ts +3 -0
  163. package/dist/types/job/job-suitability.js +2 -0
  164. package/dist/types/job/job.d.ts +36 -0
  165. package/dist/types/job/job.js +2 -0
  166. package/dist/types/job-filters/index.js +17 -1
  167. package/dist/types/job-filters/job-filters.js +2 -1
  168. package/dist/types/knowledge-object/index.d.ts +1 -0
  169. package/dist/types/knowledge-object/index.js +17 -0
  170. package/dist/types/knowledge-object/knowledge-object.d.ts +4 -0
  171. package/dist/types/knowledge-object/knowledge-object.js +2 -0
  172. package/dist/types/logger/index.js +17 -1
  173. package/dist/types/logger/log-event.js +2 -1
  174. package/dist/types/saved-search/index.js +2 -1
  175. package/dist/types/scraper/index.js +18 -2
  176. package/dist/types/scraper/scrape-payload.js +2 -1
  177. package/dist/types/scraper/scrape-response.d.ts +4 -0
  178. package/dist/types/scraper/scrape-response.js +2 -0
  179. package/dist/types/scraper/scrape-result.js +2 -1
  180. package/dist/types/time-filter/index.js +2 -1
  181. package/dist/types/upwork-account/index.d.ts +3 -0
  182. package/dist/types/upwork-account/index.js +19 -0
  183. package/dist/types/upwork-account/upwork-account-status.d.ts +3 -0
  184. package/dist/types/upwork-account/upwork-account-status.js +2 -0
  185. package/dist/types/upwork-account/upwork-business-manager-account.d.ts +7 -0
  186. package/dist/types/upwork-account/upwork-business-manager-account.js +2 -0
  187. package/dist/types/upwork-account/upwork-scraping-account.d.ts +5 -0
  188. package/dist/types/upwork-account/upwork-scraping-account.js +2 -0
  189. package/dist/types/user/index.js +2 -1
  190. package/dist/utils/index.js +17 -1
  191. package/dist/utils/try-catch.js +23 -8
  192. package/package.json +1 -1
  193. package/dist/schemas/event/index.d.ts +0 -58
  194. package/dist/types/shared.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
+ });
@@ -741,7 +741,7 @@ export declare const upworkJobSchema: z.ZodObject<{
741
741
  unansweredInvites: number;
742
742
  } | null | undefined;
743
743
  }>;
744
- export declare const leadSchema: z.ZodObject<Omit<{
744
+ export declare const leadSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
745
745
  id: z.ZodNullable<z.ZodString>;
746
746
  createdAt: z.ZodNullable<z.ZodNumber>;
747
747
  title: z.ZodNullable<z.ZodString>;
@@ -1031,7 +1031,7 @@ export declare const leadSchema: z.ZodObject<Omit<{
1031
1031
  invitesSent: number;
1032
1032
  unansweredInvites: number;
1033
1033
  }>>>;
1034
- } & {
1034
+ }, {
1035
1035
  jobId: z.ZodString;
1036
1036
  updatedAt: z.ZodNullable<z.ZodNumber>;
1037
1037
  suitabilityRating: z.ZodNullable<z.ZodNumber>;
@@ -1079,7 +1079,7 @@ export declare const leadSchema: z.ZodObject<Omit<{
1079
1079
  boostingAmount: z.ZodNullable<z.ZodNumber>;
1080
1080
  biddingTaskScheduled: z.ZodNullable<z.ZodBoolean>;
1081
1081
  scheduledBiddingTime: z.ZodNullable<z.ZodNumber>;
1082
- }, "processed">, "strip", z.ZodTypeAny, {
1082
+ }>, "processed">, "strip", z.ZodTypeAny, {
1083
1083
  region: "USOnly" | "UKOnly" | "Worldwide" | null;
1084
1084
  updatedAt: number | null;
1085
1085
  id: string | null;
@@ -1345,7 +1345,7 @@ export declare const leadSchema: z.ZodObject<Omit<{
1345
1345
  } | null | undefined;
1346
1346
  }>;
1347
1347
  export declare const leadResponseSchema: z.ZodObject<{
1348
- leads: z.ZodArray<z.ZodObject<Omit<{
1348
+ leads: z.ZodArray<z.ZodObject<Omit<z.objectUtil.extendShape<{
1349
1349
  id: z.ZodNullable<z.ZodString>;
1350
1350
  createdAt: z.ZodNullable<z.ZodNumber>;
1351
1351
  title: z.ZodNullable<z.ZodString>;
@@ -1635,7 +1635,7 @@ export declare const leadResponseSchema: z.ZodObject<{
1635
1635
  invitesSent: number;
1636
1636
  unansweredInvites: number;
1637
1637
  }>>>;
1638
- } & {
1638
+ }, {
1639
1639
  jobId: z.ZodString;
1640
1640
  updatedAt: z.ZodNullable<z.ZodNumber>;
1641
1641
  suitabilityRating: z.ZodNullable<z.ZodNumber>;
@@ -1683,7 +1683,7 @@ export declare const leadResponseSchema: z.ZodObject<{
1683
1683
  boostingAmount: z.ZodNullable<z.ZodNumber>;
1684
1684
  biddingTaskScheduled: z.ZodNullable<z.ZodBoolean>;
1685
1685
  scheduledBiddingTime: z.ZodNullable<z.ZodNumber>;
1686
- }, "processed">, "strip", z.ZodTypeAny, {
1686
+ }>, "processed">, "strip", z.ZodTypeAny, {
1687
1687
  region: "USOnly" | "UKOnly" | "Worldwide" | null;
1688
1688
  updatedAt: number | null;
1689
1689
  id: string | null;
@@ -1,166 +1,19 @@
1
- import { array, boolean, custom, number, object, record, string, z } from "zod";
2
- import { questionAnswerPairSchema } from "../ai/proposal";
3
- import { regionSchema } from "../shared";
4
- import { leadNoteSchema } from "./lead-note";
5
- import { agentStatusSchema, leadStatusSchema } from "./lead-status";
6
- export const jobSkillsSchema = object({
7
- name: string(),
8
- });
9
- export const vendorQualificationSchema = object({
10
- location: string().nullable(),
11
- talentType: z.enum(["Agency", "Independent", "unspecified"]).nullable(),
12
- englishLevel: string().nullable(),
13
- minimumEarnings: number().nullable(),
14
- jobSuccessScore: string().nullable(),
15
- includeRisingTalent: string().nullable(),
16
- });
17
- export const clientInfoSchema = object({
18
- isPaymentVerified: boolean().nullable(),
19
- isPhoneVerified: boolean().nullable(),
20
- numberOfReviews: number().nullable(),
21
- rating: number().nullable(),
22
- country: string().nullable(),
23
- region: string().nullable(),
24
- jobsPosted: number().nullable(),
25
- totalSpent: number().nullable(),
26
- numberOfHires: number().nullable(),
27
- activeEngagements: number().nullable(),
28
- openJobs: number().nullable(),
29
- hireRate: number().nullable(),
30
- memberSince: string().nullable(),
31
- companyIndustry: string().nullable(),
32
- companySize: string().nullable(),
33
- enterpriseClient: boolean().nullable(),
34
- avgHourlyRatePaid: number().nullable(),
35
- });
36
- export const clientReviewSchema = object({
37
- jobTitle: string().nullable(),
38
- freelancerName: string().nullable(),
39
- freelancerRating: number().nullable(),
40
- freelancerFeedback: string().nullable(),
41
- clientFeedback: string().nullable(),
42
- clientFeedbackRating: number().nullable(),
43
- dateRange: string().nullable(),
44
- paymentType: string().nullable(),
45
- fixedPrice: number().nullable(),
46
- hourlyRate: number().nullable(),
47
- numHours: number().nullable(),
48
- totalBilled: number().nullable(),
49
- });
50
- export const bidRangeSchema = object({
51
- high: number().nullable(),
52
- avg: number().nullable(),
53
- low: number().nullable(),
54
- });
55
- export const jobActivitySchema = object({
56
- proposals: object({
57
- min: number().nullable(),
58
- max: number().nullable(),
59
- }),
60
- lastViewedByClient: string().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
- createdAt: number().nullable(),
92
- title: string().nullable(),
93
- category: string().nullable(),
94
- skills: array(jobSkillsSchema).nullable(),
95
- datetime: number().nullable(),
96
- description: string().nullable(),
97
- descriptionLength: number().nullable(),
98
- connectsRequired: number().nullable(),
99
- projectType: string().nullable(),
100
- projectDuration: string().nullable(),
101
- questions: array(string()).nullable(),
102
- jobUrl: string().nullable(),
103
- metadata: metadataSchema.nullable(),
104
- clientInfo: clientInfoSchema.nullable(),
105
- vendorQualifications: vendorQualificationSchema.nullable(),
106
- processed: boolean().nullable(),
107
- isFeatured: boolean().nullable(),
108
- clientReviews: array(clientReviewSchema).nullable(),
109
- region: regionSchema.nullable(),
110
- bidRange: bidRangeSchema.nullable(),
111
- jobActivity: jobActivitySchema.nullable(),
112
- activityUpdates: z
113
- .union([z.literal(1), z.literal(2), z.literal(3)])
114
- .nullable(),
115
- activity: record(jobActivityOffsetEnum, jobActivitySchema).nullish(),
116
- activityDelta: jobActivityDeltaSchema.nullish(),
117
- });
118
- export const leadSchema = upworkJobSchema
119
- .extend({
120
- jobId: string(),
121
- updatedAt: number().nullable(),
122
- suitabilityRating: number().nullable(),
123
- suitabilityReason: string().nullable(),
124
- proposal: string().nullable(),
125
- questionAnswerPairs: array(questionAnswerPairSchema).nullable(),
126
- agentStatus: agentStatusSchema.nullable(),
127
- leadStatus: leadStatusSchema.nullable(),
128
- notes: array(leadNoteSchema).nullable(),
129
- biddingAmount: number().nullable(),
130
- boosted: boolean().nullable(),
131
- boostingAmount: number().nullable(),
132
- biddingTaskScheduled: boolean().nullable(),
133
- scheduledBiddingTime: number().nullable(),
134
- })
135
- .omit({
136
- processed: true,
137
- });
138
- export const leadResponseSchema = object({
139
- leads: array(leadSchema),
140
- nextCursor: string().nullable(),
141
- hasMore: boolean(),
142
- leadCounts: number().nullable(),
143
- });
144
- export const jobListingSchema = object({
145
- uid: string().nullable(),
146
- title: string().nullable(),
147
- jobUrl: string().nullable(),
148
- datetime: string().nullable(),
149
- isFeatured: boolean().nullable(),
150
- region: regionSchema.nullable(),
151
- });
152
- export const jobActivityOffsetHourSchema = custom((val) => jobActivityOffsetHours.includes(val));
153
- export const jobActivityUpdateSchema = object({
154
- data: jobActivitySchema,
155
- offsetHour: jobActivityOffsetHourSchema,
156
- scrapedAt: number(),
157
- });
158
- export const jobActivitySnapshotSchema = object({
159
- jobUrl: string(),
160
- activity: jobActivitySchema,
161
- postedAt: number(),
162
- scrapedAt: number(),
163
- hoursSincePosted: number(),
164
- });
165
- export * from "./lead-note";
166
- export * from "./lead-status";
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",