lancer-shared 1.2.1 → 1.2.2
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.
- package/dist/constants/account-status.d.ts +3 -0
- package/dist/constants/account-status.js +17 -0
- package/dist/constants/collections.js +16 -0
- package/dist/constants/common-questions.js +60 -0
- package/dist/constants/index.js +40 -0
- package/dist/constants/job-filter-options.js +268 -0
- package/dist/constants/job-status.js +26 -0
- package/dist/constants/mappings/countryMapping.js +122 -0
- package/dist/constants/mappings/regionMapping.js +242 -0
- package/dist/constants/routes.js +108 -0
- package/dist/constants/upwork-accounts.js +21 -0
- package/dist/index.js +20 -0
- package/dist/schemas/account/account-status.js +11 -0
- package/dist/schemas/account/bidder-account.js +37 -0
- package/dist/schemas/account/index.js +19 -0
- package/dist/schemas/account/manager-account.d.ts +116 -0
- package/dist/schemas/account/manager-account.js +38 -0
- package/dist/schemas/account/scraper-account.js +37 -0
- package/dist/schemas/ai/ai-config.d.ts +36 -0
- package/dist/schemas/ai/ai-config.js +12 -0
- package/dist/schemas/ai/index.d.ts +3 -0
- package/dist/schemas/ai/index.js +19 -0
- package/dist/schemas/ai/proposal.d.ts +82 -0
- package/dist/schemas/ai/proposal.js +16 -0
- package/dist/schemas/ai/suitability.d.ts +37 -0
- package/dist/schemas/ai/suitability.js +17 -0
- package/dist/schemas/bid/bid-result.js +15 -0
- package/dist/schemas/bid/bid.js +36 -0
- package/dist/schemas/bid/index.js +18 -0
- package/dist/schemas/bidding/index.d.ts +1 -0
- package/dist/schemas/bidding/index.js +17 -0
- package/dist/schemas/bidding/proposal-bidding-status.d.ts +26 -0
- package/dist/schemas/bidding/proposal-bidding-status.js +18 -0
- package/dist/schemas/campaign/campaign-ai-metrics.js +9 -0
- package/dist/schemas/campaign/campaign-analytics.js +41 -0
- package/dist/schemas/campaign/campaign-expenses.js +9 -0
- package/dist/schemas/campaign/campaign-insights.js +31 -0
- package/dist/schemas/campaign/campaign-integrations.js +16 -0
- package/dist/schemas/campaign/campaign-job-count.js +6 -0
- package/dist/schemas/campaign/campaign.js +44 -0
- package/dist/schemas/campaign/index.js +23 -0
- package/dist/schemas/chat-message/chat-message.js +13 -0
- package/dist/schemas/chat-message/index.js +17 -0
- package/dist/schemas/config/agency-config.js +10 -0
- package/dist/schemas/config/index.js +17 -0
- package/dist/schemas/index.js +32 -0
- package/dist/schemas/job/index.d.ts +3 -0
- package/dist/schemas/job/index.js +19 -0
- package/dist/schemas/job/job-details.d.ts +335 -0
- package/dist/schemas/job/job-details.js +29 -0
- package/dist/schemas/job/job-note.d.ts +83 -0
- package/dist/schemas/job/job-note.js +30 -0
- package/dist/schemas/job/job-status.d.ts +3 -0
- package/dist/schemas/job/job-status.js +27 -0
- package/dist/schemas/job/job.d.ts +1160 -0
- package/dist/schemas/job/job.js +90 -0
- package/dist/schemas/job/pipeline-job.d.ts +602 -0
- package/dist/schemas/job/pipeline-job.js +42 -0
- package/dist/schemas/job/upwork-job.d.ts +334 -0
- package/dist/schemas/job/upwork-job.js +60 -0
- package/dist/schemas/job-filters/index.js +17 -0
- package/dist/schemas/job-filters/job-filters.js +87 -0
- package/dist/schemas/lead/index.js +19 -0
- package/dist/schemas/lead/lead-note.js +30 -0
- package/dist/schemas/lead/lead-status.js +26 -0
- package/dist/schemas/lead/lead.d.ts +1897 -0
- package/dist/schemas/lead/lead.js +143 -0
- package/dist/schemas/logger/index.js +17 -0
- package/dist/schemas/logger/log-event.js +66 -0
- package/dist/schemas/organization/index.js +17 -0
- package/dist/schemas/organization/organization.d.ts +13 -87
- package/dist/schemas/organization/organization.js +19 -0
- package/dist/schemas/proxy/index.js +17 -0
- package/dist/schemas/proxy/proxy.js +21 -0
- package/dist/schemas/saved-search/index.js +12 -0
- package/dist/schemas/scraper/index.js +18 -0
- package/dist/schemas/scraper/scrape-payload.js +16 -0
- package/dist/schemas/scraper/scrape-result.js +23 -0
- package/dist/schemas/shared.js +16 -0
- package/dist/schemas/time-filter/index.js +9 -0
- package/dist/schemas/upwork-account/index.d.ts +3 -0
- package/dist/schemas/upwork-account/index.js +19 -0
- package/dist/schemas/upwork-account/upwork-account-status.d.ts +2 -0
- package/dist/schemas/upwork-account/upwork-account-status.js +11 -0
- package/dist/schemas/upwork-account/upwork-business-manager-account.d.ts +95 -0
- package/dist/schemas/upwork-account/upwork-business-manager-account.js +35 -0
- package/dist/schemas/upwork-account/upwork-scraping-account.d.ts +90 -0
- package/dist/schemas/upwork-account/upwork-scraping-account.js +29 -0
- package/dist/schemas/user/index.js +55 -0
- package/dist/types/account/account-status.js +2 -0
- package/dist/types/account/bidder-account.js +2 -0
- package/dist/types/account/index.js +19 -0
- package/dist/types/account/manager-account.d.ts +7 -0
- package/dist/types/account/manager-account.js +2 -0
- package/dist/types/account/scraper-account.js +2 -0
- package/dist/types/ai/ai-config.d.ts +6 -0
- package/dist/types/ai/ai-config.js +2 -0
- package/dist/types/ai/index.d.ts +3 -0
- package/dist/types/ai/index.js +19 -0
- package/dist/types/ai/proposal.d.ts +10 -0
- package/dist/types/ai/proposal.js +2 -0
- package/dist/types/ai/suitability.d.ts +6 -0
- package/dist/types/ai/suitability.js +2 -0
- package/dist/types/bid/bid-result.js +2 -0
- package/dist/types/bid/bid.js +2 -0
- package/dist/types/bid/index.js +18 -0
- package/dist/types/bidding/index.d.ts +1 -0
- package/dist/types/bidding/index.js +17 -0
- package/dist/types/bidding/proposal-bidding-status.d.ts +3 -0
- package/dist/types/bidding/proposal-bidding-status.js +2 -0
- package/dist/types/campaign/campaign-analytics.js +2 -0
- package/dist/types/campaign/campaign-expenses.js +2 -0
- package/dist/types/campaign/campaign-insights.js +2 -0
- package/dist/types/campaign/campaign-integrations.js +2 -0
- package/dist/types/campaign/campaign-job-count.js +2 -0
- package/dist/types/campaign/campaign.js +2 -0
- package/dist/types/campaign/index.js +22 -0
- package/dist/types/chat-message/chat-message.js +2 -0
- package/dist/types/chat-message/index.js +17 -0
- package/dist/types/config/agency-config.js +2 -0
- package/dist/types/config/index.js +17 -0
- package/dist/types/index.js +29 -0
- package/dist/types/job/index.js +19 -0
- package/dist/types/job/job-details.d.ts +36 -0
- package/dist/types/job/job-details.js +2 -0
- package/dist/types/job/job-note.js +2 -0
- package/dist/types/job/job-status.js +12 -0
- package/dist/types/job/job.d.ts +36 -0
- package/dist/types/job/job.js +2 -0
- package/dist/types/job-filters/index.js +17 -0
- package/dist/types/job-filters/job-filters.js +2 -0
- package/dist/types/logger/index.js +17 -0
- package/dist/types/logger/log-event.js +2 -0
- package/dist/types/saved-search/index.js +2 -0
- package/dist/types/scraper/index.js +18 -0
- package/dist/types/scraper/scrape-payload.js +2 -0
- package/dist/types/scraper/scrape-result.js +2 -0
- package/dist/types/time-filter/index.js +2 -0
- package/dist/types/upwork-account/index.d.ts +3 -0
- package/dist/types/upwork-account/index.js +19 -0
- package/dist/types/upwork-account/upwork-account-status.d.ts +3 -0
- package/dist/types/upwork-account/upwork-account-status.js +2 -0
- package/dist/types/upwork-account/upwork-business-manager-account.d.ts +7 -0
- package/dist/types/upwork-account/upwork-business-manager-account.js +2 -0
- package/dist/types/upwork-account/upwork-scraping-account.d.ts +5 -0
- package/dist/types/upwork-account/upwork-scraping-account.js +2 -0
- package/dist/types/user/index.js +2 -0
- package/dist/utils/index.js +17 -0
- package/dist/utils/try-catch.js +25 -0
- package/package.json +2 -2
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.leadResponseSchema = exports.jobListItemSchema = exports.leadSchema = exports.upworkJobSchema = exports.metadataSchema = exports.jobActivitySchema = exports.bidRangeSchema = exports.clientReviewSchema = exports.clientInfoSchema = exports.vendorQualificationSchema = exports.jobSkillsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const lead_note_1 = require("./lead-note");
|
|
6
|
+
const lead_status_1 = require("./lead-status");
|
|
7
|
+
const proposal_1 = require("../ai/proposal");
|
|
8
|
+
const scraper_1 = require("../scraper");
|
|
9
|
+
exports.jobSkillsSchema = zod_1.z.object({
|
|
10
|
+
name: zod_1.z.string(),
|
|
11
|
+
});
|
|
12
|
+
exports.vendorQualificationSchema = zod_1.z.object({
|
|
13
|
+
location: zod_1.z.string().nullable(),
|
|
14
|
+
talentType: zod_1.z.enum(["Agency", "Independent", "unspecified"]).nullable(),
|
|
15
|
+
englishLevel: zod_1.z.string().nullable(),
|
|
16
|
+
minimumEarnings: zod_1.z.number().nullable(),
|
|
17
|
+
jobSuccessScore: zod_1.z.string().nullable(),
|
|
18
|
+
includeRisingTalent: zod_1.z.string().nullable(),
|
|
19
|
+
});
|
|
20
|
+
exports.clientInfoSchema = zod_1.z.object({
|
|
21
|
+
isPaymentVerified: zod_1.z.boolean().nullable(),
|
|
22
|
+
isPhoneVerified: zod_1.z.boolean().nullable(),
|
|
23
|
+
numberOfReviews: zod_1.z.number().nullable(),
|
|
24
|
+
rating: zod_1.z.number().nullable(),
|
|
25
|
+
country: zod_1.z.string().nullable(),
|
|
26
|
+
region: zod_1.z.string().nullable(),
|
|
27
|
+
jobsPosted: zod_1.z.number().nullable(),
|
|
28
|
+
totalSpent: zod_1.z.number().nullable(),
|
|
29
|
+
numberOfHires: zod_1.z.number().nullable(),
|
|
30
|
+
activeEngagements: zod_1.z.number().nullable(),
|
|
31
|
+
openJobs: zod_1.z.number().nullable(),
|
|
32
|
+
hireRate: zod_1.z.number().nullable(),
|
|
33
|
+
memberSince: zod_1.z.string().nullable(),
|
|
34
|
+
companyIndustry: zod_1.z.string().nullable(),
|
|
35
|
+
companySize: zod_1.z.string().nullable(),
|
|
36
|
+
enterpriseClient: zod_1.z.boolean().nullable(),
|
|
37
|
+
avgHourlyRatePaid: zod_1.z.number().nullable(),
|
|
38
|
+
});
|
|
39
|
+
exports.clientReviewSchema = zod_1.z.object({
|
|
40
|
+
jobTitle: zod_1.z.string().nullable(),
|
|
41
|
+
freelancerName: zod_1.z.string().nullable(),
|
|
42
|
+
freelancerRating: zod_1.z.number().nullable(),
|
|
43
|
+
freelancerFeedback: zod_1.z.string().nullable(),
|
|
44
|
+
clientFeedback: zod_1.z.string().nullable(),
|
|
45
|
+
clientFeedbackRating: zod_1.z.number().nullable(),
|
|
46
|
+
dateRange: zod_1.z.string().nullable(),
|
|
47
|
+
paymentType: zod_1.z.string().nullable(),
|
|
48
|
+
fixedPrice: zod_1.z.number().nullable(),
|
|
49
|
+
hourlyRate: zod_1.z.number().nullable(),
|
|
50
|
+
numHours: zod_1.z.number().nullable(),
|
|
51
|
+
totalBilled: zod_1.z.number().nullable(),
|
|
52
|
+
});
|
|
53
|
+
exports.bidRangeSchema = zod_1.z.object({
|
|
54
|
+
high: zod_1.z.number().nullable(),
|
|
55
|
+
avg: zod_1.z.number().nullable(),
|
|
56
|
+
low: zod_1.z.number().nullable(),
|
|
57
|
+
});
|
|
58
|
+
exports.jobActivitySchema = zod_1.z.object({
|
|
59
|
+
proposals: zod_1.z.object({
|
|
60
|
+
min: zod_1.z.number().nullable(),
|
|
61
|
+
max: zod_1.z.number().nullable(),
|
|
62
|
+
}),
|
|
63
|
+
lastViewedByClient: zod_1.z.string().nullable(),
|
|
64
|
+
hires: zod_1.z.number().nullable(),
|
|
65
|
+
interviewing: zod_1.z.number().nullable(),
|
|
66
|
+
invitesSent: zod_1.z.number().nullable(),
|
|
67
|
+
unansweredInvites: zod_1.z.number().nullable(),
|
|
68
|
+
updatedAt: zod_1.z.number().nullable(),
|
|
69
|
+
});
|
|
70
|
+
exports.metadataSchema = zod_1.z.object({
|
|
71
|
+
hours: zod_1.z.string().nullable(),
|
|
72
|
+
duration: zod_1.z.string().nullable(),
|
|
73
|
+
experienceLevel: zod_1.z.string().nullable(),
|
|
74
|
+
hourlyRate: zod_1.z
|
|
75
|
+
.object({
|
|
76
|
+
min: zod_1.z.number().nullable(),
|
|
77
|
+
max: zod_1.z.number().nullable(),
|
|
78
|
+
})
|
|
79
|
+
.nullable(),
|
|
80
|
+
paymentType: zod_1.z.string().nullable(),
|
|
81
|
+
fixedPrice: zod_1.z.number().nullable(),
|
|
82
|
+
});
|
|
83
|
+
exports.upworkJobSchema = zod_1.z.object({
|
|
84
|
+
id: zod_1.z.string().nullable(),
|
|
85
|
+
createdAt: zod_1.z.number().nullable(),
|
|
86
|
+
title: zod_1.z.string().nullable(),
|
|
87
|
+
category: zod_1.z.string().nullable(),
|
|
88
|
+
skills: zod_1.z.array(exports.jobSkillsSchema).nullable(),
|
|
89
|
+
datetime: zod_1.z.number().nullable(),
|
|
90
|
+
description: zod_1.z.string().nullable(),
|
|
91
|
+
descriptionLength: zod_1.z.number().nullable(),
|
|
92
|
+
connectsRequired: zod_1.z.number().nullable(),
|
|
93
|
+
projectType: zod_1.z.string().nullable(),
|
|
94
|
+
projectDuration: zod_1.z.string().nullable(),
|
|
95
|
+
questions: zod_1.z.array(zod_1.z.string()).nullable(),
|
|
96
|
+
jobUrl: zod_1.z.string().nullable(),
|
|
97
|
+
metadata: exports.metadataSchema.nullable(),
|
|
98
|
+
clientInfo: exports.clientInfoSchema.nullable(),
|
|
99
|
+
vendorQualifications: exports.vendorQualificationSchema.nullable(),
|
|
100
|
+
processed: (0, zod_1.boolean)().nullable(),
|
|
101
|
+
isFeatured: (0, zod_1.boolean)().nullable(),
|
|
102
|
+
clientReviews: zod_1.z.array(exports.clientReviewSchema).nullable(),
|
|
103
|
+
region: scraper_1.regionSchema.nullable(),
|
|
104
|
+
bidRange: exports.bidRangeSchema.nullable(),
|
|
105
|
+
jobActivity: exports.jobActivitySchema.nullable(),
|
|
106
|
+
activityUpdates: zod_1.z
|
|
107
|
+
// 1 = First scraping, 2 = After 4h, 3 = After 24h
|
|
108
|
+
.union([zod_1.z.literal(1), zod_1.z.literal(2), zod_1.z.literal(3)])
|
|
109
|
+
.nullable(),
|
|
110
|
+
});
|
|
111
|
+
exports.leadSchema = exports.upworkJobSchema
|
|
112
|
+
.extend({
|
|
113
|
+
jobId: zod_1.z.string(),
|
|
114
|
+
updatedAt: zod_1.z.number().nullable(),
|
|
115
|
+
suitabilityRating: zod_1.z.number().nullable(),
|
|
116
|
+
suitabilityReason: zod_1.z.string().nullable(),
|
|
117
|
+
proposal: zod_1.z.string().nullable(),
|
|
118
|
+
questionAnswerPairs: zod_1.z.array(proposal_1.questionAnswerPairSchema).nullable(),
|
|
119
|
+
agentStatus: lead_status_1.agentStatusSchema.nullable(),
|
|
120
|
+
leadStatus: lead_status_1.leadStatusSchema.nullable(),
|
|
121
|
+
notes: zod_1.z.array(lead_note_1.leadNoteSchema).nullable(),
|
|
122
|
+
biddingAmount: (0, zod_1.number)().nullable(),
|
|
123
|
+
boosted: (0, zod_1.boolean)().nullable(),
|
|
124
|
+
boostingAmount: (0, zod_1.number)().nullable(),
|
|
125
|
+
biddingTaskScheduled: (0, zod_1.boolean)().nullable(),
|
|
126
|
+
scheduledBiddingTime: (0, zod_1.number)().nullable(),
|
|
127
|
+
})
|
|
128
|
+
.omit({
|
|
129
|
+
processed: true,
|
|
130
|
+
});
|
|
131
|
+
exports.jobListItemSchema = zod_1.z.object({
|
|
132
|
+
title: zod_1.z.string().nullable(),
|
|
133
|
+
jobUrl: zod_1.z.string().nullable(),
|
|
134
|
+
datetime: zod_1.z.string().nullable(),
|
|
135
|
+
isFeatured: zod_1.z.boolean().nullable(),
|
|
136
|
+
region: scraper_1.regionSchema.nullable(),
|
|
137
|
+
});
|
|
138
|
+
exports.leadResponseSchema = zod_1.z.object({
|
|
139
|
+
leads: zod_1.z.array(exports.leadSchema),
|
|
140
|
+
nextCursor: zod_1.z.string().nullable(),
|
|
141
|
+
hasMore: zod_1.z.boolean(),
|
|
142
|
+
leadCounts: zod_1.z.number().nullable(),
|
|
143
|
+
});
|
|
@@ -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);
|
|
@@ -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);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export declare const bidConfigSchema: z.ZodObject<{
|
|
3
3
|
agencyName: z.ZodNullable<z.ZodString>;
|
|
4
4
|
bidderId: z.ZodNullable<z.ZodString>;
|
|
@@ -6,13 +6,13 @@ export declare const bidConfigSchema: z.ZodObject<{
|
|
|
6
6
|
specialisedProfile: z.ZodNullable<z.ZodString>;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
8
|
agencyName: string | null;
|
|
9
|
-
contractorName: string | null;
|
|
10
9
|
bidderId: string | null;
|
|
10
|
+
contractorName: string | null;
|
|
11
11
|
specialisedProfile: string | null;
|
|
12
12
|
}, {
|
|
13
13
|
agencyName: string | null;
|
|
14
|
-
contractorName: string | null;
|
|
15
14
|
bidderId: string | null;
|
|
15
|
+
contractorName: string | null;
|
|
16
16
|
specialisedProfile: string | null;
|
|
17
17
|
}>;
|
|
18
18
|
export declare const organizationTypeSchema: z.ZodEnum<["agency", "freelancer"]>;
|
|
@@ -27,118 +27,44 @@ export declare const organizationSchema: z.ZodObject<{
|
|
|
27
27
|
specialisedProfile: z.ZodNullable<z.ZodString>;
|
|
28
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
29
|
agencyName: string | null;
|
|
30
|
-
contractorName: string | null;
|
|
31
30
|
bidderId: string | null;
|
|
31
|
+
contractorName: string | null;
|
|
32
32
|
specialisedProfile: string | null;
|
|
33
33
|
}, {
|
|
34
34
|
agencyName: string | null;
|
|
35
|
-
contractorName: string | null;
|
|
36
35
|
bidderId: string | null;
|
|
36
|
+
contractorName: string | null;
|
|
37
37
|
specialisedProfile: string | null;
|
|
38
38
|
}>;
|
|
39
39
|
createdAt: z.ZodDate;
|
|
40
40
|
updatedAt: z.ZodDate;
|
|
41
41
|
}, "strip", z.ZodTypeAny, {
|
|
42
|
-
id: string;
|
|
43
42
|
type: "agency" | "freelancer";
|
|
44
|
-
|
|
45
|
-
updatedAt: Date;
|
|
43
|
+
id: string;
|
|
46
44
|
name: string;
|
|
47
45
|
bidConfig: {
|
|
48
46
|
agencyName: string | null;
|
|
49
|
-
contractorName: string | null;
|
|
50
47
|
bidderId: string | null;
|
|
48
|
+
contractorName: string | null;
|
|
51
49
|
specialisedProfile: string | null;
|
|
52
50
|
};
|
|
53
|
-
}, {
|
|
54
|
-
id: string;
|
|
55
|
-
type: "agency" | "freelancer";
|
|
56
51
|
createdAt: Date;
|
|
57
52
|
updatedAt: Date;
|
|
53
|
+
}, {
|
|
54
|
+
type: "agency" | "freelancer";
|
|
55
|
+
id: string;
|
|
58
56
|
name: string;
|
|
59
57
|
bidConfig: {
|
|
60
58
|
agencyName: string | null;
|
|
61
|
-
contractorName: string | null;
|
|
62
59
|
bidderId: string | null;
|
|
60
|
+
contractorName: string | null;
|
|
63
61
|
specialisedProfile: string | null;
|
|
64
62
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
suitabilityRules: z.ZodNullable<z.ZodString>;
|
|
68
|
-
coverLetterRules: z.ZodNullable<z.ZodString>;
|
|
69
|
-
questionRules: z.ZodNullable<z.ZodString>;
|
|
70
|
-
}, "strip", z.ZodTypeAny, {
|
|
71
|
-
suitabilityRules: string | null;
|
|
72
|
-
questionRules: string | null;
|
|
73
|
-
coverLetterRules: string | null;
|
|
74
|
-
}, {
|
|
75
|
-
suitabilityRules: string | null;
|
|
76
|
-
questionRules: string | null;
|
|
77
|
-
coverLetterRules: string | null;
|
|
78
|
-
}>;
|
|
79
|
-
export declare const knowledgeBaseSchema: z.ZodObject<{
|
|
80
|
-
about: z.ZodString;
|
|
81
|
-
caseStudies: z.ZodString;
|
|
82
|
-
}, "strip", z.ZodTypeAny, {
|
|
83
|
-
about: string;
|
|
84
|
-
caseStudies: string;
|
|
85
|
-
}, {
|
|
86
|
-
about: string;
|
|
87
|
-
caseStudies: string;
|
|
88
|
-
}>;
|
|
89
|
-
export declare const organizationSettingsSchema: z.ZodObject<{
|
|
90
|
-
aiConfig: z.ZodObject<{
|
|
91
|
-
suitabilityRules: z.ZodNullable<z.ZodString>;
|
|
92
|
-
coverLetterRules: z.ZodNullable<z.ZodString>;
|
|
93
|
-
questionRules: z.ZodNullable<z.ZodString>;
|
|
94
|
-
}, "strip", z.ZodTypeAny, {
|
|
95
|
-
suitabilityRules: string | null;
|
|
96
|
-
questionRules: string | null;
|
|
97
|
-
coverLetterRules: string | null;
|
|
98
|
-
}, {
|
|
99
|
-
suitabilityRules: string | null;
|
|
100
|
-
questionRules: string | null;
|
|
101
|
-
coverLetterRules: string | null;
|
|
102
|
-
}>;
|
|
103
|
-
knowledgeBase: z.ZodObject<{
|
|
104
|
-
about: z.ZodString;
|
|
105
|
-
caseStudies: z.ZodString;
|
|
106
|
-
}, "strip", z.ZodTypeAny, {
|
|
107
|
-
about: string;
|
|
108
|
-
caseStudies: string;
|
|
109
|
-
}, {
|
|
110
|
-
about: string;
|
|
111
|
-
caseStudies: string;
|
|
112
|
-
}>;
|
|
113
|
-
}, "strip", z.ZodTypeAny, {
|
|
114
|
-
aiConfig: {
|
|
115
|
-
suitabilityRules: string | null;
|
|
116
|
-
questionRules: string | null;
|
|
117
|
-
coverLetterRules: string | null;
|
|
118
|
-
};
|
|
119
|
-
knowledgeBase: {
|
|
120
|
-
about: string;
|
|
121
|
-
caseStudies: string;
|
|
122
|
-
};
|
|
123
|
-
}, {
|
|
124
|
-
aiConfig: {
|
|
125
|
-
suitabilityRules: string | null;
|
|
126
|
-
questionRules: string | null;
|
|
127
|
-
coverLetterRules: string | null;
|
|
128
|
-
};
|
|
129
|
-
knowledgeBase: {
|
|
130
|
-
about: string;
|
|
131
|
-
caseStudies: string;
|
|
132
|
-
};
|
|
63
|
+
createdAt: Date;
|
|
64
|
+
updatedAt: Date;
|
|
133
65
|
}>;
|
|
134
66
|
export interface Organization extends z.infer<typeof organizationSchema> {
|
|
135
67
|
}
|
|
136
|
-
export interface AiConfig extends z.infer<typeof aiConfigSchema> {
|
|
137
|
-
}
|
|
138
|
-
export interface KnowledgeBase extends z.infer<typeof knowledgeBaseSchema> {
|
|
139
|
-
}
|
|
140
|
-
export interface OrganizationSettings extends z.infer<typeof organizationSettingsSchema> {
|
|
141
|
-
}
|
|
142
68
|
export interface BidConfig extends z.infer<typeof bidConfigSchema> {
|
|
143
69
|
}
|
|
144
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);
|
|
@@ -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
|
+
});
|
|
@@ -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,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,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
|
+
]);
|