lancer-shared 1.2.34 → 1.2.35

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 (204) hide show
  1. package/dist/bundle.cjs.js +51 -19
  2. package/dist/constants/account-status.d.ts +3 -0
  3. package/dist/constants/account-status.js +17 -0
  4. package/dist/constants/collections.d.ts +13 -0
  5. package/dist/constants/collections.js +16 -0
  6. package/dist/constants/common-questions.js +60 -0
  7. package/dist/constants/index.js +40 -0
  8. package/dist/constants/job-filter-options.js +268 -0
  9. package/dist/constants/job-status.js +26 -0
  10. package/dist/constants/mappings/countryMapping.js +122 -0
  11. package/dist/constants/mappings/regionMapping.js +242 -0
  12. package/dist/constants/organization.d.ts +2 -0
  13. package/dist/constants/routes.js +108 -0
  14. package/dist/constants/upwork-accounts.js +21 -0
  15. package/dist/index.js +20 -0
  16. package/dist/schemas/account/account-status.js +11 -0
  17. package/dist/schemas/account/bidder-account.js +37 -0
  18. package/dist/schemas/account/index.js +19 -0
  19. package/dist/schemas/account/manager-account.d.ts +116 -0
  20. package/dist/schemas/account/manager-account.js +38 -0
  21. package/dist/schemas/account/scraper-account.js +37 -0
  22. package/dist/schemas/agent/index.d.ts +20 -10
  23. package/dist/schemas/ai/ai-config.d.ts +36 -0
  24. package/dist/schemas/ai/ai-config.js +12 -0
  25. package/dist/schemas/ai/index.d.ts +3 -0
  26. package/dist/schemas/ai/index.js +19 -0
  27. package/dist/schemas/ai/proposal.d.ts +82 -0
  28. package/dist/schemas/ai/proposal.js +16 -0
  29. package/dist/schemas/ai/suitability.d.ts +37 -0
  30. package/dist/schemas/ai/suitability.js +17 -0
  31. package/dist/schemas/bid/bid-result.js +15 -0
  32. package/dist/schemas/bid/bid.js +36 -0
  33. package/dist/schemas/bid/index.js +18 -0
  34. package/dist/schemas/bidding/index.d.ts +1 -0
  35. package/dist/schemas/bidding/index.js +17 -0
  36. package/dist/schemas/bidding/proposal-bidding-status.d.ts +26 -0
  37. package/dist/schemas/bidding/proposal-bidding-status.js +18 -0
  38. package/dist/schemas/campaign/campaign-ai-metrics.js +9 -0
  39. package/dist/schemas/campaign/campaign-analytics.d.ts +3975 -206
  40. package/dist/schemas/campaign/campaign-analytics.js +41 -0
  41. package/dist/schemas/campaign/campaign-expenses.js +9 -0
  42. package/dist/schemas/campaign/campaign-insights.js +31 -0
  43. package/dist/schemas/campaign/campaign-integrations.d.ts +87 -0
  44. package/dist/schemas/campaign/campaign-integrations.js +16 -0
  45. package/dist/schemas/campaign/campaign-job-count.d.ts +2 -0
  46. package/dist/schemas/campaign/campaign-job-count.js +6 -0
  47. package/dist/schemas/campaign/campaign.d.ts +9 -9
  48. package/dist/schemas/campaign/campaign.js +44 -0
  49. package/dist/schemas/campaign/index.js +23 -0
  50. package/dist/schemas/chat-message/chat-message.d.ts +31 -0
  51. package/dist/schemas/chat-message/chat-message.js +13 -0
  52. package/dist/schemas/chat-message/index.d.ts +1 -0
  53. package/dist/schemas/chat-message/index.js +17 -0
  54. package/dist/schemas/config/agency-config.d.ts +17 -0
  55. package/dist/schemas/config/agency-config.js +10 -0
  56. package/dist/schemas/config/index.d.ts +1 -0
  57. package/dist/schemas/config/index.js +17 -0
  58. package/dist/schemas/dashboard/index.d.ts +0 -20
  59. package/dist/schemas/index.d.ts +0 -1
  60. package/dist/schemas/index.js +32 -0
  61. package/dist/schemas/job/index.js +19 -0
  62. package/dist/schemas/job/job-details.d.ts +335 -0
  63. package/dist/schemas/job/job-details.js +29 -0
  64. package/dist/schemas/job/job-note.d.ts +83 -0
  65. package/dist/schemas/job/job-note.js +30 -0
  66. package/dist/schemas/job/job-status.d.ts +3 -0
  67. package/dist/schemas/job/job-status.js +27 -0
  68. package/dist/schemas/job/job.d.ts +1160 -0
  69. package/dist/schemas/job/job.js +90 -0
  70. package/dist/schemas/job/pipeline-job.d.ts +602 -0
  71. package/dist/schemas/job/pipeline-job.js +42 -0
  72. package/dist/schemas/job/upwork-job.d.ts +334 -0
  73. package/dist/schemas/job/upwork-job.js +60 -0
  74. package/dist/schemas/job-filters/index.d.ts +1 -0
  75. package/dist/schemas/job-filters/index.js +17 -0
  76. package/dist/schemas/job-filters/job-filters.d.ts +241 -0
  77. package/dist/schemas/job-filters/job-filters.js +87 -0
  78. package/dist/schemas/lead/index.d.ts +856 -14
  79. package/dist/schemas/lead/index.js +19 -0
  80. package/dist/schemas/lead/lead-note.d.ts +83 -0
  81. package/dist/schemas/lead/lead-note.js +30 -0
  82. package/dist/schemas/lead/lead-status.d.ts +10 -7
  83. package/dist/schemas/lead/lead-status.js +26 -0
  84. package/dist/schemas/lead/lead.d.ts +1897 -0
  85. package/dist/schemas/lead/lead.js +143 -0
  86. package/dist/schemas/lead/nuxt.d.ts +1664 -0
  87. package/dist/schemas/logger/index.js +17 -0
  88. package/dist/schemas/logger/log-event.d.ts +5 -5
  89. package/dist/schemas/logger/log-event.js +66 -0
  90. package/dist/schemas/organization/index.js +17 -0
  91. package/dist/schemas/organization/organization.d.ts +70 -0
  92. package/dist/schemas/organization/organization.js +19 -0
  93. package/dist/schemas/proxy/index.js +17 -0
  94. package/dist/schemas/proxy/proxy.js +21 -0
  95. package/dist/schemas/saved-search/index.js +12 -0
  96. package/dist/schemas/scraper/index.js +18 -0
  97. package/dist/schemas/scraper/scrape-payload.d.ts +15 -10
  98. package/dist/schemas/scraper/scrape-payload.js +16 -0
  99. package/dist/schemas/scraper/scrape-result.js +23 -0
  100. package/dist/schemas/shared.d.ts +20 -0
  101. package/dist/schemas/shared.js +16 -0
  102. package/dist/schemas/time-filter/index.js +9 -0
  103. package/dist/schemas/upwork-account/index.d.ts +3 -0
  104. package/dist/schemas/upwork-account/index.js +19 -0
  105. package/dist/schemas/upwork-account/upwork-account-status.d.ts +2 -0
  106. package/dist/schemas/upwork-account/upwork-account-status.js +11 -0
  107. package/dist/schemas/upwork-account/upwork-business-manager-account.d.ts +95 -0
  108. package/dist/schemas/upwork-account/upwork-business-manager-account.js +35 -0
  109. package/dist/schemas/upwork-account/upwork-scraping-account.d.ts +90 -0
  110. package/dist/schemas/upwork-account/upwork-scraping-account.js +29 -0
  111. package/dist/schemas/user/index.js +55 -0
  112. package/dist/types/account/account-status.d.ts +3 -0
  113. package/dist/types/account/account-status.js +2 -0
  114. package/dist/types/account/bidder-account.d.ts +7 -0
  115. package/dist/types/account/bidder-account.js +2 -0
  116. package/dist/types/account/index.d.ts +3 -0
  117. package/dist/types/account/index.js +19 -0
  118. package/dist/types/account/manager-account.d.ts +7 -0
  119. package/dist/types/account/manager-account.js +2 -0
  120. package/dist/types/account/scraper-account.d.ts +5 -0
  121. package/dist/types/account/scraper-account.js +2 -0
  122. package/dist/types/ai/ai-config.d.ts +6 -0
  123. package/dist/types/ai/ai-config.js +2 -0
  124. package/dist/types/ai/index.d.ts +3 -0
  125. package/dist/types/ai/index.js +19 -0
  126. package/dist/types/ai/proposal.d.ts +10 -0
  127. package/dist/types/ai/proposal.js +2 -0
  128. package/dist/types/ai/suitability.d.ts +6 -0
  129. package/dist/types/ai/suitability.js +2 -0
  130. package/dist/types/bid/bid-result.d.ts +5 -0
  131. package/dist/types/bid/bid-result.js +2 -0
  132. package/dist/types/bid/bid.d.ts +9 -0
  133. package/dist/types/bid/bid.js +2 -0
  134. package/dist/types/bid/index.d.ts +2 -0
  135. package/dist/types/bid/index.js +18 -0
  136. package/dist/types/bidding/index.d.ts +1 -0
  137. package/dist/types/bidding/index.js +17 -0
  138. package/dist/types/bidding/proposal-bidding-status.d.ts +3 -0
  139. package/dist/types/bidding/proposal-bidding-status.js +2 -0
  140. package/dist/types/campaign/campaign-analytics.d.ts +7 -0
  141. package/dist/types/campaign/campaign-analytics.js +2 -0
  142. package/dist/types/campaign/campaign-expenses.d.ts +3 -0
  143. package/dist/types/campaign/campaign-expenses.js +2 -0
  144. package/dist/types/campaign/campaign-insights.js +2 -0
  145. package/dist/types/campaign/campaign-integrations.d.ts +6 -0
  146. package/dist/types/campaign/campaign-integrations.js +2 -0
  147. package/dist/types/campaign/campaign-job-count.d.ts +4 -0
  148. package/dist/types/campaign/campaign-job-count.js +2 -0
  149. package/dist/types/campaign/campaign.js +2 -0
  150. package/dist/types/campaign/index.js +22 -0
  151. package/dist/types/chat-message/chat-message.d.ts +4 -0
  152. package/dist/types/chat-message/chat-message.js +2 -0
  153. package/dist/types/chat-message/index.d.ts +1 -0
  154. package/dist/types/chat-message/index.js +17 -0
  155. package/dist/types/config/agency-config.d.ts +4 -0
  156. package/dist/types/config/agency-config.js +2 -0
  157. package/dist/types/config/index.d.ts +1 -0
  158. package/dist/types/config/index.js +17 -0
  159. package/dist/types/index.d.ts +15 -0
  160. package/dist/types/index.js +29 -0
  161. package/dist/types/job/index.d.ts +48 -0
  162. package/dist/types/job/index.js +19 -0
  163. package/dist/types/job/job-details.d.ts +36 -0
  164. package/dist/types/job/job-details.js +2 -0
  165. package/dist/types/job/job-note.d.ts +10 -0
  166. package/dist/types/job/job-note.js +2 -0
  167. package/dist/types/job/job-status.d.ts +5 -0
  168. package/dist/types/job/job-status.js +12 -0
  169. package/dist/types/job/job.d.ts +36 -0
  170. package/dist/types/job/job.js +2 -0
  171. package/dist/types/job/nuxt.d.ts +4 -0
  172. package/dist/types/job-filters/index.d.ts +1 -0
  173. package/dist/types/job-filters/index.js +17 -0
  174. package/dist/types/job-filters/job-filters.d.ts +4 -0
  175. package/dist/types/job-filters/job-filters.js +2 -0
  176. package/dist/types/logger/index.d.ts +1 -0
  177. package/dist/types/logger/index.js +17 -0
  178. package/dist/types/logger/log-event.js +2 -0
  179. package/dist/types/saved-search/index.d.ts +6 -0
  180. package/dist/types/saved-search/index.js +2 -0
  181. package/dist/types/scraper/index.d.ts +2 -0
  182. package/dist/types/scraper/index.js +18 -0
  183. package/dist/types/scraper/scrape-payload.d.ts +10 -0
  184. package/dist/types/scraper/scrape-payload.js +2 -0
  185. package/dist/types/scraper/scrape-result.d.ts +8 -0
  186. package/dist/types/scraper/scrape-result.js +2 -0
  187. package/dist/types/shared.d.ts +8 -0
  188. package/dist/types/time-filter/index.d.ts +3 -0
  189. package/dist/types/time-filter/index.js +2 -0
  190. package/dist/types/transaction/index.d.ts +4 -0
  191. package/dist/types/upwork-account/index.d.ts +3 -0
  192. package/dist/types/upwork-account/index.js +19 -0
  193. package/dist/types/upwork-account/upwork-account-status.d.ts +3 -0
  194. package/dist/types/upwork-account/upwork-account-status.js +2 -0
  195. package/dist/types/upwork-account/upwork-business-manager-account.d.ts +7 -0
  196. package/dist/types/upwork-account/upwork-business-manager-account.js +2 -0
  197. package/dist/types/upwork-account/upwork-scraping-account.d.ts +5 -0
  198. package/dist/types/upwork-account/upwork-scraping-account.js +2 -0
  199. package/dist/types/usage/index.d.ts +6 -0
  200. package/dist/types/user/index.d.ts +15 -0
  201. package/dist/types/user/index.js +2 -0
  202. package/dist/utils/index.js +17 -0
  203. package/dist/utils/try-catch.js +25 -0
  204. package/package.json +1 -1
