lancer-shared 1.2.14 → 1.2.16

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 (128) hide show
  1. package/dist/bundle.cjs.js +548 -358
  2. package/dist/constants/collections.js +14 -0
  3. package/dist/constants/common-questions.js +57 -0
  4. package/dist/constants/index.js +18 -0
  5. package/dist/constants/job-filter-options.js +265 -0
  6. package/dist/constants/job-status.js +21 -0
  7. package/dist/constants/mappings/countryMapping.js +120 -0
  8. package/dist/constants/mappings/regionMapping.js +240 -0
  9. package/dist/constants/organization.d.ts +2 -2
  10. package/dist/constants/routes.d.ts +14 -1
  11. package/dist/constants/routes.js +116 -0
  12. package/dist/constants/upwork-accounts.js +18 -0
  13. package/dist/index.js +4 -0
  14. package/dist/schemas/account/account-status.js +8 -0
  15. package/dist/schemas/account/bidder-account.js +35 -0
  16. package/dist/schemas/account/index.js +3 -0
  17. package/dist/schemas/account/scraper-account.js +34 -0
  18. package/dist/schemas/agent/index.d.ts +20 -10
  19. package/dist/schemas/ai/ai-config.d.ts +36 -0
  20. package/dist/schemas/ai/ai-config.js +9 -0
  21. package/dist/schemas/ai/index.d.ts +3 -0
  22. package/dist/schemas/ai/index.js +3 -0
  23. package/dist/schemas/ai/proposal.d.ts +82 -0
  24. package/dist/schemas/ai/proposal.js +13 -0
  25. package/dist/schemas/ai/suitability.d.ts +37 -0
  26. package/dist/schemas/ai/suitability.js +14 -0
  27. package/dist/schemas/bid/bid-result.js +11 -0
  28. package/dist/schemas/bid/bid.js +35 -0
  29. package/dist/schemas/bid/index.js +2 -0
  30. package/dist/schemas/campaign/campaign-ai-metrics.js +6 -0
  31. package/dist/schemas/campaign/campaign-analytics.d.ts +60 -12
  32. package/dist/schemas/campaign/campaign-analytics.js +42 -0
  33. package/dist/schemas/campaign/campaign-expenses.js +6 -0
  34. package/dist/schemas/campaign/campaign-insights.js +31 -0
  35. package/dist/schemas/campaign/campaign-integrations.js +13 -0
  36. package/dist/schemas/campaign/campaign-job-count.js +3 -0
  37. package/dist/schemas/campaign/campaign.d.ts +9 -9
  38. package/dist/schemas/campaign/campaign.js +41 -0
  39. package/dist/schemas/campaign/index.js +7 -0
  40. package/dist/schemas/chat-message/chat-message.js +10 -0
  41. package/dist/schemas/chat-message/index.js +1 -0
  42. package/dist/schemas/config/agency-config.js +7 -0
  43. package/dist/schemas/config/index.js +1 -0
  44. package/dist/schemas/event/index.d.ts +58 -0
  45. package/dist/schemas/index.d.ts +6 -4
  46. package/dist/schemas/index.js +17 -0
  47. package/dist/schemas/invoice/index.d.ts +253 -0
  48. package/dist/schemas/job-filters/index.js +1 -0
  49. package/dist/schemas/job-filters/job-filters.js +84 -0
  50. package/dist/schemas/lead/index.js +173 -0
  51. package/dist/schemas/lead/lead-note.js +27 -0
  52. package/dist/schemas/lead/lead-status.js +23 -0
  53. package/dist/schemas/lead/nuxt.js +287 -0
  54. package/dist/schemas/logger/index.js +1 -0
  55. package/dist/schemas/logger/log-event.js +117 -0
  56. package/dist/schemas/organization/billing.d.ts +51 -0
  57. package/dist/schemas/organization/index.d.ts +234 -70
  58. package/dist/schemas/organization/index.js +70 -0
  59. package/dist/schemas/organization/member.js +7 -0
  60. package/dist/schemas/organization/organization.d.ts +118 -22
  61. package/dist/schemas/organization/organization.js +16 -0
  62. package/dist/schemas/organization/subscription.d.ts +132 -15
  63. package/dist/schemas/organization/subscription.js +17 -0
  64. package/dist/schemas/plan/index.d.ts +120 -0
  65. package/dist/schemas/proxy/index.js +3 -0
  66. package/dist/schemas/proxy/proxy-available-replacements.js +3 -0
  67. package/dist/schemas/proxy/proxy-country.js +249 -0
  68. package/dist/schemas/proxy/proxy.js +29 -0
  69. package/dist/schemas/saved-search/index.js +9 -0
  70. package/dist/schemas/scraper/index.js +2 -0
  71. package/dist/schemas/scraper/scrape-payload.d.ts +164 -47
  72. package/dist/schemas/scraper/scrape-payload.js +21 -0
  73. package/dist/schemas/scraper/scrape-result.js +23 -0
  74. package/dist/schemas/shared.js +19 -0
  75. package/dist/schemas/tier/index.d.ts +119 -0
  76. package/dist/schemas/time-filter/index.js +6 -0
  77. package/dist/schemas/transaction/index.d.ts +82 -13
  78. package/dist/schemas/transaction/index.js +17 -0
  79. package/dist/schemas/usage/index.js +18 -0
  80. package/dist/schemas/user/index.js +52 -0
  81. package/dist/types/account/account-status.js +1 -0
  82. package/dist/types/account/bidder-account.js +1 -0
  83. package/dist/types/account/index.js +3 -0
  84. package/dist/types/account/scraper-account.js +1 -0
  85. package/dist/types/ai/ai-config.d.ts +6 -0
  86. package/dist/types/ai/ai-config.js +1 -0
  87. package/dist/types/ai/index.d.ts +3 -0
  88. package/dist/types/ai/index.js +3 -0
  89. package/dist/types/ai/proposal.d.ts +10 -0
  90. package/dist/types/ai/proposal.js +1 -0
  91. package/dist/types/ai/suitability.d.ts +6 -0
  92. package/dist/types/ai/suitability.js +1 -0
  93. package/dist/types/bid/bid-result.js +1 -0
  94. package/dist/types/bid/bid.js +1 -0
  95. package/dist/types/bid/index.js +2 -0
  96. package/dist/types/campaign/campaign-analytics.js +1 -0
  97. package/dist/types/campaign/campaign-expenses.js +1 -0
  98. package/dist/types/campaign/campaign-insights.js +1 -0
  99. package/dist/types/campaign/campaign-integrations.js +1 -0
  100. package/dist/types/campaign/campaign-job-count.js +1 -0
  101. package/dist/types/campaign/campaign.js +1 -0
  102. package/dist/types/campaign/index.js +6 -0
  103. package/dist/types/chat-message/chat-message.js +1 -0
  104. package/dist/types/chat-message/index.js +1 -0
  105. package/dist/types/config/agency-config.js +1 -0
  106. package/dist/types/config/index.js +1 -0
  107. package/dist/types/index.js +15 -0
  108. package/dist/types/job/index.js +3 -0
  109. package/dist/types/job/job-note.js +1 -0
  110. package/dist/types/job/job-status.js +9 -0
  111. package/dist/types/job/nuxt.js +1 -0
  112. package/dist/types/job-filters/index.js +1 -0
  113. package/dist/types/job-filters/job-filters.js +1 -0
  114. package/dist/types/logger/index.js +1 -0
  115. package/dist/types/logger/log-event.js +1 -0
  116. package/dist/types/saved-search/index.js +1 -0
  117. package/dist/types/scraper/index.js +2 -0
  118. package/dist/types/scraper/scrape-payload.js +1 -0
  119. package/dist/types/scraper/scrape-result.js +1 -0
  120. package/dist/types/shared.js +1 -0
  121. package/dist/types/time-filter/index.js +1 -0
  122. package/dist/types/transaction/index.js +1 -0
  123. package/dist/types/usage/index.js +1 -0
  124. package/dist/types/user/index.js +1 -0
  125. package/dist/utils/index.js +1 -0
  126. package/dist/utils/shared.d.ts +1 -0
  127. package/dist/utils/try-catch.js +10 -0
  128. package/package.json +2 -2
