lancer-shared 1.0.174 → 1.0.176

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 (152) hide show
  1. package/dist/bundle.cjs.js +292 -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 +4 -1
  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/routes.js +35 -43
  12. package/dist/constants/upwork-accounts.js +6 -3
  13. package/dist/index.js +20 -4
  14. package/dist/schemas/account/account-status.js +5 -2
  15. package/dist/schemas/account/bidder-account.js +22 -19
  16. package/dist/schemas/account/index.js +19 -3
  17. package/dist/schemas/account/manager-account.d.ts +116 -0
  18. package/dist/schemas/account/manager-account.js +38 -0
  19. package/dist/schemas/account/scraper-account.js +24 -21
  20. package/dist/schemas/ai/ai-config.js +11 -8
  21. package/dist/schemas/ai/index.js +19 -3
  22. package/dist/schemas/ai/proposal.js +13 -10
  23. package/dist/schemas/ai/suitability.js +11 -8
  24. package/dist/schemas/bid/bid-result.js +13 -10
  25. package/dist/schemas/bid/bid.d.ts +12 -12
  26. package/dist/schemas/bid/bid.js +30 -27
  27. package/dist/schemas/bid/index.js +18 -2
  28. package/dist/schemas/bidding/index.d.ts +1 -0
  29. package/dist/schemas/bidding/index.js +17 -0
  30. package/dist/schemas/bidding/proposal-bidding-status.d.ts +26 -0
  31. package/dist/schemas/bidding/proposal-bidding-status.js +18 -0
  32. package/dist/schemas/campaign/campaign-ai-metrics.js +8 -5
  33. package/dist/schemas/campaign/campaign-analytics.d.ts +7 -0
  34. package/dist/schemas/campaign/campaign-analytics.js +31 -28
  35. package/dist/schemas/campaign/campaign-expenses.js +8 -5
  36. package/dist/schemas/campaign/campaign-insights.js +30 -30
  37. package/dist/schemas/campaign/campaign-integrations.js +13 -10
  38. package/dist/schemas/campaign/campaign-job-count.js +6 -3
  39. package/dist/schemas/campaign/campaign.js +35 -32
  40. package/dist/schemas/campaign/index.js +23 -7
  41. package/dist/schemas/chat-message/chat-message.js +10 -7
  42. package/dist/schemas/chat-message/index.js +17 -1
  43. package/dist/schemas/config/agency-config.js +9 -6
  44. package/dist/schemas/config/index.js +17 -1
  45. package/dist/schemas/index.js +32 -16
  46. package/dist/schemas/job/index.d.ts +3 -95
  47. package/dist/schemas/job/index.js +19 -0
  48. package/dist/schemas/job/job-details.d.ts +335 -0
  49. package/dist/schemas/job/job-details.js +29 -0
  50. package/dist/schemas/job/job-note.d.ts +83 -0
  51. package/dist/schemas/job/job-note.js +30 -0
  52. package/dist/schemas/job/job-status.d.ts +3 -0
  53. package/dist/schemas/job/job-status.js +27 -0
  54. package/dist/schemas/job/job.d.ts +1160 -0
  55. package/dist/schemas/job/job.js +90 -0
  56. package/dist/schemas/job/pipeline-job.d.ts +602 -0
  57. package/dist/schemas/job/pipeline-job.js +42 -0
  58. package/dist/schemas/job/upwork-job.d.ts +334 -0
  59. package/dist/schemas/job/upwork-job.js +60 -0
  60. package/dist/schemas/job-filters/index.js +17 -1
  61. package/dist/schemas/job-filters/job-filters.js +65 -62
  62. package/dist/schemas/lead/index.d.ts +67 -8
  63. package/dist/schemas/lead/index.js +19 -166
  64. package/dist/schemas/lead/lead-note.js +16 -13
  65. package/dist/schemas/lead/lead-status.js +6 -3
  66. package/dist/schemas/lead/lead.d.ts +1897 -0
  67. package/dist/schemas/lead/lead.js +143 -0
  68. package/dist/schemas/lead/nuxt.d.ts +1664 -0
  69. package/dist/schemas/logger/index.js +17 -1
  70. package/dist/schemas/logger/log-event.d.ts +9 -4
  71. package/dist/schemas/logger/log-event.js +19 -38
  72. package/dist/schemas/organization/index.js +17 -1
  73. package/dist/schemas/organization/organization.js +17 -14
  74. package/dist/schemas/proxy/index.js +17 -1
  75. package/dist/schemas/proxy/proxy.js +17 -14
  76. package/dist/schemas/saved-search/index.js +11 -8
  77. package/dist/schemas/scraper/index.js +18 -2
  78. package/dist/schemas/scraper/scrape-payload.js +14 -19
  79. package/dist/schemas/scraper/scrape-result.d.ts +23 -4
  80. package/dist/schemas/scraper/scrape-result.js +21 -21
  81. package/dist/schemas/shared.js +9 -12
  82. package/dist/schemas/time-filter/index.js +8 -5
  83. package/dist/schemas/upwork-account/index.d.ts +3 -0
  84. package/dist/schemas/upwork-account/index.js +19 -0
  85. package/dist/schemas/upwork-account/upwork-account-status.d.ts +2 -0
  86. package/dist/schemas/upwork-account/upwork-account-status.js +11 -0
  87. package/dist/schemas/upwork-account/upwork-business-manager-account.d.ts +95 -0
  88. package/dist/schemas/upwork-account/upwork-business-manager-account.js +35 -0
  89. package/dist/schemas/upwork-account/upwork-scraping-account.d.ts +90 -0
  90. package/dist/schemas/upwork-account/upwork-scraping-account.js +29 -0
  91. package/dist/schemas/user/index.js +41 -38
  92. package/dist/types/account/account-status.js +2 -1
  93. package/dist/types/account/bidder-account.js +2 -1
  94. package/dist/types/account/index.js +19 -3
  95. package/dist/types/account/manager-account.d.ts +7 -0
  96. package/dist/types/account/manager-account.js +2 -0
  97. package/dist/types/account/scraper-account.js +2 -1
  98. package/dist/types/ai/ai-config.js +2 -1
  99. package/dist/types/ai/index.js +19 -3
  100. package/dist/types/ai/proposal.js +2 -1
  101. package/dist/types/ai/suitability.js +2 -1
  102. package/dist/types/bid/bid-result.js +2 -1
  103. package/dist/types/bid/bid.js +2 -1
  104. package/dist/types/bid/index.js +18 -2
  105. package/dist/types/bidding/index.d.ts +1 -0
  106. package/dist/types/bidding/index.js +17 -0
  107. package/dist/types/bidding/proposal-bidding-status.d.ts +3 -0
  108. package/dist/types/bidding/proposal-bidding-status.js +2 -0
  109. package/dist/types/campaign/campaign-analytics.js +2 -1
  110. package/dist/types/campaign/campaign-expenses.js +2 -1
  111. package/dist/types/campaign/campaign-insights.js +2 -1
  112. package/dist/types/campaign/campaign-integrations.js +2 -1
  113. package/dist/types/campaign/campaign-job-count.js +2 -1
  114. package/dist/types/campaign/campaign.js +2 -1
  115. package/dist/types/campaign/index.js +22 -6
  116. package/dist/types/chat-message/chat-message.js +2 -1
  117. package/dist/types/chat-message/index.js +17 -1
  118. package/dist/types/config/agency-config.js +2 -1
  119. package/dist/types/config/index.js +17 -1
  120. package/dist/types/index.js +29 -14
  121. package/dist/types/job/index.d.ts +1 -0
  122. package/dist/types/job/index.js +19 -2
  123. package/dist/types/job/job-details.d.ts +36 -0
  124. package/dist/types/job/job-details.js +2 -0
  125. package/dist/types/job/job-note.js +2 -1
  126. package/dist/types/job/job-status.js +4 -1
  127. package/dist/types/job/job.d.ts +36 -0
  128. package/dist/types/job/job.js +2 -0
  129. package/dist/types/job/nuxt.d.ts +4 -0
  130. package/dist/types/job-filters/index.js +17 -1
  131. package/dist/types/job-filters/job-filters.js +2 -1
  132. package/dist/types/logger/index.js +17 -1
  133. package/dist/types/logger/log-event.js +2 -1
  134. package/dist/types/saved-search/index.js +2 -1
  135. package/dist/types/scraper/index.js +18 -2
  136. package/dist/types/scraper/scrape-payload.js +2 -1
  137. package/dist/types/scraper/scrape-result.js +2 -1
  138. package/dist/types/time-filter/index.js +2 -1
  139. package/dist/types/upwork-account/index.d.ts +3 -0
  140. package/dist/types/upwork-account/index.js +19 -0
  141. package/dist/types/upwork-account/upwork-account-status.d.ts +3 -0
  142. package/dist/types/upwork-account/upwork-account-status.js +2 -0
  143. package/dist/types/upwork-account/upwork-business-manager-account.d.ts +7 -0
  144. package/dist/types/upwork-account/upwork-business-manager-account.js +2 -0
  145. package/dist/types/upwork-account/upwork-scraping-account.d.ts +5 -0
  146. package/dist/types/upwork-account/upwork-scraping-account.js +2 -0
  147. package/dist/types/user/index.js +2 -1
  148. package/dist/utils/index.js +17 -1
  149. package/dist/utils/try-catch.js +23 -8
  150. package/package.json +1 -1
  151. package/dist/schemas/event/index.d.ts +0 -58
  152. package/dist/types/shared.js +0 -1