@@ -0,0 +1,17 @@
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("./log-event"), exports);
@@ -290,13 +290,13 @@ export declare const leadStatusEventMetadata: z.ZodObject<{
290
290
  leadId: z.ZodString;
291
291
  userId: z.ZodString;
292
292
  metadata: z.ZodOptional<z.ZodObject<{
293
- status: z.ZodEnum<["leads", "contacted", "viewed", "replied", "interview", "won", "lost"]>;
293
+ status: z.ZodEnum<["leads", "contacted", "viewed", "replied", "won", "lost"]>;
294
294
  proposalId: z.ZodNullable<z.ZodString>;
295
295
  }, "strip", z.ZodTypeAny, {
296
- status: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost";
296
+ status: "leads" | "contacted" | "viewed" | "replied" | "won" | "lost";
297
297
  proposalId: string | null;
298
298
  }, {
299
- status: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost";
299
+ status: "leads" | "contacted" | "viewed" | "replied" | "won" | "lost";
300
300
  proposalId: string | null;
301
301
  }>>;
302
302
  reason: z.ZodOptional<z.ZodString>;
@@ -307,7 +307,7 @@ export declare const leadStatusEventMetadata: z.ZodObject<{
307
307
  leadId: string;
308
308
  reason?: string | undefined;
309
309
  metadata?: {
310
- status: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost";
310
+ status: "leads" | "contacted" | "viewed" | "replied" | "won" | "lost";
311
311
  proposalId: string | null;
312
312
  } | undefined;
313
313
  }, {
@@ -317,7 +317,7 @@ export declare const leadStatusEventMetadata: z.ZodObject<{
317
317
  leadId: string;
318
318
  reason?: string | undefined;
319
319
  metadata?: {
320
- status: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost";
320
+ status: "leads" | "contacted" | "viewed" | "replied" | "won" | "lost";
321
321
  proposalId: string | null;
322
322
  } | undefined;
323
323
  }>;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logEventSchema = exports.LogEventTypeEnum = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.LogEventTypeEnum = zod_1.z.enum([
6
+ // Scraper Events
7
+ "scraperStarted",
8
+ "scraperCompleted",
9
+ "jobScraped",
10
+ "jobsIndexed",
11
+ "jobDuplicateSkipped",
12
+ "scraperFailed",
13
+ "userProfileScrapingStarted",
14
+ "userProfileScrapingComplete",
15
+ "userProfileScrapingFailed",
16
+ // Job Sync & Campaign Matching
17
+ "jobSyncPublished",
18
+ "jobSyncReceived",
19
+ "leadsCreatedAndSynced",
20
+ // Suitability Events
21
+ "suitabilityPending",
22
+ "suitabilityProcessing",
23
+ "suitabilityComplete",
24
+ "suitabilityFailed",
25
+ "manualSuitabilityAnalyzed",
26
+ // Proposal Events
27
+ "proposalProcessing",
28
+ "proposalComplete",
29
+ "proposalFailed",
30
+ "manualProposalGenerated",
31
+ // Bidding Events
32
+ "biddingProcessing",
33
+ "biddingComplete",
34
+ "biddingFailed",
35
+ "biddingSkipped",
36
+ "biddingPending",
37
+ // System/Generic Events
38
+ "errorLogged",
39
+ "cloudTaskRetry",
40
+ "manualLeadEdited",
41
+ "leadArchived",
42
+ "auditTrailLogged",
43
+ // Knowledge Base Events
44
+ "knowledgeBaseGenerationComplete",
45
+ "knowledgeBaseGenerationFailed",
46
+ ]);
47
+ exports.logEventSchema = zod_1.z.object({
48
+ // The type of event (use a z.enum if possible)
49
+ type: exports.LogEventTypeEnum, // e.g. "suitability-failed", "proposal-generated"
50
+ // The service that triggered the event
51
+ source: zod_1.z.string(), // e.g. "lancer-agents", "lancer-bidding"
52
+ // Optional: Allow logging non-lead events in the future
53
+ resourceType: zod_1.z.string().default("lead"), // e.g. "lead", "campaign", "user"
54
+ // ID of the resource (primary entity affected)
55
+ resourceId: zod_1.z.string().nullable(), // fallback if leadId is not applicable
56
+ // Lead-level metadata
57
+ leadId: zod_1.z.string().nullable(),
58
+ campaignId: zod_1.z.string().nullable(),
59
+ userId: zod_1.z.string().nullable(),
60
+ // Reason or message for the event
61
+ reason: zod_1.z.string().nullable(),
62
+ // Generic metadata (stacktrace, score, raw request, etc.)
63
+ metadata: zod_1.z.record(zod_1.z.unknown()).nullable(),
64
+ // Optional timestamp override
65
+ timestamp: zod_1.z.number(),
66
+ });
@@ -0,0 +1,17 @@
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("./organization"), exports);
@@ -0,0 +1,70 @@
1
+ import { z } from 'zod';
2
+ export declare const bidConfigSchema: z.ZodObject<{
3
+ agencyName: z.ZodNullable<z.ZodString>;
4
+ bidderId: z.ZodNullable<z.ZodString>;
5
+ contractorName: z.ZodNullable<z.ZodString>;
6
+ specialisedProfile: z.ZodNullable<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ agencyName: string | null;
9
+ bidderId: string | null;
10
+ contractorName: string | null;
11
+ specialisedProfile: string | null;
12
+ }, {
13
+ agencyName: string | null;
14
+ bidderId: string | null;
15
+ contractorName: string | null;
16
+ specialisedProfile: string | null;
17
+ }>;
18
+ export declare const organizationTypeSchema: z.ZodEnum<["agency", "freelancer"]>;
19
+ export declare const organizationSchema: z.ZodObject<{
20
+ id: z.ZodString;
21
+ name: z.ZodString;
22
+ type: z.ZodEnum<["agency", "freelancer"]>;
23
+ bidConfig: z.ZodObject<{
24
+ agencyName: z.ZodNullable<z.ZodString>;
25
+ bidderId: z.ZodNullable<z.ZodString>;
26
+ contractorName: z.ZodNullable<z.ZodString>;
27
+ specialisedProfile: z.ZodNullable<z.ZodString>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ agencyName: string | null;
30
+ bidderId: string | null;
31
+ contractorName: string | null;
32
+ specialisedProfile: string | null;
33
+ }, {
34
+ agencyName: string | null;
35
+ bidderId: string | null;
36
+ contractorName: string | null;
37
+ specialisedProfile: string | null;
38
+ }>;
39
+ createdAt: z.ZodDate;
40
+ updatedAt: z.ZodDate;
41
+ }, "strip", z.ZodTypeAny, {
42
+ type: "agency" | "freelancer";
43
+ id: string;
44
+ name: string;
45
+ bidConfig: {
46
+ agencyName: string | null;
47
+ bidderId: string | null;
48
+ contractorName: string | null;
49
+ specialisedProfile: string | null;
50
+ };
51
+ createdAt: Date;
52
+ updatedAt: Date;
53
+ }, {
54
+ type: "agency" | "freelancer";
55
+ id: string;
56
+ name: string;
57
+ bidConfig: {
58
+ agencyName: string | null;
59
+ bidderId: string | null;
60
+ contractorName: string | null;
61
+ specialisedProfile: string | null;
62
+ };
63
+ createdAt: Date;
64
+ updatedAt: Date;
65
+ }>;
66
+ export interface Organization extends z.infer<typeof organizationSchema> {
67
+ }
68
+ export interface BidConfig extends z.infer<typeof bidConfigSchema> {
69
+ }
70
+ export type OrganizationType = z.infer<typeof organizationTypeSchema>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.organizationSchema = exports.organizationTypeSchema = exports.bidConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.bidConfigSchema = zod_1.z.object({
6
+ agencyName: zod_1.z.string().nullable(),
7
+ bidderId: zod_1.z.string().nullable(),
8
+ contractorName: zod_1.z.string().nullable(),
9
+ specialisedProfile: zod_1.z.string().nullable(),
10
+ });
11
+ exports.organizationTypeSchema = zod_1.z.enum(['agency', 'freelancer']);
12
+ exports.organizationSchema = zod_1.z.object({
13
+ id: zod_1.z.string(),
14
+ name: zod_1.z.string(),
15
+ type: exports.organizationTypeSchema,
16
+ bidConfig: exports.bidConfigSchema,
17
+ createdAt: zod_1.z.date(),
18
+ updatedAt: zod_1.z.date(),
19
+ });
@@ -0,0 +1,17 @@
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("./proxy"), exports);
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.externalProxySchema = exports.proxySchema = exports.proxyCountrySchema = exports.proxyProviderSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.proxyProviderSchema = zod_1.z.enum(['webshare']);
6
+ exports.proxyCountrySchema = zod_1.z.enum(['USA']);
7
+ exports.proxySchema = zod_1.z.object({
8
+ id: zod_1.z.string(),
9
+ externalId: zod_1.z.string(),
10
+ host: zod_1.z.string(),
11
+ port: zod_1.z.number(),
12
+ username: zod_1.z.string(),
13
+ password: zod_1.z.string(),
14
+ provider: exports.proxyProviderSchema,
15
+ country: exports.proxyCountrySchema,
16
+ bidderId: zod_1.z.string().nullable(),
17
+ });
18
+ exports.externalProxySchema = exports.proxySchema.omit({
19
+ id: true,
20
+ bidderId: true,
21
+ });
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.savedSearchSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const shared_1 = require("../shared");
6
+ exports.savedSearchSchema = (0, zod_1.object)({
7
+ id: (0, zod_1.number)().int(),
8
+ name: (0, zod_1.string)(),
9
+ url: (0, zod_1.string)(),
10
+ createdAt: (0, zod_1.date)(),
11
+ isActive: shared_1.booleanSchema,
12
+ });
@@ -0,0 +1,18 @@
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("./scrape-payload"), exports);
18
+ __exportStar(require("./scrape-result"), exports);
@@ -346,7 +346,7 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
346
346
  monthlyBudget: import("zod").ZodNullable<import("zod").ZodNumber>;