@@ -0,0 +1,240 @@
1
+ const regionMapping = {
2
+ Africa: [
3
+ "Algeria",
4
+ "Angola",
5
+ "Benin",
6
+ "Botswana",
7
+ "Burkina Faso",
8
+ "Burundi",
9
+ "Cabo Verde",
10
+ "Cameroon",
11
+ "Central African Republic",
12
+ "Chad",
13
+ "Comoros",
14
+ "Congo",
15
+ "Congo, the Democratic Republic of the",
16
+ "Cote d'Ivoire",
17
+ "Djibouti",
18
+ "Egypt",
19
+ "Equatorial Guinea",
20
+ "Eritrea",
21
+ "Eswatini",
22
+ "Ethiopia",
23
+ "Gabon",
24
+ "Gambia",
25
+ "Ghana",
26
+ "Guinea",
27
+ "Guinea-Bissau",
28
+ "Kenya",
29
+ "Lesotho",
30
+ "Liberia",
31
+ "Libya",
32
+ "Madagascar",
33
+ "Malawi",
34
+ "Mali",
35
+ "Mauritania",
36
+ "Mauritius",
37
+ "Morocco",
38
+ "Mozambique",
39
+ "Namibia",
40
+ "Niger",
41
+ "Nigeria",
42
+ "Rwanda",
43
+ "Sao Tome and Principe",
44
+ "Senegal",
45
+ "Seychelles",
46
+ "Sierra Leone",
47
+ "Somalia",
48
+ "South Africa",
49
+ "South Sudan",
50
+ "Sudan",
51
+ "Tanzania",
52
+ "Togo",
53
+ "Tunisia",
54
+ "Uganda",
55
+ "Zambia",
56
+ "Zimbabwe",
57
+ ],
58
+ Americas: [
59
+ "Anguilla",
60
+ "Antigua and Barbuda",
61
+ "Argentina",
62
+ "Aruba",
63
+ "Bahamas",
64
+ "Barbados",
65
+ "Belize",
66
+ "Bermuda",
67
+ "Bolivia",
68
+ "Brazil",
69
+ "British Virgin Islands",
70
+ "Canada",
71
+ "Cayman Islands",
72
+ "Chile",
73
+ "Colombia",
74
+ "Costa Rica",
75
+ "Cuba",
76
+ "Curacao",
77
+ "Dominica",
78
+ "Dominican Republic",
79
+ "Ecuador",
80
+ "El Salvador",
81
+ "Falkland Islands",
82
+ "French Guiana",
83
+ "Grenada",
84
+ "Guadeloupe",
85
+ "Guatemala",
86
+ "Guyana",
87
+ "Haiti",
88
+ "Honduras",
89
+ "Jamaica",
90
+ "Martinique",
91
+ "Mexico",
92
+ "Montserrat",
93
+ "Nicaragua",
94
+ "Panama",
95
+ "Paraguay",
96
+ "Peru",
97
+ "Puerto Rico",
98
+ "Saint Kitts and Nevis",
99
+ "Saint Lucia",
100
+ "Saint Vincent and the Grenadines",
101
+ "Suriname",
102
+ "Trinidad and Tobago",
103
+ "Turks and Caicos Islands",
104
+ "United States",
105
+ "United States Virgin Islands",
106
+ "Uruguay",
107
+ "Venezuela",
108
+ ],
109
+ Antarctica: ["French Southern And Antarctic Lands"],
110
+ Asia: [
111
+ "Afghanistan",
112
+ "Armenia",
113
+ "Azerbaijan",
114
+ "Bahrain",
115
+ "Bangladesh",
116
+ "Bhutan",
117
+ "Brunei Darussalam",
118
+ "Cambodia",
119
+ "China",
120
+ "East Timor",
121
+ "Georgia",
122
+ "Hong Kong",
123
+ "India",
124
+ "Indonesia",
125
+ "Iran",
126
+ "Iraq",
127
+ "Israel",
128
+ "Japan",
129
+ "Jordan",
130
+ "Kazakhstan",
131
+ "Kuwait",
132
+ "Kyrgyzstan",
133
+ "Laos",
134
+ "Lebanon",
135
+ "Macao",
136
+ "Malaysia",
137
+ "Maldives",
138
+ "Mongolia",
139
+ "Myanmar",
140
+ "Nepal",
141
+ "Palestine",
142
+ "Oman",
143
+ "Pakistan",
144
+ "Palestinian Territories",
145
+ "Philippines",
146
+ "Qatar",
147
+ "Russia",
148
+ "Saudi Arabia",
149
+ "Singapore",
150
+ "South Korea",
151
+ "Sri Lanka",
152
+ "Syria",
153
+ "Taiwan",
154
+ "Tajikistan",
155
+ "Turkey",
156
+ "Thailand",
157
+ "Turkmenistan",
158
+ "United Arab Emirates",
159
+ "Uzbekistan",
160
+ "Vietnam",
161
+ "Yemen",
162
+ ],
163
+ Europe: [
164
+ "Albania",
165
+ "Andorra",
166
+ "Austria",
167
+ "Belarus",
168
+ "Belgium",
169
+ "Bosnia and Herzegovina",
170
+ "Bulgaria",
171
+ "Croatia",
172
+ "Cyprus",
173
+ "Czech Republic",
174
+ "Denmark",
175
+ "Estonia",
176
+ "Faroe Islands",
177
+ "Finland",
178
+ "France",
179
+ "Germany",
180
+ "Gibraltar",
181
+ "Greece",
182
+ "Guernsey",
183
+ "Hungary",
184
+ "Iceland",
185
+ "Ireland",
186
+ "Isle of Man",
187
+ "Italy",
188
+ "Jersey",
189
+ "Latvia",
190
+ "Liechtenstein",
191
+ "Lithuania",
192
+ "Luxembourg",
193
+ "Malta",
194
+ "Moldova",
195
+ "Monaco",
196
+ "Montenegro",
197
+ "Netherlands",
198
+ "Macedonia",
199
+ "Norway",
200
+ "Poland",
201
+ "Portugal",
202
+ "Romania",
203
+ "San Marino",
204
+ "Serbia",
205
+ "Slovakia",
206
+ "Slovenia",
207
+ "Spain",
208
+ "Sweden",
209
+ "Switzerland",
210
+ "Ukraine",
211
+ "United Kingdom",
212
+ "Vatican City",
213
+ ],
214
+ Oceania: [
215
+ "American Samoa",
216
+ "Australia",
217
+ "Cook Islands",
218
+ "Fiji",
219
+ "French Polynesia",
220
+ "Guam",
221
+ "Kiribati",
222
+ "Marshall Islands",
223
+ "Micronesia",
224
+ "Nauru",
225
+ "New Caledonia",
226
+ "New Zealand",
227
+ "Niue",
228
+ "Northern Mariana Islands",
229
+ "Palau",
230
+ "Papua New Guinea",
231
+ "Samoa",
232
+ "Solomon Islands",
233
+ "Tokelau",
234
+ "Tonga",
235
+ "Tuvalu",
236
+ "Vanuatu",
237
+ "Wallis and Futuna",
238
+ ],
239
+ };
240
+ export default regionMapping;
@@ -1,2 +1,2 @@
1
- import { CreditDeductionEventType } from "../schemas";
2
- export declare const creditDeductionAmountMap: Record<CreditDeductionEventType, number>;
1
+ import { TrackUsageEventType } from "../schemas";
2
+ export declare const creditDeductionAmountMap: Record<TrackUsageEventType, number>;
@@ -95,7 +95,8 @@ export declare const ROUTES: {
95
95
  readonly SETTINGS: (id: string) => string;
96
96
  readonly CHARGES: (id: string) => string;
97
97
  readonly PAYMENT_METHODS: (id: string) => string;
98
- readonly DEDUCT_CREDITS: (id: string) => string;
98
+ readonly TRACK_USAGE: (id: string) => string;
99
+ readonly SUBSCRIBE: (id: string) => string;
99
100
  readonly CAMPAIGNS: {
100
101
  readonly BASE: (organizationId: string) => string;
101
102
  readonly BY_ID: (organizationId: string, campaignId: string) => string;
@@ -151,6 +152,14 @@ export declare const ROUTES: {
151
152
  readonly BY_DATE: (organizationId: string, date: Date | Moment | string) => string;
152
153
  };
153
154
  };
155
+ readonly INVOICES: {
156
+ readonly BASE: (organizationId: string) => string;
157
+ readonly BY_ID: (organizationId: string, invoiceId: string) => string;
158
+ };
159
+ readonly USERS: {
160
+ readonly BASE: (id: string) => string;
161
+ readonly BY_ID: (organizationId: string, userId: string) => string;
162
+ };
154
163
  };