@@ -1 +1,17 @@
1
- export * from "./log-event";
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);
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
- export declare const LogEventTypeEnum: z.ZodEnum<["scraperStarted", "scraperCompleted", "jobScraped", "jobScrapeFailed", "jobsIndexed", "jobDuplicateSkipped", "scraperFailed", "jobActivityScraped", "jobActivityScrapeFailed", "feedScrapeStarted", "feedScrapeCompleted", "feedScrapeFailed", "jobListingScraped", "jobSyncPublished", "jobSyncReceived", "leadsCreatedAndSynced", "suitabilityPending", "suitabilityProcessing", "suitabilityComplete", "suitabilityFailed", "manualSuitabilityAnalyzed", "proposalProcessing", "proposalComplete", "proposalFailed", "manualProposalGenerated", "biddingProcessing", "biddingComplete", "biddingFailed", "biddingSkipped", "biddingPending", "errorLogged", "cloudTaskRetry", "manualLeadEdited", "leadArchived", "auditTrailLogged", "knowledgeBaseGenerationComplete", "knowledgeBaseGenerationFailed"]>;
2
+ export declare const LogEventTypeEnum: z.ZodEnum<["scraperStarted", "scraperCompleted", "jobScraped", "jobScrapeFailed", "jobsIndexed", "jobDuplicateSkipped", "scraperFailed", "jobActivityScraped", "jobActivityScrapeFailed", "feedScrapeStarted", "feedScrapeCompleted", "feedScrapeFailed", "jobListingScraped", "jobSyncPublished", "jobSyncReceived", "leadsCreatedAndSynced", "suitabilityPending", "suitabilityProcessing", "suitabilityComplete", "suitabilityFailed", "manualSuitabilityAnalyzed", "proposalProcessing", "proposalComplete", "proposalFailed", "manualProposalGenerated", "biddingProcessing", "biddingComplete", "biddingFailed", "biddingSkipped", "biddingPending", "errorLogged", "cloudTaskRetry", "manualLeadEdited", "leadArchived", "auditTrailLogged", "knowledgeBaseGenerationComplete", "knowledgeBaseGenerationFailed", "modelFailed"]>;
3
3
  export declare const logEventSchema: z.ZodObject<{
4
- type: z.ZodEnum<["scraperStarted", "scraperCompleted", "jobScraped", "jobScrapeFailed", "jobsIndexed", "jobDuplicateSkipped", "scraperFailed", "jobActivityScraped", "jobActivityScrapeFailed", "feedScrapeStarted", "feedScrapeCompleted", "feedScrapeFailed", "jobListingScraped", "jobSyncPublished", "jobSyncReceived", "leadsCreatedAndSynced", "suitabilityPending", "suitabilityProcessing", "suitabilityComplete", "suitabilityFailed", "manualSuitabilityAnalyzed", "proposalProcessing", "proposalComplete", "proposalFailed", "manualProposalGenerated", "biddingProcessing", "biddingComplete", "biddingFailed", "biddingSkipped", "biddingPending", "errorLogged", "cloudTaskRetry", "manualLeadEdited", "leadArchived", "auditTrailLogged", "knowledgeBaseGenerationComplete", "knowledgeBaseGenerationFailed"]>;
4
+ type: z.ZodEnum<["scraperStarted", "scraperCompleted", "jobScraped", "jobScrapeFailed", "jobsIndexed", "jobDuplicateSkipped", "scraperFailed", "jobActivityScraped", "jobActivityScrapeFailed", "feedScrapeStarted", "feedScrapeCompleted", "feedScrapeFailed", "jobListingScraped", "jobSyncPublished", "jobSyncReceived", "leadsCreatedAndSynced", "suitabilityPending", "suitabilityProcessing", "suitabilityComplete", "suitabilityFailed", "manualSuitabilityAnalyzed", "proposalProcessing", "proposalComplete", "proposalFailed", "manualProposalGenerated", "biddingProcessing", "biddingComplete", "biddingFailed", "biddingSkipped", "biddingPending", "errorLogged", "cloudTaskRetry", "manualLeadEdited", "leadArchived", "auditTrailLogged", "knowledgeBaseGenerationComplete", "knowledgeBaseGenerationFailed", "modelFailed"]>;
5
5
  source: z.ZodString;
6
6
  resourceType: z.ZodDefault<z.ZodString>;
7
7
  resourceId: z.ZodNullable<z.ZodString>;
@@ -12,7 +12,7 @@ export declare const logEventSchema: z.ZodObject<{
12
12
  metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
13
13
  timestamp: z.ZodNumber;
14
14
  }, "strip", z.ZodTypeAny, {
15
- type: "scraperStarted" | "scraperCompleted" | "jobScraped" | "jobScrapeFailed" | "jobsIndexed" | "jobDuplicateSkipped" | "scraperFailed" | "jobActivityScraped" | "jobActivityScrapeFailed" | "feedScrapeStarted" | "feedScrapeCompleted" | "feedScrapeFailed" | "jobListingScraped" | "jobSyncPublished" | "jobSyncReceived" | "leadsCreatedAndSynced" | "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "manualSuitabilityAnalyzed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "manualProposalGenerated" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "biddingSkipped" | "biddingPending" | "errorLogged" | "cloudTaskRetry" | "manualLeadEdited" | "leadArchived" | "auditTrailLogged" | "knowledgeBaseGenerationComplete" | "knowledgeBaseGenerationFailed";
15
+ type: "scraperStarted" | "scraperCompleted" | "jobScraped" | "jobScrapeFailed" | "jobsIndexed" | "jobDuplicateSkipped" | "scraperFailed" | "jobActivityScraped" | "jobActivityScrapeFailed" | "feedScrapeStarted" | "feedScrapeCompleted" | "feedScrapeFailed" | "jobListingScraped" | "jobSyncPublished" | "jobSyncReceived" | "leadsCreatedAndSynced" | "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "manualSuitabilityAnalyzed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "manualProposalGenerated" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "biddingSkipped" | "biddingPending" | "errorLogged" | "cloudTaskRetry" | "manualLeadEdited" | "leadArchived" | "auditTrailLogged" | "knowledgeBaseGenerationComplete" | "knowledgeBaseGenerationFailed" | "modelFailed";
16
16
  source: string;
17
17
  resourceType: string;
18
18
  resourceId: string | null;
@@ -23,7 +23,7 @@ export declare const logEventSchema: z.ZodObject<{
23
23
  metadata: Record<string, unknown> | null;
24
24
  timestamp: number;
25
25
  }, {
26
- type: "scraperStarted" | "scraperCompleted" | "jobScraped" | "jobScrapeFailed" | "jobsIndexed" | "jobDuplicateSkipped" | "scraperFailed" | "jobActivityScraped" | "jobActivityScrapeFailed" | "feedScrapeStarted" | "feedScrapeCompleted" | "feedScrapeFailed" | "jobListingScraped" | "jobSyncPublished" | "jobSyncReceived" | "leadsCreatedAndSynced" | "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "manualSuitabilityAnalyzed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "manualProposalGenerated" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "biddingSkipped" | "biddingPending" | "errorLogged" | "cloudTaskRetry" | "manualLeadEdited" | "leadArchived" | "auditTrailLogged" | "knowledgeBaseGenerationComplete" | "knowledgeBaseGenerationFailed";
26
+ type: "scraperStarted" | "scraperCompleted" | "jobScraped" | "jobScrapeFailed" | "jobsIndexed" | "jobDuplicateSkipped" | "scraperFailed" | "jobActivityScraped" | "jobActivityScrapeFailed" | "feedScrapeStarted" | "feedScrapeCompleted" | "feedScrapeFailed" | "jobListingScraped" | "jobSyncPublished" | "jobSyncReceived" | "leadsCreatedAndSynced" | "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "manualSuitabilityAnalyzed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "manualProposalGenerated" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "biddingSkipped" | "biddingPending" | "errorLogged" | "cloudTaskRetry" | "manualLeadEdited" | "leadArchived" | "auditTrailLogged" | "knowledgeBaseGenerationComplete" | "knowledgeBaseGenerationFailed" | "modelFailed";
27
27
  source: string;
28
28
  resourceId: string | null;
29
29
  leadId: string | null;
@@ -92,6 +92,7 @@ export declare const jobActivityScrapedEventMetadata: z.ZodObject<{
92
92
  max: number | null;
93
93
  }>;
94
94
  lastViewedByClient: z.ZodNullable<z.ZodString>;
95
+ lastViewedByClientTimestamp: z.ZodNullable<z.ZodNumber>;
95
96
  hires: z.ZodNullable<z.ZodNumber>;
96
97
  interviewing: z.ZodNullable<z.ZodNumber>;
97
98
  invitesSent: z.ZodNullable<z.ZodNumber>;
@@ -103,6 +104,7 @@ export declare const jobActivityScrapedEventMetadata: z.ZodObject<{
103
104
  max: number | null;
104
105
  };
105
106
  lastViewedByClient: string | null;
107
+ lastViewedByClientTimestamp: number | null;
106
108
  hires: number | null;
107
109
  interviewing: number | null;
108
110
  invitesSent: number | null;
@@ -114,6 +116,7 @@ export declare const jobActivityScrapedEventMetadata: z.ZodObject<{
114
116
  max: number | null;
115
117
  };
116
118
  lastViewedByClient: string | null;
119
+ lastViewedByClientTimestamp: number | null;
117
120
  hires: number | null;
118
121
  interviewing: number | null;
119
122
  invitesSent: number | null;
@@ -131,6 +134,7 @@ export declare const jobActivityScrapedEventMetadata: z.ZodObject<{
131
134
  max: number | null;
132
135
  };
133
136
  lastViewedByClient: string | null;
137
+ lastViewedByClientTimestamp: number | null;
134
138
  hires: number | null;
135
139
  interviewing: number | null;
136
140
  invitesSent: number | null;
@@ -147,6 +151,7 @@ export declare const jobActivityScrapedEventMetadata: z.ZodObject<{
147
151
  max: number | null;
148
152
  };
149
153
  lastViewedByClient: string | null;
154
+ lastViewedByClientTimestamp: number | null;
150
155
  hires: number | null;
151
156
  interviewing: number | null;
152
157
  invitesSent: number | null;
@@ -1,22 +1,18 @@
1
- import { number, object, z } from "zod";
2
- import { jobActivityOffsetHourSchema, jobActivitySchema, jobListingSchema, } from "../lead";
3
- import { regionSchema } from "../shared";
4
- export const LogEventTypeEnum = z.enum([
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([
5
6
  // Scraper Events
6
7
  "scraperStarted",
7
8
  "scraperCompleted",
8
9
  "jobScraped",
9
- "jobScrapeFailed",
10
10
  "jobsIndexed",
11
11
  "jobDuplicateSkipped",
12
12
  "scraperFailed",
13
- "jobActivityScraped",
14
- "jobActivityScrapeFailed",
15
- // Feed Scraper Events
16
- "feedScrapeStarted",
17
- "feedScrapeCompleted",
18
- "feedScrapeFailed",
19
- "jobListingScraped",
13
+ "userProfileScrapingStarted",
14
+ "userProfileScrapingComplete",
15
+ "userProfileScrapingFailed",
20
16
  // Job Sync & Campaign Matching
21
17
  "jobSyncPublished",
22
18
  "jobSyncReceived",
@@ -48,38 +44,23 @@ export const LogEventTypeEnum = z.enum([
48
44
  "knowledgeBaseGenerationComplete",
49
45
  "knowledgeBaseGenerationFailed",
50
46
  ]);
51
- export const logEventSchema = z.object({
47
+ exports.logEventSchema = zod_1.z.object({
52
48
  // The type of event (use a z.enum if possible)
53
- type: LogEventTypeEnum, // e.g. "suitability-failed", "proposal-generated"
49
+ type: exports.LogEventTypeEnum, // e.g. "suitability-failed", "proposal-generated"
54
50
  // The service that triggered the event
55
- source: z.string(), // e.g. "lancer-agents", "lancer-bidding"
51
+ source: zod_1.z.string(), // e.g. "lancer-agents", "lancer-bidding"
56
52
  // Optional: Allow logging non-lead events in the future
57
- resourceType: z.string().default("lead"), // e.g. "lead", "campaign", "user"
53
+ resourceType: zod_1.z.string().default("lead"), // e.g. "lead", "campaign", "user"
58
54
  // ID of the resource (primary entity affected)
59
- resourceId: z.string().nullable(), // fallback if leadId is not applicable
55
+ resourceId: zod_1.z.string().nullable(), // fallback if leadId is not applicable
60
56
  // Lead-level metadata
61
- leadId: z.string().nullable(),
62
- campaignId: z.string().nullable(),
63
- userId: z.string().nullable(),
57
+ leadId: zod_1.z.string().nullable(),
58
+ campaignId: zod_1.z.string().nullable(),
59
+ userId: zod_1.z.string().nullable(),
64
60
  // Reason or message for the event
65
- reason: z.string().nullable(),
61
+ reason: zod_1.z.string().nullable(),
66
62
  // Generic metadata (stacktrace, score, raw request, etc.)
67
- metadata: z.record(z.unknown()).nullable(),
63
+ metadata: zod_1.z.record(zod_1.z.unknown()).nullable(),
68
64
  // Optional timestamp override
69
- timestamp: z.number(),
70
- });
71
- export const listingScrapedEventMetadata = object({
72
- listing: jobListingSchema,
73
- region: regionSchema,
74
- });
75
- export const jobActivityScrapedEventMetadata = object({
76
- activity: jobActivitySchema,
77
- region: regionSchema,
78
- offsetHour: jobActivityOffsetHourSchema,
79
- scrapedAt: number(),
80
- });
81
- export const jobActivityScrapeFailedEventMetadata = object({
82
- listing: jobListingSchema,
83
- region: regionSchema,
84
- offsetHour: jobActivityOffsetHourSchema,
65
+ timestamp: zod_1.z.number(),
85
66
  });
@@ -1 +1,17 @@
1
- export * from './organization';
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);
@@ -1,16 +1,19 @@
1
- import { z } from 'zod';
2
- export const bidConfigSchema = z.object({
3
- agencyName: z.string().nullable(),
4
- bidderId: z.string().nullable(),
5
- contractorName: z.string().nullable(),
6
- specialisedProfile: z.string().nullable(),
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(),
7
10
  });
8
- export const organizationTypeSchema = z.enum(['agency', 'freelancer']);
9
- export const organizationSchema = z.object({
10
- id: z.string(),
11
- name: z.string(),
12
- type: organizationTypeSchema,
13
- bidConfig: bidConfigSchema,
14
- createdAt: z.date(),
15
- updatedAt: z.date(),
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(),
16
19
  });
@@ -1 +1,17 @@
1
- export * from './proxy';
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);
@@ -1,18 +1,21 @@
1
- import { z } from 'zod';
2
- export const proxyProviderSchema = z.enum(['webshare']);
3
- export const proxyCountrySchema = z.enum(['USA']);
4
- export const proxySchema = z.object({
5
- id: z.string(),
6
- externalId: z.string(),
7
- host: z.string(),
8
- port: z.number(),
9
- username: z.string(),
10
- password: z.string(),
11
- provider: proxyProviderSchema,
12
- country: proxyCountrySchema,
13
- bidderId: z.string().nullable(),
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(),
14
17
  });
15
- export const externalProxySchema = proxySchema.omit({
18
+ exports.externalProxySchema = exports.proxySchema.omit({
16
19
  id: true,
17
20
  bidderId: true,
18
21
  });
@@ -1,9 +1,12 @@
1
- import { date, number, object, string } from "zod";
2
- import { booleanSchema } from "../shared";
3
- export const savedSearchSchema = object({
4
- id: number().int(),
5
- name: string(),
6
- url: string(),
7
- createdAt: date(),
8
- isActive: booleanSchema,
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,
9
12
  });
@@ -1,2 +1,18 @@
1
- export * from './scrape-payload';
2
- export * from './scrape-result';
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);
@@ -1,21 +1,16 @@
1
- import { any, array, object, string } from "zod";
2
- import { jobActivityOffsetHourSchema, jobListingSchema } from "../lead";
3
- export const scrapePayloadSchema = object({
4
- latestJobsUrls: array(string()),
5
- cookies: array(any()),
6
- username: string(),
7
- password: string(),
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(),
8
10
  });
9
- export const scrapeUserProfilePayloadSchema = object({
10
- profileUrl: string(),
11
- cookies: array(any()),
12
- username: string(),
13
- password: string(),
14
- });
15
- export const scrapeJobPayloadSchema = object({
16
- listing: jobListingSchema,
17
- });
18
- export const scrapeJobActivityPayloadSchema = object({
19
- listing: jobListingSchema,
20
- offsetHour: jobActivityOffsetHourSchema,
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(),
21
16
  });
@@ -1,6 +1,7 @@
1
1
  export declare const scrapeResultSchema: import("zod").ZodObject<{
2
2
  jobs: import("zod").ZodArray<import("zod").ZodObject<{
3
3
  id: import("zod").ZodNullable<import("zod").ZodString>;
4
+ uid: import("zod").ZodNullable<import("zod").ZodString>;
4
5
  createdAt: import("zod").ZodNullable<import("zod").ZodNumber>;
5
6
  title: import("zod").ZodNullable<import("zod").ZodString>;
6
7
  category: import("zod").ZodNullable<import("zod").ZodString>;
@@ -201,6 +202,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
201
202
  max: number | null;
202
203
  }>;
203
204
  lastViewedByClient: import("zod").ZodNullable<import("zod").ZodString>;
205
+ lastViewedByClientTimestamp: import("zod").ZodNullable<import("zod").ZodNumber>;
204
206
  hires: import("zod").ZodNullable<import("zod").ZodNumber>;
205
207
  interviewing: import("zod").ZodNullable<import("zod").ZodNumber>;
206
208
  invitesSent: import("zod").ZodNullable<import("zod").ZodNumber>;
@@ -212,6 +214,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
212
214
  max: number | null;
213
215
  };
214
216
  lastViewedByClient: string | null;
217
+ lastViewedByClientTimestamp: number | null;
215
218
  hires: number | null;
216
219
  interviewing: number | null;
217
220
  invitesSent: number | null;
@@ -223,6 +226,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
223
226
  max: number | null;
224
227
  };
225
228
  lastViewedByClient: string | null;
229
+ lastViewedByClientTimestamp: number | null;
226
230
  hires: number | null;
227
231
  interviewing: number | null;
228
232
  invitesSent: number | null;
@@ -242,6 +246,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
242
246
  max: number | null;
243
247
  }>;
244
248
  lastViewedByClient: import("zod").ZodNullable<import("zod").ZodString>;
249
+ lastViewedByClientTimestamp: import("zod").ZodNullable<import("zod").ZodNumber>;
245
250
  hires: import("zod").ZodNullable<import("zod").ZodNumber>;
246
251
  interviewing: import("zod").ZodNullable<import("zod").ZodNumber>;
247
252
  invitesSent: import("zod").ZodNullable<import("zod").ZodNumber>;
@@ -253,6 +258,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
253
258
  max: number | null;
254
259
  };
255
260
  lastViewedByClient: string | null;
261
+ lastViewedByClientTimestamp: number | null;
256
262
  hires: number | null;
257
263
  interviewing: number | null;
258
264
  invitesSent: number | null;
@@ -264,6 +270,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
264
270
  max: number | null;
265
271
  };
266
272
  lastViewedByClient: string | null;
273
+ lastViewedByClientTimestamp: number | null;
267
274
  hires: number | null;
268
275
  interviewing: number | null;
269
276
  invitesSent: number | null;
@@ -291,6 +298,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
291
298
  }>>>;
292
299
  }, "strip", import("zod").ZodTypeAny, {
293
300
  id: string | null;
301
+ uid: string | null;
294
302
  createdAt: number | null;
295
303
  title: string | null;
296
304
  category: string | null;
@@ -371,6 +379,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
371
379
  max: number | null;
372
380
  };
373
381
  lastViewedByClient: string | null;
382
+ lastViewedByClientTimestamp: number | null;
374
383
  hires: number | null;
375
384
  interviewing: number | null;
376
385
  invitesSent: number | null;
@@ -384,6 +393,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
384
393
  max: number | null;
385
394
  };
386
395
  lastViewedByClient: string | null;
396
+ lastViewedByClientTimestamp: number | null;
387
397
  hires: number | null;
388
398
  interviewing: number | null;
389
399
  invitesSent: number | null;
@@ -399,6 +409,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
399
409
  } | null | undefined;