347
347
  suitabilityThreshold: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodNumber>>;
348
348
  boostingThreshold: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodNumber>>;
349
- leadCounts: import("zod").ZodNullable<import("zod").ZodRecord<import("zod").ZodEnum<["leads", "contacted", "viewed", "replied", "interview", "won", "lost"]>, import("zod").ZodNumber>>;
349
+ leadCounts: import("zod").ZodNullable<import("zod").ZodRecord<import("zod").ZodEnum<["leads", "contacted", "viewed", "replied", "won", "lost"]>, import("zod").ZodNumber>>;
350
350
  expenses: import("zod").ZodObject<{
351
351
  biddingAmount: import("zod").ZodDefault<import("zod").ZodNumber>;
352
352
  boostingAmount: import("zod").ZodDefault<import("zod").ZodNumber>;
@@ -445,7 +445,7 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
445
445
  monthlyBudget: number | null;
446
446
  suitabilityThreshold: number | null;
447
447
  boostingThreshold: number | null;
448
- leadCounts: Partial<Record<"leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost", number>> | null;
448
+ leadCounts: Partial<Record<"leads" | "contacted" | "viewed" | "replied" | "won" | "lost", number>> | null;
449
449
  expenses: {
450
450
  biddingAmount: number;
451
451
  boostingAmount: number;
@@ -521,7 +521,7 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
521
521
  automatedBidding: boolean | null;
522
522
  webhookUrl: string | null;
523
523
  monthlyBudget: number | null;
524
- leadCounts: Partial<Record<"leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost", number>> | null;
524
+ leadCounts: Partial<Record<"leads" | "contacted" | "viewed" | "replied" | "won" | "lost", number>> | null;
525
525
  expenses: {
526
526
  biddingAmount?: number | undefined;
527
527
  boostingAmount?: number | undefined;
@@ -1110,12 +1110,13 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
1110
1110
  answer: string;
1111
1111
  }>, "many">>;
1112
1112
  agentStatus: import("zod").ZodNullable<import("zod").ZodEnum<["suitabilityPending", "suitabilityProcessing", "suitabilityComplete", "suitabilityFailed", "proposalProcessing", "proposalComplete", "proposalFailed", "biddingProcessing", "biddingComplete", "biddingFailed", "jobArchived"]>>;
1113
- leadStatus: import("zod").ZodNullable<import("zod").ZodEnum<["leads", "contacted", "viewed", "replied", "interview", "won", "lost"]>>;
1113
+ leadStatus: import("zod").ZodNullable<import("zod").ZodEnum<["leads", "contacted", "viewed", "replied", "won", "lost"]>>;
1114
1114
  biddingAmount: import("zod").ZodNullable<import("zod").ZodNumber>;
1115
1115
  boosted: import("zod").ZodNullable<import("zod").ZodBoolean>;
1116
1116
  boostingAmount: import("zod").ZodNullable<import("zod").ZodNumber>;
1117
1117
  biddingTaskScheduled: import("zod").ZodNullable<import("zod").ZodBoolean>;
1118
1118
  scheduledBiddingTime: import("zod").ZodNullable<import("zod").ZodNumber>;
1119
+ wonAmount: import("zod").ZodOptional<import("zod").ZodNumber>;
1119
1120
  }>, "processed">, "strip", import("zod").ZodTypeAny, {
1120
1121
  uid: string | null;
1121
1122
  title: string | null;
@@ -1219,7 +1220,7 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
1219
1220
  answer: string;
1220
1221
  }[] | null;
1221
1222
  agentStatus: "proposalFailed" | "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
1222
- leadStatus: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost" | null;
1223
+ leadStatus: "leads" | "contacted" | "viewed" | "replied" | "won" | "lost" | null;
1223
1224
  biddingTaskScheduled: boolean | null;
1224
1225
  scheduledBiddingTime: number | null;
1225
1226
  activity?: Partial<Record<"4h" | "24h", {
@@ -1243,6 +1244,7 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
1243
1244
  unansweredInvites: number;
1244
1245
  } | null | undefined;
1245
1246
  proposalId?: string | undefined;
1247
+ wonAmount?: number | undefined;
1246
1248
  }, {
1247
1249
  uid: string | null;
1248
1250
  title: string | null;
@@ -1346,7 +1348,7 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
1346
1348
  answer: string;
1347
1349
  }[] | null;