155
164
  readonly TRANSACTIONS: {
156
165
  readonly BASE: "transactions";
@@ -167,6 +176,10 @@ export declare const ROUTES: {
167
176
  readonly BASE: "bidders";
168
177
  readonly BY_ID: (id: string) => string;
169
178
  };
179
+ readonly PLANS: {
180
+ readonly BASE: "plans";
181
+ readonly BY_ID: (id: string) => string;
182
+ };
170
183
  };
171
184
  export type RouteParams = {
172
185
  id?: string;
@@ -0,0 +1,116 @@
1
+ export const ROUTES = {
2
+ AUTH: {
3
+ BASE: "auth",
4
+ REGISTER: "auth/register",
5
+ },
6
+ EVENTS: {
7
+ BASE: "events",
8
+ BY_ID: (id) => `events/${id}`,
9
+ },
10
+ CAMPAIGNS: {
11
+ BASE: "campaigns",
12
+ BY_ID: (id) => `campaigns/${id}`,
13
+ LEADS: {
14
+ BASE: (campaignId) => `campaigns/${campaignId}/leads`,
15
+ BY_ID: (campaignId, leadId) => `campaigns/${campaignId}/leads/${leadId}`,
16
+ SYNC: (campaignId) => `campaigns/${campaignId}/leads/sync`,
17
+ NOTES: (campaignId, leadId, noteId) => `campaigns/${campaignId}/leads/${leadId}/notes/${noteId}`,
18
+ SEARCH: (campaignId) => `campaigns/${campaignId}/leads/search`,
19
+ },
20
+ INSIGHTS: (campaignId) => `campaigns/${campaignId}/insights`,
21
+ AI_METRICS: (campaignId) => `campaigns/${campaignId}/ai-metrics`,
22
+ CONNECT_SAVED: (campaignId) => `campaigns/${campaignId}/get-connects-saved`,
23
+ ANALYTICS: (campaignId, timeFilter) => `campaigns/${campaignId}/analytics?createdAt=${timeFilter}`,
24
+ ACTIVITY: (campaignId, status, offset, limit) => `campaigns/${campaignId}/activity?status=${status}&offset=${offset}&limit=${limit}`,
25
+ INTEGRATIONS: {
26
+ BASE: (campaignId) => `campaigns/${campaignId}/integrations`,
27
+ TEST_SUITABILITY_WEBHOOK: (campaignId, integrationId) => `campaigns/${campaignId}/integrations/${integrationId}/suitability/test-webhook`,
28
+ TEST_PROPOSAL_WEBHOOK: (campaignId, integrationId) => `campaigns/${campaignId}/integrations/${integrationId}/proposal/test-webhook`,
29
+ SUITABILITY_NOTIFICATION: (campaignId, leadId) => `campaigns/${campaignId}/integrations/suitability/notify/${leadId}`,
30
+ PROPOSAL_SENT_NOTIFICATION: (campaignId, leadId) => `campaigns/${campaignId}/integrations/proposal-sent/notify/${leadId}`,
31
+ SLACK: {
32
+ BASE: (campaignId) => `campaigns/${campaignId}/integrations/slack`,
33
+ TEST_SUITABILITY_WEBHOOK: (campaignId) => `campaigns/${campaignId}/integrations/slack/suitability/test-webhook`,
34
+ TEST_PROPOSAL_WEBHOOK: (campaignId) => `campaigns/${campaignId}/integrations/slack/proposal/test-webhook`,
35
+ },
36
+ DISCORD: {
37
+ BASE: (campaignId) => `campaigns/${campaignId}/integrations/discord`,
38
+ TEST_SUITABILITY_WEBHOOK: (campaignId) => `campaigns/${campaignId}/integrations/discord/suitability/test-webhook`,
39
+ TEST_PROPOSAL_WEBHOOK: (campaignId) => `campaigns/${campaignId}/integrations/discord/proposal/test-webhook`,
40
+ },
41
+ },
42
+ },
43
+ JOBS: {
44
+ BASE: "jobs",
45
+ BY_ID: (id) => `jobs/${id}`,
46
+ BY_URL: (url) => `jobs/${encodeURIComponent(url)}`,
47
+ IMPORT: "jobs/import",
48
+ FILTER_OPTIONS: "jobs/filter-options",
49
+ TOTAL_JOBS: "jobs/total-jobs",
50
+ GET_JOB_TITLE: (jobId) => `jobs/get-job-title/${jobId}`,
51
+ SEARCH: "jobs/search",
52
+ },
53
+ USERS: {
54
+ BASE: "users",
55
+ BY_ID: (id) => `users/${id}`,
56
+ },
57
+ AI_CONFIG: {
58
+ BASE: "ai-config",
59
+ GENERATE_KNOWLEDGE_BASE: "ai-config/generate-knowledge-base",
60
+ },
61
+ COOKIES: {
62
+ BASE: "cookies",
63
+ SCRAPE: "cookies/scrape-cookies",
64
+ },
65
+ SCRAPING: {
66
+ BASE: "scraping",
67
+ START_SCRAPING: "scraping/start",
68
+ START_WORLDWIDE_SCRAPING: "scraping/start-worldwide",
69
+ START_US_SCRAPING: "scraping/start-us",
70
+ START_UK_SCRAPING: "scraping/start-uk",
71
+ UPDATE_ACTIVITY_4H_WORLDWIDE: "scraping/update-activity/4h",
72
+ UPDATE_ACTIVITY_4H_UK: "scraping/update-activity/4h/uk",
73
+ UPDATE_ACTIVITY_4H_US: "scraping/update-activity/4h/us",
74
+ UPDATE_ACTIVITY_24H_WORLDWIDE: "scraping/update-activity/24h",
75
+ UPDATE_ACTIVITY_24H_UK: "scraping/update-activity/24h/uk",
76
+ UPDATE_ACTIVITY_24H_US: "scraping/update-activity/24h/us",
77
+ SCRAPE_FEED_WORLDWIDE: "scraping/feed-worldwide",
78
+ SCRAPE_FEED_UK: "scraping/feed-uk",
79
+ SCRAPE_FEED_US: "scraping/feed-us",
80
+ SCRAPE_JOB: "scraping/job",
81
+ SCRAPE_JOB_ACTIVITY: "scraping/job-activity",
82
+ },
83
+ ADMIN: {
84
+ BASE: "admin",
85
+ BIDDER_ACCOUNTS: {
86
+ BASE: "admin/bidder-accounts",
87
+ BY_ID: (id) => `admin/bidder-accounts/${id}`,
88
+ BY_PROVIDER: (provider) => `admin/bidder-accounts/${provider}`,
89
+ BY_PROVIDER_AND_ID: (provider, id) => `admin/bidder-accounts/${provider}/${id}`,
90
+ },
91
+ SCRAPER_ACCOUNTS: {
92
+ BASE: "admin/scraper-accounts",
93
+ BY_ID: (id) => `admin/scraper-accounts/${id}`,
94
+ BY_PROVIDER: (provider) => `admin/scraper-accounts/${provider}`,
95
+ BY_PROVIDER_AND_ID: (provider, id) => `admin/scraper-accounts/${provider}/${id}`,
96
+ },
97
+ PROXIES: {
98
+ BASE: "admin/proxies",
99
+ BY_ID: (id) => `admin/proxies/${id}`,
100
+ REPLACE_PROXY: (id) => `admin/proxies/${id}/replace`,
101
+ SYNC: "admin/proxies/sync",
102
+ },
103
+ },
104
+ BID: {
105
+ BASE: "bid",
106
+ BID_ON_JOB: (userId, campaignId, leadId) => `bid/${userId}/${campaignId}/${leadId}`,
107
+ },
108
+ };
109
+ // Helper function to build route with parameters
110
+ export const buildRoute = (route, params = {}) => {
111
+ let builtRoute = route;
112
+ Object.entries(params).forEach(([key, value]) => {
113
+ builtRoute = builtRoute.replace(`:${key}`, value);
114
+ });
115
+ return builtRoute;
116
+ };
@@ -0,0 +1,18 @@
1
+ export const accountStatusOrder = [
2
+ 'verification_required',
3
+ 'shadow_banned',
4
+ 'healthy',
5
+ 'banned',
6
+ 'suspended',
7
+ ];
8
+ export const accountStatusDisplayMap = {
9
+ verification_required: 'Verification Required',
10
+ shadow_banned: 'Shadow Banned',
11
+ healthy: 'Healthy',
12
+ banned: 'Banned',
13
+ suspended: 'Suspended',
14
+ };
15
+ export const bidderAccountProviderDisplayMap = {
16
+ 'lancer-provided': 'Lancer Provided',
17
+ 'user-provided': 'User Provided',
18
+ };
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from './schemas';
2
+ export * from './types';
3
+ export * from './constants';
4
+ export * from './utils';
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ export const accountStatusSchema = z.enum([
3
+ 'verification_required',
4
+ 'shadow_banned',
5
+ 'healthy',
6
+ 'banned',
7
+ 'suspended',
8
+ ]);
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ import { accountStatusSchema } from "./account-status";
3
+ export const bidderAccountProvider = z.enum([
4
+ "user-provided",
5
+ "lancer-provided",
6
+ ]);
7
+ export const bidderAccountSchema = z.object({
8
+ id: z.string(),
9
+ provider: bidderAccountProvider,
10
+ email: z.string().email(),
11
+ password: z.string(),
12
+ cookies: z.array(z.any()).nullable(),
13
+ status: accountStatusSchema,
14
+ verified: z.boolean(),
15
+ isActive: z.boolean(),
16
+ assignedOrganizations: z.array(z.string()),
17
+ lastUsed: z.number().nullable(),
18
+ multiLoginProfileId: z.string().nullable(),
19
+ proxyId: z.string().nullable(),
20
+ createdAt: z.number(),
21
+ updatedAt: z.number(),
22
+ });
23
+ export const createBidderAccountSchema = bidderAccountSchema.pick({
24
+ email: true,
25
+ password: true,
26
+ provider: true,
27
+ status: true,
28
+ verified: true,
29
+ isActive: true,
30
+ });
31
+ export const updateBidderAccountSchema = bidderAccountSchema
32
+ .omit({
33
+ id: true,
34
+ })
35
+ .partial();
@@ -0,0 +1,3 @@
1
+ export * from './account-status';
2
+ export * from './bidder-account';
3
+ export * from './scraper-account';
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ import { accountStatusSchema } from './account-status';
3
+ import { regionEnum } from '../job-filters';
4
+ export const scraperAccountSchema = z.object({
5
+ id: z.string(),
6
+ email: z.string().email(),
7
+ password: z.string(),
8
+ cookies: z.record(z.string(), z.string()),
9
+ proxy_credentials: z.string(),
10
+ region: regionEnum,
11
+ isActive: z.boolean(),
12
+ lastUsed: z.number(),
13
+ status: accountStatusSchema,
14
+ verified: z.boolean(),
15
+ errors: z.array(z.object({
16
+ errorMessage: z.string(),
17
+ timestamp: z.number(),
18
+ screenshotUrl: z.string(),
19
+ htmlUrl: z.string(),
20
+ })),
21
+ });
22
+ export const createScraperAccountSchema = scraperAccountSchema.pick({
23
+ email: true,
24
+ password: true,
25
+ proxy_credentials: true,
26
+ region: true,
27
+ verified: true,
28
+ isActive: true,
29
+ });
30
+ export const updateScraperAccountSchema = scraperAccountSchema
31
+ .omit({
32
+ id: true,
33
+ })
34
+ .partial();
@@ -323,6 +323,7 @@ export declare const agentTaskRequestSchema: z.ZodObject<{
323
323
  suitabilityRating: z.ZodNullable<z.ZodNumber>;
324
324
  suitabilityReason: z.ZodNullable<z.ZodString>;
325
325
  proposal: z.ZodNullable<z.ZodString>;
326
+ proposalId: z.ZodOptional<z.ZodString>;
326
327
  questionAnswerPairs: z.ZodNullable<z.ZodArray<z.ZodObject<{
327
328
  question: z.ZodString;
328
329
  answer: z.ZodString;
@@ -334,7 +335,7 @@ export declare const agentTaskRequestSchema: z.ZodObject<{
334
335
  answer: string;
335
336
  }>, "many">>;
336
337
  agentStatus: z.ZodNullable<z.ZodEnum<["suitabilityPending", "suitabilityProcessing", "suitabilityComplete", "suitabilityFailed", "proposalProcessing", "proposalComplete", "proposalFailed", "biddingProcessing", "biddingComplete", "biddingFailed", "jobArchived"]>>;
337
- leadStatus: z.ZodNullable<z.ZodEnum<["leads", "contacted", "viewed", "replied", "negotiations", "won", "lost"]>>;
338
+ leadStatus: z.ZodNullable<z.ZodEnum<["leads", "contacted", "viewed", "replied", "interview", "won", "lost"]>>;
338
339
  biddingAmount: z.ZodNullable<z.ZodNumber>;
339
340
  boosted: z.ZodNullable<z.ZodBoolean>;
340
341
  boostingAmount: z.ZodNullable<z.ZodNumber>;
@@ -440,7 +441,7 @@ export declare const agentTaskRequestSchema: z.ZodObject<{
440
441
  answer: string;
441
442
  }[] | null;
442
443
  agentStatus: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
443
- leadStatus: "leads" | "contacted" | "viewed" | "replied" | "negotiations" | "won" | "lost" | null;
444
+ leadStatus: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost" | null;
444
445
  biddingAmount: number | null;
445
446
  boosted: boolean | null;
446
447
  boostingAmount: number | null;
@@ -466,6 +467,7 @@ export declare const agentTaskRequestSchema: z.ZodObject<{
466
467
  invitesSent: number;
467
468
  unansweredInvites: number;
468
469
  } | null | undefined;
470
+ proposalId?: string | undefined;
469
471
  }, {
470
472
  id: string | null;
471
473
  uid: string | null;
@@ -566,7 +568,7 @@ export declare const agentTaskRequestSchema: z.ZodObject<{
566
568
  answer: string;
567
569
  }[] | null;
568
570
  agentStatus: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
569
- leadStatus: "leads" | "contacted" | "viewed" | "replied" | "negotiations" | "won" | "lost" | null;
571
+ leadStatus: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost" | null;
570
572
  biddingAmount: number | null;
571
573
  boosted: boolean | null;
572
574
  boostingAmount: number | null;
@@ -592,6 +594,7 @@ export declare const agentTaskRequestSchema: z.ZodObject<{
592
594
  invitesSent: number;
593
595
  unansweredInvites: number;
594
596
  } | null | undefined;
597
+ proposalId?: string | undefined;
595
598
  }>;
596
599
  }, "strip", z.ZodTypeAny, {
597
600
  organizationId: string;
@@ -702,7 +705,7 @@ export declare const agentTaskRequestSchema: z.ZodObject<{
702
705
  answer: string;
703
706
  }[] | null;
704
707
  agentStatus: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
705
- leadStatus: "leads" | "contacted" | "viewed" | "replied" | "negotiations" | "won" | "lost" | null;
708
+ leadStatus: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost" | null;
706
709
  biddingAmount: number | null;
707
710
  boosted: boolean | null;
708
711
  boostingAmount: number | null;
@@ -728,6 +731,7 @@ export declare const agentTaskRequestSchema: z.ZodObject<{
728
731
  invitesSent: number;
729
732
  unansweredInvites: number;
730
733
  } | null | undefined;
734
+ proposalId?: string | undefined;
731
735
  };
732
736
  userId?: string | undefined;
733
737
  campaignId?: string | undefined;
@@ -840,7 +844,7 @@ export declare const agentTaskRequestSchema: z.ZodObject<{
840
844
  answer: string;
841
845
  }[] | null;
842
846
  agentStatus: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
843
- leadStatus: "leads" | "contacted" | "viewed" | "replied" | "negotiations" | "won" | "lost" | null;
847
+ leadStatus: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost" | null;
844
848
  biddingAmount: number | null;
845
849
  boosted: boolean | null;
846
850
  boostingAmount: number | null;
@@ -866,6 +870,7 @@ export declare const agentTaskRequestSchema: z.ZodObject<{
866
870
  invitesSent: number;
867
871
  unansweredInvites: number;
868
872
  } | null | undefined;
873
+ proposalId?: string | undefined;
869
874
  };