400
410
  }, {
401
411
  id: string | null;
412
+ uid: string | null;
402
413
  createdAt: number | null;
403
414
  title: string | null;
404
415
  category: string | null;
@@ -479,6 +490,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
479
490
  max: number | null;
480
491
  };
481
492
  lastViewedByClient: string | null;
493
+ lastViewedByClientTimestamp: number | null;
482
494
  hires: number | null;
483
495
  interviewing: number | null;
484
496
  invitesSent: number | null;
@@ -492,6 +504,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
492
504
  max: number | null;
493
505
  };
494
506
  lastViewedByClient: string | null;
507
+ lastViewedByClientTimestamp: number | null;
495
508
  hires: number | null;
496
509
  interviewing: number | null;
497
510
  invitesSent: number | null;
@@ -513,6 +526,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
513
526
  }, "strip", import("zod").ZodTypeAny, {
514
527
  jobs: {
515
528
  id: string | null;
529
+ uid: string | null;
516
530
  createdAt: number | null;
517
531
  title: string | null;
518
532
  category: string | null;
@@ -593,6 +607,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
593
607
  max: number | null;
594
608
  };
595
609
  lastViewedByClient: string | null;
610
+ lastViewedByClientTimestamp: number | null;
596
611
  hires: number | null;
597
612
  interviewing: number | null;
598
613
  invitesSent: number | null;
@@ -606,6 +621,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
606
621
  max: number | null;
607
622
  };