1348
1350
  agentStatus: "proposalFailed" | "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
1349
- leadStatus: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost" | null;
1351
+ leadStatus: "leads" | "contacted" | "viewed" | "replied" | "won" | "lost" | null;
1350
1352
  biddingTaskScheduled: boolean | null;
1351
1353
  scheduledBiddingTime: number | null;
1352
1354
  activity?: Partial<Record<"4h" | "24h", {
@@ -1370,6 +1372,7 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
1370
1372
  unansweredInvites: number;
1371
1373
  } | null | undefined;
1372
1374
  proposalId?: string | undefined;
1375
+ wonAmount?: number | undefined;
1373
1376
  }>;
1374
1377
  bidder: import("zod").ZodObject<{
1375
1378
  id: import("zod").ZodString;
@@ -1515,7 +1518,7 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
1515
1518
  monthlyBudget: number | null;
1516
1519
  suitabilityThreshold: number | null;
1517
1520
  boostingThreshold: number | null;
1518
- leadCounts: Partial<Record<"leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost", number>> | null;
1521
+ leadCounts: Partial<Record<"leads" | "contacted" | "viewed" | "replied" | "won" | "lost", number>> | null;
1519
1522
  expenses: {
1520
1523
  biddingAmount: number;
1521
1524
  boostingAmount: number;
@@ -1679,7 +1682,7 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
1679
1682
  answer: string;
1680
1683
  }[] | null;
1681
1684
  agentStatus: "proposalFailed" | "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
1682
- leadStatus: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost" | null;
1685
+ leadStatus: "leads" | "contacted" | "viewed" | "replied" | "won" | "lost" | null;
1683
1686
  biddingTaskScheduled: boolean | null;
1684
1687
  scheduledBiddingTime: number | null;
1685
1688
  activity?: Partial<Record<"4h" | "24h", {
@@ -1703,6 +1706,7 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
1703
1706
  unansweredInvites: number;
1704
1707
  } | null | undefined;
1705
1708
  proposalId?: string | undefined;
1709
+ wonAmount?: number | undefined;
1706
1710
  };