870
875
  userId?: string | undefined;
871
876
  campaignId?: string | undefined;
@@ -1206,6 +1211,7 @@ export declare const testSystemPromptsRequestSchema: z.ZodObject<{
1206
1211
  suitabilityRating: z.ZodNullable<z.ZodNumber>;
1207
1212
  suitabilityReason: z.ZodNullable<z.ZodString>;
1208
1213
  proposal: z.ZodNullable<z.ZodString>;
1214
+ proposalId: z.ZodOptional<z.ZodString>;
1209
1215
  questionAnswerPairs: z.ZodNullable<z.ZodArray<z.ZodObject<{
1210
1216
  question: z.ZodString;
1211
1217
  answer: z.ZodString;
@@ -1217,7 +1223,7 @@ export declare const testSystemPromptsRequestSchema: z.ZodObject<{
1217
1223
  answer: string;
1218
1224
  }>, "many">>;
1219
1225
  agentStatus: z.ZodNullable<z.ZodEnum<["suitabilityPending", "suitabilityProcessing", "suitabilityComplete", "suitabilityFailed", "proposalProcessing", "proposalComplete", "proposalFailed", "biddingProcessing", "biddingComplete", "biddingFailed", "jobArchived"]>>;
1220
- leadStatus: z.ZodNullable<z.ZodEnum<["leads", "contacted", "viewed", "replied", "negotiations", "won", "lost"]>>;
1226
+ leadStatus: z.ZodNullable<z.ZodEnum<["leads", "contacted", "viewed", "replied", "interview", "won", "lost"]>>;
1221
1227
  biddingAmount: z.ZodNullable<z.ZodNumber>;
1222
1228
  boosted: z.ZodNullable<z.ZodBoolean>;
1223
1229
  boostingAmount: z.ZodNullable<z.ZodNumber>;
@@ -1323,7 +1329,7 @@ export declare const testSystemPromptsRequestSchema: z.ZodObject<{
1323
1329
  answer: string;
1324
1330
  }[] | null;
1325
1331
  agentStatus: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
1326
- leadStatus: "leads" | "contacted" | "viewed" | "replied" | "negotiations" | "won" | "lost" | null;
1332
+ leadStatus: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost" | null;
1327
1333
  biddingAmount: number | null;
1328
1334
  boosted: boolean | null;
1329
1335
  boostingAmount: number | null;
@@ -1349,6 +1355,7 @@ export declare const testSystemPromptsRequestSchema: z.ZodObject<{
1349
1355
  invitesSent: number;
1350
1356
  unansweredInvites: number;
1351
1357
  } | null | undefined;
1358
+ proposalId?: string | undefined;
1352
1359
  }, {
1353
1360
  id: string | null;
1354
1361
  uid: string | null;
@@ -1449,7 +1456,7 @@ export declare const testSystemPromptsRequestSchema: z.ZodObject<{
1449
1456
  answer: string;
1450
1457
  }[] | null;
1451
1458
  agentStatus: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
1452
- leadStatus: "leads" | "contacted" | "viewed" | "replied" | "negotiations" | "won" | "lost" | null;
1459
+ leadStatus: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost" | null;
1453
1460
  biddingAmount: number | null;
1454
1461
  boosted: boolean | null;
1455
1462
  boostingAmount: number | null;
@@ -1475,6 +1482,7 @@ export declare const testSystemPromptsRequestSchema: z.ZodObject<{
1475
1482
  invitesSent: number;
1476
1483
  unansweredInvites: number;
1477
1484
  } | null | undefined;
1485
+ proposalId?: string | undefined;
1478
1486
  }>;
1479
1487
  }, "strip", z.ZodTypeAny, {
1480
1488
  organizationId: string;
@@ -1584,7 +1592,7 @@ export declare const testSystemPromptsRequestSchema: z.ZodObject<{
1584
1592
  answer: string;
1585
1593
  }[] | null;
1586
1594
  agentStatus: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
1587
- leadStatus: "leads" | "contacted" | "viewed" | "replied" | "negotiations" | "won" | "lost" | null;
1595
+ leadStatus: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost" | null;
1588
1596
  biddingAmount: number | null;
1589
1597
  boosted: boolean | null;
1590
1598
  boostingAmount: number | null;
@@ -1610,6 +1618,7 @@ export declare const testSystemPromptsRequestSchema: z.ZodObject<{
1610
1618
  invitesSent: number;
1611
1619
  unansweredInvites: number;
1612
1620
  } | null | undefined;
1621
+ proposalId?: string | undefined;
1613
1622
  };
1614
1623
  modelSuitability: string;
1615
1624
  modelProposal: string;
@@ -1726,7 +1735,7 @@ export declare const testSystemPromptsRequestSchema: z.ZodObject<{
1726
1735
  answer: string;
1727
1736
  }[] | null;
1728
1737
  agentStatus: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
1729
- leadStatus: "leads" | "contacted" | "viewed" | "replied" | "negotiations" | "won" | "lost" | null;
1738
+ leadStatus: "leads" | "contacted" | "viewed" | "replied" | "interview" | "won" | "lost" | null;
1730
1739
  biddingAmount: number | null;
1731
1740
  boosted: boolean | null;
1732
1741
  boostingAmount: number | null;
@@ -1752,6 +1761,7 @@ export declare const testSystemPromptsRequestSchema: z.ZodObject<{
1752
1761
  invitesSent: number;
1753
1762
  unansweredInvites: number;
1754
1763
  } | null | undefined;
1764
+ proposalId?: string | undefined;
1755
1765
  };
1756
1766
  modelSuitability: string;
1757
1767
  modelProposal: string;