608
623
  lastViewedByClient: string | null;
624
+ lastViewedByClientTimestamp: number | null;
609
625
  hires: number | null;
610
626
  interviewing: number | null;
611
627
  invitesSent: number | null;
@@ -627,6 +643,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
627
643
  }, {
628
644
  jobs: {
629
645
  id: string | null;
646
+ uid: string | null;
630
647
  createdAt: number | null;
631
648
  title: string | null;
632
649
  category: string | null;
@@ -707,6 +724,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
707
724
  max: number | null;
708
725
  };
709
726
  lastViewedByClient: string | null;
727
+ lastViewedByClientTimestamp: number | null;
710
728
  hires: number | null;
711
729
  interviewing: number | null;
712
730
  invitesSent: number | null;
@@ -720,6 +738,7 @@ export declare const scrapeResultSchema: import("zod").ZodObject<{
720
738
  max: number | null;
721
739
  };
722
740
  lastViewedByClient: string | null;
741
+ lastViewedByClientTimestamp: number | null;
723
742
  hires: number | null;
724
743
  interviewing: number | null;
725
744
  invitesSent: number | null;
@@ -869,19 +888,19 @@ export declare const scrapeFeedResultSchema: import("zod").ZodObject<{
869
888
  isFeatured: import("zod").ZodNullable<import("zod").ZodBoolean>;
870
889
  region: import("zod").ZodNullable<import("zod").ZodUnion<[import("zod").ZodLiteral<"USOnly">, import("zod").ZodLiteral<"UKOnly">, import("zod").ZodLiteral<"Worldwide">]>>;
871
890
  }, "strip", import("zod").ZodTypeAny, {
891
+ uid: string | null;
872
892
  title: string | null;
873
893
  datetime: string | null;
874
894
  jobUrl: string | null;
875
895
  region: "USOnly" | "UKOnly" | "Worldwide" | null;
876
896
  isFeatured: boolean | null;
877
- uid: string | null;
878
897
  }, {
898
+ uid: string | null;
879
899
  title: string | null;
880
900
  datetime: string | null;
881
901
  jobUrl: string | null;
882
902
  region: "USOnly" | "UKOnly" | "Worldwide" | null;
883
903
  isFeatured: boolean | null;
884
- uid: string | null;
885
904
  }>, "many">;
886
905
  cookies: import("zod").ZodArray<import("zod").ZodAny, "many">;
887
906
  region: import("zod").ZodUnion<[import("zod").ZodLiteral<"USOnly">, import("zod").ZodLiteral<"UKOnly">, import("zod").ZodLiteral<"Worldwide">]>;
@@ -891,12 +910,12 @@ export declare const scrapeFeedResultSchema: import("zod").ZodObject<{
891
910
  region: "USOnly" | "UKOnly" | "Worldwide";
892
911
  cookies: any[];
893
912
  listings: {
913
+ uid: string | null;
894
914
  title: string | null;
895
915
  datetime: string | null;
896
916
  jobUrl: string | null;
897
917
  region: "USOnly" | "UKOnly" | "Worldwide" | null;
898
918
  isFeatured: boolean | null;
899
- uid: string | null;
900
919
  }[];
901
920
  usAccountCookies?: any[] | undefined;
902
921
  ukAccountCookies?: any[] | undefined;
@@ -904,12 +923,12 @@ export declare const scrapeFeedResultSchema: import("zod").ZodObject<{
904
923
  region: "USOnly" | "UKOnly" | "Worldwide";
905
924
  cookies: any[];
906
925
  listings: {
926
+ uid: string | null;
907
927
  title: string | null;
908
928
  datetime: string | null;
909
929
  jobUrl: string | null;
910
930
  region: "USOnly" | "UKOnly" | "Worldwide" | null;
911
931
  isFeatured: boolean | null;
912
- uid: string | null;
913
932
  }[];
914
933
  usAccountCookies?: any[] | undefined;
915
934
  ukAccountCookies?: any[] | undefined;
@@ -1,23 +1,23 @@
1
- import { any, array, boolean, object, string } from "zod";
2
- import { jobListingSchema, upworkJobSchema } from "../lead";
3
- import { regionSchema } from "../shared";
4
- import { upworkProfileSchema } from "../user";
5
- export const scrapeResultSchema = object({
6
- jobs: array(upworkJobSchema),
7
- cookies: array(any()),
8
- region: regionSchema,
9
- usAccountCookies: array(any()).optional(),
10
- ukAccountCookies: array(any()).optional(),
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(),
11
18
  });
12
- export const scrapeUserProfileResultSchema = object({
13
- success: boolean(),
14
- message: string(),
15
- data: upworkProfileSchema,
16
- });
17
- export const scrapeFeedResultSchema = object({
18
- listings: array(jobListingSchema),
19
- cookies: array(any()),
20
- region: regionSchema,
21
- usAccountCookies: array(any()).optional(),
22
- ukAccountCookies: array(any()).optional(),
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
23
  });
@@ -1,19 +1,16 @@
1
- import { coerce, string, z } from "zod";
2
- export const booleanSchema = z
3
- .union([z.boolean(), z.literal("true"), z.literal("false")])
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")])
4
7
  .transform((value) => value === true || value === "true");
5
- export const dateSchema = (params = {}) => coerce.date({
6
- ...params,
7
- });
8
- export const passwordSchema = string()
8
+ const dateSchema = (params = {}) => zod_1.coerce.date(Object.assign({}, params));
9
+ exports.dateSchema = dateSchema;
10
+ exports.passwordSchema = (0, zod_1.string)()
9
11
  .min(8, "Password must be at least 8 characters long.")
10
12
  .max(255, "Password must be at most 255 characters long.")
11
13
  .refine((password) => /[a-z]/.test(password), "Password must contain at least one lowercase letter.")
12
14
  .refine((password) => /[A-Z]/.test(password), "Password must contain at least one uppercase letter.")
13
15
  .refine((password) => /\d/.test(password), "Password must contain at least one number.")
14
16
  .refine((password) => /[\W_]/.test(password), "Password must contain at least one symbol.");
15
- export const regionSchema = z.union([
16
- z.literal("USOnly"),
17
- z.literal("UKOnly"),
18
- z.literal("Worldwide"),
19
- ]);