1707
1711
  bidder: {
1708
1712
  id: string;
@@ -1791,7 +1795,7 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
1791
1795
  automatedBidding: boolean | null;
1792
1796
  webhookUrl: string | null;
1793
1797
  monthlyBudget: number | null;
1794
- leadCounts: Partial<Record<"leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost", number>> | null;
1798
+ leadCounts: Partial<Record<"leads" | "contacted" | "viewed" | "replied" | "won" | "lost", number>> | null;
1795
1799
  expenses: {
1796
1800
  biddingAmount?: number | undefined;
1797
1801
  boostingAmount?: number | undefined;
@@ -1960,7 +1964,7 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
1960
1964
  answer: string;
1961
1965
  }[] | null;
1962
1966
  agentStatus: "proposalFailed" | "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
1963
- leadStatus: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost" | null;
1967
+ leadStatus: "leads" | "contacted" | "viewed" | "replied" | "won" | "lost" | null;
1964
1968
  biddingTaskScheduled: boolean | null;
1965
1969
  scheduledBiddingTime: number | null;
1966
1970
  activity?: Partial<Record<"4h" | "24h", {
@@ -1984,6 +1988,7 @@ export declare const checkLeadStatusPayloadSchema: import("zod").ZodObject<{
1984
1988
  unansweredInvites: number;
1985
1989
  } | null | undefined;
1986
1990
  proposalId?: string | undefined;
1991
+ wonAmount?: number | undefined;
1987
1992
  };
1988
1993
  bidder: {
1989
1994
  id: string;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scrapeUserProfilePayloadSchema = exports.scrapePayloadSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.scrapePayloadSchema = zod_1.z.object({
6
+ latestJobsUrls: zod_1.z.array(zod_1.z.string()),
7
+ cookies: zod_1.z.array(zod_1.z.any()),
8
+ username: zod_1.z.string(),
9
+ password: zod_1.z.string(),
10
+ });
11
+ exports.scrapeUserProfilePayloadSchema = zod_1.z.object({
12
+ profileUrl: zod_1.z.string(),
13
+ cookies: zod_1.z.array(zod_1.z.any()),
14
+ username: zod_1.z.string(),
15
+ password: zod_1.z.string(),
16
+ });
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scrapeUserProfileResultSchema = exports.scrapeResultSchema = exports.regionSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const lead_1 = require("../lead");
6
+ const user_1 = require("../user");
7
+ exports.regionSchema = zod_1.z.union([
8
+ zod_1.z.literal("USOnly"),
9
+ zod_1.z.literal("UKOnly"),
10
+ zod_1.z.literal("Worldwide"),
11
+ ]);
12
+ exports.scrapeResultSchema = zod_1.z.object({
13
+ jobs: zod_1.z.array(lead_1.upworkJobSchema),
14
+ cookies: zod_1.z.array(zod_1.z.any()),
15
+ region: exports.regionSchema,
16
+ usAccountCookies: zod_1.z.array(zod_1.z.any()).optional(),
17
+ ukAccountCookies: zod_1.z.array(zod_1.z.any()).optional(),
18
+ });
19
+ exports.scrapeUserProfileResultSchema = zod_1.z.object({
20
+ success: zod_1.z.boolean(),
21
+ message: zod_1.z.string(),
22
+ data: user_1.upworkProfileSchema,
23
+ });
@@ -12,3 +12,23 @@ export type RequiredKeys<T, K extends keyof T> = Partial<Omit<T, K>> & Required<
12
12
  export type DeepPartial<T> = T extends object ? {
13
13
  [P in keyof T]?: DeepPartial<T[P]>;
14
14
  } : T;
15
+ export declare const organizationSchema: z.ZodObject<{
16
+ id: z.ZodString;
17
+ name: z.ZodString;
18
+ }, "strip", z.ZodTypeAny, {
19
+ id: string;
20
+ name: string;
21
+ }, {
22
+ id: string;
23
+ name: string;
24
+ }>;
25
+ export declare const campaignSchema: z.ZodObject<{
26
+ id: z.ZodString;
27
+ name: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ id: string;
30
+ name: string;
31
+ }, {
32
+ id: string;
33
+ name: string;
34
+ }>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.passwordSchema = exports.dateSchema = exports.booleanSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.booleanSchema = zod_1.z
6
+ .union([zod_1.z.boolean(), zod_1.z.literal("true"), zod_1.z.literal("false")])
7
+ .transform((value) => value === true || value === "true");
8
+ const dateSchema = (params = {}) => zod_1.coerce.date(Object.assign({}, params));
9
+ exports.dateSchema = dateSchema;
10
+ exports.passwordSchema = (0, zod_1.string)()
11
+ .min(8, "Password must be at least 8 characters long.")
12
+ .max(255, "Password must be at most 255 characters long.")
13
+ .refine((password) => /[a-z]/.test(password), "Password must contain at least one lowercase letter.")
14
+ .refine((password) => /[A-Z]/.test(password), "Password must contain at least one uppercase letter.")
15
+ .refine((password) => /\d/.test(password), "Password must contain at least one number.")
16
+ .refine((password) => /[\W_]/.test(password), "Password must contain at least one symbol.");
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.timeFilterSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.timeFilterSchema = zod_1.z.union([
6
+ zod_1.z.literal("last_7_days"),
7
+ zod_1.z.literal("last_30_days"),
8
+ zod_1.z.literal("all_time"),
9
+ ]);
@@ -0,0 +1,3 @@
1
+ export * from './upwork-account-status';
2
+ export * from './upwork-business-manager-account';
3
+ export * from './upwork-scraping-account';
@@ -0,0 +1,19 @@
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("./upwork-account-status"), exports);
18
+ __exportStar(require("./upwork-business-manager-account"), exports);
19
+ __exportStar(require("./upwork-scraping-account"), exports);
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const upworkAccountStatusSchema: z.ZodEnum<["verification_required", "shadow_banned", "healthy", "banned", "suspended"]>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.upworkAccountStatusSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.upworkAccountStatusSchema = zod_1.z.enum([
6
+ 'verification_required',
7
+ 'shadow_banned',
8
+ 'healthy',
9
+ 'banned',
10
+ 'suspended',
11
+ ]);