lancer-shared 1.2.126 → 1.2.128

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.
@@ -11171,475 +11171,6 @@ const jobFiltersSchema = z.object({
11171
11171
  .nullable(),
11172
11172
  });
11173
11173
 
11174
- const proxyCountryEnum = z.enum([
11175
- 'US',
11176
- 'CA',
11177
- 'GB',
11178
- 'AF',
11179
- 'AX',
11180
- 'AL',
11181
- 'DZ',
11182
- 'AS',
11183
- 'AD',
11184
- 'AO',
11185
- 'AI',
11186
- 'AQ',
11187
- 'AG',
11188
- 'AR',
11189
- 'AM',
11190
- 'AW',
11191
- 'AU',
11192
- 'AT',
11193
- 'AZ',
11194
- 'BS',
11195
- 'BH',
11196
- 'BD',
11197
- 'BB',
11198
- 'BY',
11199
- 'BE',
11200
- 'BZ',
11201
- 'BJ',
11202
- 'BM',
11203
- 'BT',
11204
- 'BO',
11205
- 'BA',
11206
- 'BW',
11207
- 'BV',
11208
- 'BR',
11209
- 'IO',
11210
- 'BN',
11211
- 'BG',
11212
- 'BF',
11213
- 'BI',
11214
- 'KH',
11215
- 'CM',
11216
- 'CV',
11217
- 'KY',
11218
- 'CF',
11219
- 'TD',
11220
- 'CL',
11221
- 'CN',
11222
- 'CX',
11223
- 'CC',
11224
- 'CO',
11225
- 'KM',
11226
- 'CG',
11227
- 'CD',
11228
- 'CK',
11229
- 'CR',
11230
- 'CI',
11231
- 'HR',
11232
- 'CU',
11233
- 'CY',
11234
- 'CZ',
11235
- 'DK',
11236
- 'DJ',
11237
- 'DM',
11238
- 'DO',
11239
- 'EC',
11240
- 'EG',
11241
- 'SV',
11242
- 'GQ',
11243
- 'ER',
11244
- 'EE',
11245
- 'ET',
11246
- 'FK',
11247
- 'FO',
11248
- 'FJ',
11249
- 'FI',
11250
- 'FR',
11251
- 'GF',
11252
- 'PF',
11253
- 'TF',
11254
- 'GA',
11255
- 'GM',
11256
- 'GE',
11257
- 'DE',
11258
- 'GH',
11259
- 'GI',
11260
- 'GR',
11261
- 'GL',
11262
- 'GD',
11263
- 'GP',
11264
- 'GU',
11265
- 'GT',
11266
- 'GG',
11267
- 'GN',
11268
- 'GW',
11269
- 'GY',
11270
- 'HT',
11271
- 'HM',
11272
- 'VA',
11273
- 'HN',
11274
- 'HK',
11275
- 'HU',
11276
- 'IS',
11277
- 'IN',
11278
- 'ID',
11279
- 'IR',
11280
- 'IQ',
11281
- 'IE',
11282
- 'IM',
11283
- 'IL',
11284
- 'IT',
11285
- 'JM',
11286
- 'JP',
11287
- 'JE',
11288
- 'JO',
11289
- 'KZ',
11290
- 'KE',
11291
- 'KI',
11292
- 'KP',
11293
- 'KR',
11294
- 'KW',
11295
- 'KG',
11296
- 'LA',
11297
- 'LV',
11298
- 'LB',
11299
- 'LS',
11300
- 'LR',
11301
- 'LY',
11302
- 'LI',
11303
- 'LT',
11304
- 'LU',
11305
- 'MO',
11306
- 'MK',
11307
- 'MG',
11308
- 'MW',
11309
- 'MY',
11310
- 'MV',
11311
- 'ML',
11312
- 'MT',
11313
- 'MH',
11314
- 'MQ',
11315
- 'MR',
11316
- 'MU',
11317
- 'YT',
11318
- 'MX',
11319
- 'FM',
11320
- 'MD',
11321
- 'MC',
11322
- 'MN',
11323
- 'ME',
11324
- 'MS',
11325
- 'MA',
11326
- 'MZ',
11327
- 'MM',
11328
- 'NA',
11329
- 'NR',
11330
- 'NP',
11331
- 'NL',
11332
- 'AN',
11333
- 'NC',
11334
- 'NZ',
11335
- 'NI',
11336
- 'NE',
11337
- 'NG',
11338
- 'NU',
11339
- 'NF',
11340
- 'MP',
11341
- 'NO',
11342
- 'OM',
11343
- 'PK',
11344
- 'PW',
11345
- 'PS',
11346
- 'PA',
11347
- 'PG',
11348
- 'PY',
11349
- 'PE',
11350
- 'PH',
11351
- 'PN',
11352
- 'PL',
11353
- 'PT',
11354
- 'PR',
11355
- 'QA',
11356
- 'RE',
11357
- 'RO',
11358
- 'RU',
11359
- 'RW',
11360
- 'BL',
11361
- 'SH',
11362
- 'KN',
11363
- 'LC',
11364
- 'MF',
11365
- 'PM',
11366
- 'VC',
11367
- 'WS',
11368
- 'SM',
11369
- 'ST',
11370
- 'SA',
11371
- 'SN',
11372
- 'RS',
11373
- 'SC',
11374
- 'SL',
11375
- 'SG',
11376
- 'SK',
11377
- 'SI',
11378
- 'SB',
11379
- 'SO',
11380
- 'ZA',
11381
- 'GS',
11382
- 'ES',
11383
- 'LK',
11384
- 'SD',
11385
- 'SR',
11386
- 'SJ',
11387
- 'SZ',
11388
- 'SE',
11389
- 'CH',
11390
- 'SY',
11391
- 'TW',
11392
- 'TJ',
11393
- 'TZ',
11394
- 'TH',
11395
- 'TL',
11396
- 'TG',
11397
- 'TK',
11398
- 'TO',
11399
- 'TT',
11400
- 'TN',
11401
- 'TR',
11402
- 'TM',
11403
- 'TC',
11404
- 'TV',
11405
- 'UG',
11406
- 'UA',
11407
- 'AE',
11408
- 'UM',
11409
- 'UY',
11410
- 'UZ',
11411
- 'VU',
11412
- 'VE',
11413
- 'VN',
11414
- 'VG',
11415
- 'VI',
11416
- 'WF',
11417
- 'EH',
11418
- 'YE',
11419
- 'ZM',
11420
- 'ZW',
11421
- ]);
11422
-
11423
- const proxyStatusSchema = z.enum([
11424
- 'invalid',
11425
- 'valid',
11426
- 'pending_validation',
11427
- ]);
11428
- const proxyProviderSchema = z.enum([
11429
- 'webshare',
11430
- 'decodo',
11431
- 'proxy-cheap',
11432
- ]);
11433
- const proxyTypeSchema = z.enum(['rotating', 'static']);
11434
- const proxySchema = z.object({
11435
- id: z.string(),
11436
- externalId: z.string(),
11437
- host: z.string(),
11438
- port: z.number(),
11439
- username: z.string(),
11440
- password: z.string(),
11441
- provider: proxyProviderSchema,
11442
- fraudScore: z.number().nullable(),
11443
- claimedCountry: proxyCountryEnum,
11444
- status: proxyStatusSchema.nullable(),
11445
- country: proxyCountryEnum.nullable(),
11446
- accountId: z.string().nullable(),
11447
- type: proxyTypeSchema,
11448
- });
11449
- const externalProxySchema = proxySchema.omit({
11450
- id: true,
11451
- accountId: true,
11452
- status: true,
11453
- country: true,
11454
- fraudScore: true,
11455
- });
11456
-
11457
- const proxyAvailableReplacementsSchema = z.record(proxyProviderSchema, z.number());
11458
-
11459
- const bidderAccountProvider = z.enum([
11460
- 'user-provided',
11461
- 'lancer-provided',
11462
- ]);
11463
- const bidderAccountAgencySchema = z.object({
11464
- name: z.string(),
11465
- logoUrl: z.string().nullable(),
11466
- contractors: z.array(z.string()),
11467
- organizationId: z.string(),
11468
- });
11469
- const bidderAccountSchema = z.object({
11470
- id: z.string(),
11471
- provider: bidderAccountProvider,
11472
- email: z.string().email(),
11473
- password: z.string(),
11474
- securityQuestionAnswer: z.string().nullable(),
11475
- assignedOrganizations: z.array(z.string()),
11476
- googleOauthTokens: z.any().nullable(),
11477
- lastUsed: z.number().nullable(),
11478
- multiLoginProfileId: z.string().nullable(),
11479
- proxyId: z.string().nullable(),
11480
- profilePhotoUrl: z.string().nullable(),
11481
- name: z.string().nullable(),
11482
- agencies: z.array(bidderAccountAgencySchema).nullable(),
11483
- instanceId: stringType().nullable(),
11484
- createdAt: z.number(),
11485
- updatedAt: z.number(),
11486
- region: regionEnum,
11487
- isProtected: z.boolean().optional(),
11488
- });
11489
- const createBidderAccountSchema = bidderAccountSchema
11490
- .pick({
11491
- email: true,
11492
- password: true,
11493
- provider: true,
11494
- securityQuestionAnswer: true,
11495
- profilePhotoUrl: true,
11496
- name: true,
11497
- agencies: true,
11498
- assignedOrganizations: true,
11499
- region: true,
11500
- })
11501
- .extend({
11502
- proxyCountry: proxyCountryEnum.nullable(),
11503
- });
11504
- const updateBidderAccountSchema = bidderAccountSchema
11505
- .omit({
11506
- id: true,
11507
- })
11508
- .partial();
11509
- const verifyBidderAccountCredentialsSchema = z.object({
11510
- email: z.string().email(),
11511
- password: z.string(),
11512
- securityQuestionAnswer: z.string(),
11513
- multiloginProfileId: z.string(),
11514
- proxy: proxySchema,
11515
- });
11516
- const verifyBidderAccountCredentialsResponseSchema = z.object({
11517
- accountName: z.string().nullable(),
11518
- accountPhotoUrl: z.string().nullable(),
11519
- agencies: z.array(bidderAccountAgencySchema).nullable(),
11520
- });
11521
- const acceptUpworkInvitationSchema = z.object({
11522
- code: z.string(),
11523
- });
11524
- const acceptUpworkInvitationResponseSchema = z.object({
11525
- agencyName: z.string(),
11526
- photoUrl: z.string(),
11527
- contractors: z.array(z.string()),
11528
- });
11529
-
11530
- class BidderAccountAlreadyConnectedException extends Error {
11531
- code = 'BIDDER_ACCOUNT_ALREADY_CONNECTED';
11532
- email;
11533
- constructor(email) {
11534
- super(`Bidder account ${email} is already connected to a scraper account`);
11535
- this.email = email;
11536
- }
11537
- }
11538
- const bidderAccountAlreadyConnectedException = (email) => new BidderAccountAlreadyConnectedException(email);
11539
-
11540
- class InvalidGoogleOAuthTokenException extends Error {
11541
- code = 'INVALID_GOOGLE_OAUTH_TOKEN';
11542
- constructor(message) {
11543
- super(message);
11544
- }
11545
- }
11546
- const invalidGoogleOAuthTokenSchema = (message) => new InvalidGoogleOAuthTokenException(message);
11547
-
11548
- class NoBidderAccountsAvailableException extends Error {
11549
- code = 'NO_BIDDER_ACCOUNTS_AVAILABLE';
11550
- constructor(message) {
11551
- super(message);
11552
- }
11553
- }
11554
- const noBidderAccountsAvailableException = (message) => {
11555
- return new NoBidderAccountsAvailableException(message);
11556
- };
11557
-
11558
- class NoGoogleOAuthTokensFoundException extends Error {
11559
- code = 'NO_GOOGLE_OAUTH_TOKENS_FOUND';
11560
- constructor(message) {
11561
- super(message);
11562
- }
11563
- }
11564
- const noGoogleOAuthTokensFoundException = (message) => new NoGoogleOAuthTokensFoundException(message);
11565
-
11566
- const scraperAccountType = z.enum([
11567
- 'feed',
11568
- 'job',
11569
- 'status',
11570
- 'activity',
11571
- 'profile',
11572
- 'unauthenticated',
11573
- ]);
11574
- const scraperAccountRegionEnum = z.enum([
11575
- 'Worldwide',
11576
- 'UKOnly',
11577
- 'USOnly',
11578
- ]);
11579
- const scraperAccountSchema = z.object({
11580
- id: z.string(),
11581
- isActive: z.boolean(),
11582
- region: scraperAccountRegionEnum,
11583
- email: z.string().email(),
11584
- password: z.string(),
11585
- securityQuestionAnswer: z.string().nullable(),
11586
- lastUsed: z.number().nullable(),
11587
- multiloginProfileId: z.string().nullable(),
11588
- proxyId: z.string().nullable(),
11589
- type: scraperAccountType,
11590
- createdAt: z.number(),
11591
- updatedAt: z.number(),
11592
- isProtected: z.boolean().optional(),
11593
- });
11594
- const createScraperAccountSchema = scraperAccountSchema
11595
- .pick({
11596
- region: true,
11597
- email: true,
11598
- password: true,
11599
- securityQuestionAnswer: true,
11600
- isActive: true,
11601
- type: true,
11602
- })
11603
- .extend({
11604
- proxyCountry: proxyCountryEnum.optional(),
11605
- rotatingProxy: z.boolean().optional(),
11606
- });
11607
- const updateScraperAccountSchema = scraperAccountSchema
11608
- .omit({
11609
- id: true,
11610
- })
11611
- .partial();
11612
-
11613
- const agentStatusSchema = z.enum([
11614
- "suitabilityPending",
11615
- "suitabilityProcessing",
11616
- "suitabilityComplete",
11617
- "suitabilityFailed",
11618
- "proposalProcessing",
11619
- "proposalComplete",
11620
- "proposalFailed",
11621
- "biddingProcessing",
11622
- "biddingComplete",
11623
- "biddingFailed",
11624
- "jobArchived",
11625
- ]);
11626
- const leadStatusSchema = z.enum([
11627
- "leads",
11628
- "contacted",
11629
- "viewed",
11630
- "replied",
11631
- "won",
11632
- ]);
11633
- const updateLeadStatusSchema = z.object({
11634
- leadId: z.string(),
11635
- organizationId: z.string(),
11636
- campaignId: z.string(),
11637
- status: leadStatusSchema,
11638
- proposalId: z.string().optional(),
11639
- userId: z.string().optional(),
11640
- wonAmount: z.number().optional(),
11641
- });
11642
-
11643
11174
  const booleanSchema = z
11644
11175
  .union([z.boolean(), z.literal("true"), z.literal("false")])
11645
11176
  .transform((value) => value === true || value === "true");
@@ -12197,471 +11728,943 @@ const jobDetailsSchema = objectType({
12197
11728
  hourlyBudget: hourlyBudgetSchema.nullable().optional(),
12198
11729
  weeklyBudget: objectType({
12199
11730
  amount: numberType(),
12200
- })
12201
- .nullable()
12202
- .optional(),
12203
- isSTSVectorSearchResult: booleanType().nullable().optional(),
11731
+ })
11732
+ .nullable()
11733
+ .optional(),
11734
+ isSTSVectorSearchResult: booleanType().nullable().optional(),
11735
+ });
11736
+ // Buyer schema
11737
+ const buyerSchema = objectType({
11738
+ isEnterprise: booleanType(),
11739
+ isPaymentMethodVerified: booleanType(),
11740
+ stats: objectType({
11741
+ totalAssignments: numberType().nullable(),
11742
+ activeAssignmentsCount: numberType().nullable(),
11743
+ hoursCount: numberType(),
11744
+ feedbackCount: numberType(),
11745
+ score: numberType().nullable(),
11746
+ totalJobsWithHires: numberType(),
11747
+ totalCharges: objectType({
11748
+ amount: numberType(),
11749
+ }).nullable(),
11750
+ }),
11751
+ location: objectType({
11752
+ offsetFromUtcMillis: numberType(),
11753
+ countryTimezone: stringType(),
11754
+ city: stringType().nullable(),
11755
+ country: stringType(),
11756
+ }),
11757
+ company: objectType({
11758
+ isEDCReplicated: anyType().nullable(),
11759
+ contractDate: stringType().nullable(),
11760
+ profile: objectType({
11761
+ industry: stringType().nullable(),
11762
+ size: anyType().nullable(), // Can be string or number
11763
+ }),
11764
+ }),
11765
+ jobs: objectType({
11766
+ postedCount: numberType().nullable(),
11767
+ openCount: numberType(),
11768
+ }),
11769
+ avgHourlyJobsRate: anyType().nullable(),
11770
+ });
11771
+ // Current user info schema
11772
+ const currentUserInfoSchema = objectType({
11773
+ freelancerInfo: objectType({
11774
+ qualificationsMatches: anyType().nullable(),
11775
+ }),
11776
+ });
11777
+ // Open jobs schema
11778
+ const openJobSchema = objectType({
11779
+ id: stringType(),
11780
+ uid: stringType(),
11781
+ isPtcPrivate: booleanType(),
11782
+ ciphertext: stringType(),
11783
+ title: stringType(),
11784
+ type: numberType(),
11785
+ access: numberType().nullable(),
11786
+ });
11787
+ // Similar jobs skill schema
11788
+ const similarJobSkillSchema = objectType({
11789
+ id: stringType().nullable(),
11790
+ prefLabel: stringType(),
11791
+ });
11792
+ // Similar jobs schema
11793
+ const similarJobSchema = objectType({
11794
+ id: stringType().nullable(),
11795
+ ciphertext: stringType(),
11796
+ title: stringType(),
11797
+ description: stringType(),
11798
+ engagement: stringType().nullable(),
11799
+ durationLabel: stringType(),
11800
+ contractorTier: numberType(),
11801
+ type: numberType(),
11802
+ createdOn: stringType(),
11803
+ renewedOn: stringType().nullable(),
11804
+ amount: objectType({
11805
+ amount: numberType(),
11806
+ }),
11807
+ maxAmount: anyType().nullable(),
11808
+ ontologySkills: arrayType(similarJobSkillSchema),
11809
+ hourlyBudgetMin: numberType(),
11810
+ hourlyBudgetMax: numberType(),
12204
11811
  });
12205
- // Buyer schema
12206
- const buyerSchema = objectType({
12207
- isEnterprise: booleanType(),
12208
- isPaymentMethodVerified: booleanType(),
12209
- stats: objectType({
12210
- totalAssignments: numberType().nullable(),
12211
- activeAssignmentsCount: numberType().nullable(),
12212
- hoursCount: numberType(),
12213
- feedbackCount: numberType(),
12214
- score: numberType().nullable(),
12215
- totalJobsWithHires: numberType(),
12216
- totalCharges: objectType({
12217
- amount: numberType(),
12218
- }).nullable(),
11812
+ // SANDS (Skills and Services) schema
11813
+ const sandsSkillSchema = objectType({
11814
+ uid: stringType().nullable(),
11815
+ name: stringType(),
11816
+ isFreeText: booleanType(),
11817
+ relevance: stringType(),
11818
+ });
11819
+ const sandsSchema = objectType({
11820
+ occupation: objectType({
11821
+ freeText: stringType().nullable(),
11822
+ ontologyId: stringType(),
11823
+ prefLabel: stringType(),
11824
+ id: stringType(),
11825
+ uid: stringType(),
12219
11826
  }),
12220
- location: objectType({
12221
- offsetFromUtcMillis: numberType(),
12222
- countryTimezone: stringType(),
12223
- city: stringType().nullable(),
12224
- country: stringType(),
11827
+ ontologySkills: arrayType(anyType()),
11828
+ additionalSkills: arrayType(sandsSkillSchema),
11829
+ });
11830
+ // Auth schema
11831
+ const authSchema = objectType({
11832
+ isVisitor: booleanType(),
11833
+ isAgency: booleanType(),
11834
+ isFreelancer: booleanType(),
11835
+ isClient: booleanType(),
11836
+ isUpworkPlusBuyer: booleanType(),
11837
+ domestic: objectType({
11838
+ country: anyType().nullable(),
11839
+ isInfographicTooltipAvailable: booleanType(),
12225
11840
  }),
12226
- company: objectType({
12227
- isEDCReplicated: anyType().nullable(),
12228
- contractDate: stringType().nullable(),
12229
- profile: objectType({
12230
- industry: stringType().nullable(),
12231
- size: anyType().nullable(), // Can be string or number
11841
+ });
11842
+ // SEO schema
11843
+ const seoSchema = objectType({
11844
+ title: stringType(),
11845
+ description: stringType(),
11846
+ url: stringType(),
11847
+ });
11848
+ // Main job details state schema
11849
+ const jobDetailsStateSchema = objectType({
11850
+ cache: booleanType(),
11851
+ job: jobDetailsSchema,
11852
+ buyer: buyerSchema,
11853
+ currentUserInfo: currentUserInfoSchema,
11854
+ openJobs: arrayType(openJobSchema),
11855
+ workHistory: arrayType(anyType()),
11856
+ similarJobs: arrayType(similarJobSchema),
11857
+ sands: sandsSchema,
11858
+ auth: authSchema,
11859
+ applicants: anyType().nullable(),
11860
+ connects: anyType().nullable(),
11861
+ enterpriseJobAdditionalInfo: recordType(anyType()),
11862
+ applicationContext: anyType().nullable(),
11863
+ profileMatchServiceUid: stringType().nullable(),
11864
+ seo: seoSchema,
11865
+ teamUid: anyType().nullable(),
11866
+ proposalPermissions: anyType().nullable(),
11867
+ jobSlug: anyType().nullable(),
11868
+ prefillWith: anyType().nullable(),
11869
+ isGroupOpportunity: booleanType(),
11870
+ isPhoneVerified: booleanType(),
11871
+ errorResponse: anyType().nullable(),
11872
+ isApplyBlocked: booleanType(),
11873
+ hasAiInterview: booleanType(),
11874
+ talentFeePromotion: anyType().nullable(),
11875
+ aiInterviewRoomId: anyType().nullable(),
11876
+ aiInterviewLinkSent: booleanType(),
11877
+ aiInterviewStatus: anyType().nullable(),
11878
+ aiInterviewJoinLimitReached: booleanType(),
11879
+ });
11880
+ const nuxtStateJobDetailsSchema = objectType({
11881
+ layout: stringType(),
11882
+ data: arrayType(recordType(anyType())),
11883
+ fetch: recordType(anyType()),
11884
+ error: anyType().nullable(),
11885
+ state: objectType({
11886
+ job: objectType({
11887
+ errorResponse: anyType().nullable(),
11888
+ channel: anyType().nullable(),
11889
+ visitedJobs: arrayType(anyType()),
11890
+ }),
11891
+ qt: objectType({
11892
+ isNewVisitorNavV1Enabled: booleanType(),
11893
+ }),
11894
+ tracker: objectType({
11895
+ guids: recordType(anyType()),
11896
+ }),
11897
+ tracing: objectType({
11898
+ native: objectType({
11899
+ span: objectType({
11900
+ id: stringType(),
11901
+ parentId: stringType(),
11902
+ traceId: stringType(),
11903
+ isPopulated: booleanType(),
11904
+ geoIpHeader: stringType(),
11905
+ }),
11906
+ }),
11907
+ }),
11908
+ context: objectType({
11909
+ loaded: booleanType(),
11910
+ loading: booleanType(),
11911
+ error: anyType().nullable(),
11912
+ isLoggedIn: booleanType().nullable(),
11913
+ auth: booleanType(),
11914
+ }),
11915
+ orgs: objectType({
11916
+ current: objectType({
11917
+ id: stringType().nullable(),
11918
+ rid: stringType().nullable(),
11919
+ type: stringType().nullable(),
11920
+ legacyType: stringType().nullable(),
11921
+ enterpriseType: stringType().nullable(),
11922
+ title: stringType().nullable(),
11923
+ typeTitle: stringType().nullable(),
11924
+ photoUrl: stringType().nullable(),
11925
+ flag: objectType({
11926
+ client: booleanType().nullable(),
11927
+ vendor: booleanType().nullable(),
11928
+ agency: booleanType().nullable(),
11929
+ individual: booleanType().nullable(),
11930
+ }),
11931
+ portrait100: stringType().nullable(),
11932
+ }),
11933
+ orgs: arrayType(anyType()),
11934
+ loading: booleanType().nullable(),
11935
+ loaded: booleanType().nullable(),
11936
+ }),
11937
+ user: objectType({
11938
+ id: stringType().nullable(),
11939
+ rid: stringType().nullable(),
11940
+ nid: stringType().nullable(),
11941
+ loading: booleanType().nullable(),
11942
+ loaded: booleanType().nullable(),
11943
+ isSudo: booleanType().nullable(),
11944
+ }),
11945
+ visitor: objectType({
11946
+ id: stringType(),
11947
+ ip: stringType(),
11948
+ }),
11949
+ vpn: objectType({
11950
+ isVpn: booleanType(),
11951
+ loading: booleanType(),
11952
+ loaded: booleanType(),
11953
+ error: anyType().nullable(),
11954
+ }),
11955
+ organizations: objectType({
11956
+ items: arrayType(anyType()),
11957
+ }),
11958
+ currency: objectType({
11959
+ currencyRate: anyType().nullable(),
11960
+ currencyCode: stringType().nullable(),
11961
+ currencyPopupShow: booleanType().nullable(),
11962
+ currencyName: stringType().nullable(),
11963
+ currencySymbol: stringType().nullable(),
11964
+ }),
11965
+ bot: objectType({
11966
+ isBot: booleanType(),
11967
+ loaded: booleanType(),
11968
+ }),
11969
+ flags: objectType({
11970
+ qt: recordType(anyType()),
11971
+ qtAllocationType: recordType(anyType()),
11972
+ ff: recordType(booleanType()),
11973
+ computedName: recordType(anyType()),
11974
+ }),
11975
+ geo: objectType({
11976
+ countryCode: stringType(),
11977
+ promise: anyType().nullable(),
11978
+ }),
11979
+ i18n: objectType({
11980
+ routeParams: recordType(anyType()),
11981
+ }),
11982
+ umq: objectType({
11983
+ width: numberType().nullable(),
11984
+ mobile: booleanType(),
11985
+ desktop: booleanType(),
11986
+ tablet: booleanType(),
11987
+ }),
11988
+ tracking: objectType({
11989
+ location: stringType(),
11990
+ visitorApiKey: stringType().nullable(),
11991
+ loading: booleanType().nullable(),
11992
+ loaded: booleanType().nullable(),
11993
+ promise: anyType().nullable(),
11994
+ error: anyType().nullable(),
11995
+ suit2Enabled: booleanType(),
11996
+ context: objectType({
11997
+ visitor_id: stringType().nullable(),
11998
+ user_uid: stringType().nullable(),
11999
+ user_nid: stringType().nullable(),
12000
+ organization_uid: stringType().nullable(),
12001
+ organization_type_title: stringType().nullable(),
12002
+ user_is_sudo: booleanType().nullable(),
12003
+ is_logged_in: booleanType().nullable(),
12004
+ }),
12005
+ }),
12006
+ theme: objectType({
12007
+ isSystemThemeMode: booleanType().nullable(),
12008
+ }),
12009
+ getfeedback: objectType({
12010
+ disabled: booleanType(),
12011
+ event: anyType().nullable(),
12012
+ }),
12013
+ statsig: objectType({
12014
+ experiments: recordType(objectType({
12015
+ name: stringType(),
12016
+ params: recordType(anyType()),
12017
+ })),
12018
+ }),
12019
+ jobDetails: jobDetailsStateSchema,
12020
+ forter: objectType({
12021
+ core: booleanType(),
12022
+ token: stringType(),
12023
+ }).optional(),
12024
+ }),
12025
+ serverRendered: booleanType(),
12026
+ routePath: stringType(),
12027
+ config: objectType({
12028
+ designSystem: stringType(),
12029
+ _app: objectType({
12030
+ basePath: stringType(),
12031
+ assetsPath: stringType(),
12032
+ cdnURL: stringType(),
12232
12033
  }),
12233
12034
  }),
12234
- jobs: objectType({
12235
- postedCount: numberType().nullable(),
12236
- openCount: numberType(),
12035
+ isCacheable: booleanType(),
12036
+ __i18n: objectType({
12037
+ langs: recordType(anyType()),
12038
+ }),
12039
+ microAppUtilsOverrides: objectType({
12040
+ userNavOverrides: recordType(anyType()).optional(),
12041
+ userSkinnyNavSkinnyOverrides: recordType(anyType()).optional(),
12042
+ visitorNavSkinnyOverrides: recordType(anyType()).optional(),
12237
12043
  }),
12238
- avgHourlyJobsRate: anyType().nullable(),
12239
12044
  });
12240
- // Current user info schema
12241
- const currentUserInfoSchema = objectType({
12242
- freelancerInfo: objectType({
12243
- qualificationsMatches: anyType().nullable(),
12045
+
12046
+ class JobIsPrivateException extends Error {
12047
+ code = 'JOB_IS_PRIVATE';
12048
+ constructor(url) {
12049
+ super(`Job is private: ${url}`);
12050
+ }
12051
+ }
12052
+ const jobIsPrivateException = (url) => new JobIsPrivateException(url);
12053
+ class FailedToParseNuxtJobException extends Error {
12054
+ code = 'FAILED_TO_PARSE_NUXT_JOB';
12055
+ constructor(url) {
12056
+ super(`Failed to parse Nuxt job: ${url}`);
12057
+ }
12058
+ }
12059
+ const failedToParseNuxtJobException = (message, url) => new FailedToParseNuxtJobException(`${message}: ${url}`);
12060
+
12061
+ const jobSkillsSchema = objectType({
12062
+ name: stringType(),
12063
+ });
12064
+ const vendorQualificationSchema = objectType({
12065
+ location: stringType().nullable(),
12066
+ talentType: z.enum(['Agency', 'Independent', 'unspecified']).nullable(),
12067
+ englishLevel: stringType().nullable(),
12068
+ minimumEarnings: numberType().nullable(),
12069
+ jobSuccessScore: stringType().nullable(),
12070
+ includeRisingTalent: stringType().nullable(),
12071
+ });
12072
+ const clientInfoSchema = objectType({
12073
+ isPaymentVerified: booleanType().nullable(),
12074
+ isPhoneVerified: booleanType().nullable(),
12075
+ numberOfReviews: numberType().nullable(),
12076
+ rating: numberType().nullable(),
12077
+ country: stringType().nullable(),
12078
+ region: stringType().nullable(),
12079
+ jobsPosted: numberType().nullable(),
12080
+ totalSpent: numberType().nullable(),
12081
+ numberOfHires: numberType().nullable(),
12082
+ activeEngagements: numberType().nullable(),
12083
+ openJobs: numberType().nullable(),
12084
+ hireRate: numberType().nullable(),
12085
+ memberSince: stringType().nullable(),
12086
+ companyIndustry: stringType().nullable(),
12087
+ companySize: stringType().nullable(),
12088
+ enterpriseClient: booleanType().nullable(),
12089
+ avgHourlyRatePaid: numberType().nullable(),
12090
+ });
12091
+ const clientReviewSchema = objectType({
12092
+ jobTitle: stringType().nullable(),
12093
+ freelancerName: stringType().nullable(),
12094
+ freelancerRating: numberType().nullable(),
12095
+ freelancerFeedback: stringType().nullable(),
12096
+ clientFeedback: stringType().nullable(),
12097
+ clientFeedbackRating: numberType().nullable(),
12098
+ dateRange: stringType().nullable(),
12099
+ paymentType: stringType().nullable(),
12100
+ fixedPrice: numberType().nullable(),
12101
+ hourlyRate: numberType().nullable(),
12102
+ numHours: numberType().nullable(),
12103
+ totalBilled: numberType().nullable(),
12104
+ });
12105
+ const bidRangeSchema = objectType({
12106
+ high: numberType().nullable(),
12107
+ avg: numberType().nullable(),
12108
+ low: numberType().nullable(),
12109
+ });
12110
+ const jobActivitySchema = objectType({
12111
+ proposals: objectType({
12112
+ min: numberType().nullable(),
12113
+ max: numberType().nullable(),
12244
12114
  }),
12115
+ lastViewedByClient: stringType().nullable(),
12116
+ lastViewedByClientTimestamp: numberType().nullable(),
12117
+ hires: numberType().nullable(),
12118
+ interviewing: numberType().nullable(),
12119
+ invitesSent: numberType().nullable(),
12120
+ unansweredInvites: numberType().nullable(),
12121
+ updatedAt: numberType().nullable(),
12245
12122
  });
12246
- // Open jobs schema
12247
- const openJobSchema = objectType({
12248
- id: stringType(),
12249
- uid: stringType(),
12250
- isPtcPrivate: booleanType(),
12251
- ciphertext: stringType(),
12252
- title: stringType(),
12253
- type: numberType(),
12254
- access: numberType().nullable(),
12123
+ const jobActivityDeltaSchema = objectType({
12124
+ proposals: numberType(),
12125
+ interviewing: numberType(),
12126
+ hires: numberType(),
12127
+ invitesSent: numberType(),
12128
+ unansweredInvites: numberType(),
12255
12129
  });
12256
- // Similar jobs skill schema
12257
- const similarJobSkillSchema = objectType({
12258
- id: stringType().nullable(),
12259
- prefLabel: stringType(),
12130
+ const metadataSchema = objectType({
12131
+ hours: stringType().nullable(),
12132
+ duration: stringType().nullable(),
12133
+ experienceLevel: stringType().nullable(),
12134
+ hourlyRate: z
12135
+ .object({
12136
+ min: numberType().nullable(),
12137
+ max: numberType().nullable(),
12138
+ })
12139
+ .nullable(),
12140
+ paymentType: stringType().nullable(),
12141
+ fixedPrice: numberType().nullable(),
12260
12142
  });
12261
- // Similar jobs schema
12262
- const similarJobSchema = objectType({
12143
+ const jobActivityOffsetHours = [4, 24];
12144
+ const jobActivityOffsetEnum = z.enum(jobActivityOffsetHours.map((h) => `${h}h`));
12145
+ const upworkJobSchema = objectType({
12263
12146
  id: stringType().nullable(),
12264
- ciphertext: stringType(),
12265
- title: stringType(),
12266
- description: stringType(),
12267
- engagement: stringType().nullable(),
12268
- durationLabel: stringType(),
12269
- contractorTier: numberType(),
12270
- type: numberType(),
12271
- createdOn: stringType(),
12272
- renewedOn: stringType().nullable(),
12273
- amount: objectType({
12274
- amount: numberType(),
12275
- }),
12276
- maxAmount: anyType().nullable(),
12277
- ontologySkills: arrayType(similarJobSkillSchema),
12278
- hourlyBudgetMin: numberType(),
12279
- hourlyBudgetMax: numberType(),
12147
+ uid: stringType().nullable(),
12148
+ createdAt: numberType().nullable(),
12149
+ title: stringType().nullable(),
12150
+ category: stringType().nullable(),
12151
+ skills: arrayType(jobSkillsSchema).nullable(),
12152
+ datetime: numberType().nullable(),
12153
+ description: stringType().nullable(),
12154
+ descriptionLength: numberType().nullable(),
12155
+ connectsRequired: numberType().nullable(),
12156
+ projectType: stringType().nullable(),
12157
+ projectDuration: stringType().nullable(),
12158
+ questions: arrayType(stringType()).nullable(),
12159
+ jobUrl: stringType().nullable(),
12160
+ metadata: metadataSchema.nullable(),
12161
+ clientInfo: clientInfoSchema.nullable(),
12162
+ vendorQualifications: vendorQualificationSchema.nullable(),
12163
+ processed: booleanType().nullable(),
12164
+ isFeatured: booleanType().nullable(),
12165
+ clientReviews: arrayType(clientReviewSchema).nullable(),
12166
+ region: regionSchema.nullable(),
12167
+ bidRange: bidRangeSchema.nullable(),
12168
+ jobActivity: jobActivitySchema.nullable(),
12169
+ activityUpdates: z
12170
+ .union([z.literal(1), z.literal(2), z.literal(3)])
12171
+ .nullable(),
12172
+ activity: recordType(jobActivityOffsetEnum, jobActivitySchema).nullish(),
12173
+ activityDelta: jobActivityDeltaSchema.nullish(),
12174
+ });
12175
+ const jobActivityOffsetHourSchema = custom((val) => jobActivityOffsetHours.includes(val));
12176
+ const jobActivityUpdateSchema = objectType({
12177
+ jobUrl: stringType(),
12178
+ data: jobActivitySchema,
12179
+ offsetHour: jobActivityOffsetHourSchema,
12180
+ scrapedAt: numberType(),
12181
+ });
12182
+ const jobActivitySnapshotSchema = objectType({
12183
+ jobUrl: stringType(),
12184
+ activity: jobActivitySchema,
12185
+ postedAt: numberType(),
12186
+ scrapedAt: numberType(),
12187
+ hoursSincePosted: numberType(),
12188
+ });
12189
+ const feedJobSchema = objectType({
12190
+ uid: stringType().nullable(),
12191
+ title: stringType().nullable(),
12192
+ jobUrl: stringType().nullable(),
12193
+ datetime: stringType().nullable(),
12194
+ isFeatured: booleanType().nullable(),
12195
+ region: regionSchema.nullable(),
12196
+ });
12197
+
12198
+ const proxyCountryEnum = z.enum([
12199
+ 'US',
12200
+ 'CA',
12201
+ 'GB',
12202
+ 'AF',
12203
+ 'AX',
12204
+ 'AL',
12205
+ 'DZ',
12206
+ 'AS',
12207
+ 'AD',
12208
+ 'AO',
12209
+ 'AI',
12210
+ 'AQ',
12211
+ 'AG',
12212
+ 'AR',
12213
+ 'AM',
12214
+ 'AW',
12215
+ 'AU',
12216
+ 'AT',
12217
+ 'AZ',
12218
+ 'BS',
12219
+ 'BH',
12220
+ 'BD',
12221
+ 'BB',
12222
+ 'BY',
12223
+ 'BE',
12224
+ 'BZ',
12225
+ 'BJ',
12226
+ 'BM',
12227
+ 'BT',
12228
+ 'BO',
12229
+ 'BA',
12230
+ 'BW',
12231
+ 'BV',
12232
+ 'BR',
12233
+ 'IO',
12234
+ 'BN',
12235
+ 'BG',
12236
+ 'BF',
12237
+ 'BI',
12238
+ 'KH',
12239
+ 'CM',
12240
+ 'CV',
12241
+ 'KY',
12242
+ 'CF',
12243
+ 'TD',
12244
+ 'CL',
12245
+ 'CN',
12246
+ 'CX',
12247
+ 'CC',
12248
+ 'CO',
12249
+ 'KM',
12250
+ 'CG',
12251
+ 'CD',
12252
+ 'CK',
12253
+ 'CR',
12254
+ 'CI',
12255
+ 'HR',
12256
+ 'CU',
12257
+ 'CY',
12258
+ 'CZ',
12259
+ 'DK',
12260
+ 'DJ',
12261
+ 'DM',
12262
+ 'DO',
12263
+ 'EC',
12264
+ 'EG',
12265
+ 'SV',
12266
+ 'GQ',
12267
+ 'ER',
12268
+ 'EE',
12269
+ 'ET',
12270
+ 'FK',
12271
+ 'FO',
12272
+ 'FJ',
12273
+ 'FI',
12274
+ 'FR',
12275
+ 'GF',
12276
+ 'PF',
12277
+ 'TF',
12278
+ 'GA',
12279
+ 'GM',
12280
+ 'GE',
12281
+ 'DE',
12282
+ 'GH',
12283
+ 'GI',
12284
+ 'GR',
12285
+ 'GL',
12286
+ 'GD',
12287
+ 'GP',
12288
+ 'GU',
12289
+ 'GT',
12290
+ 'GG',
12291
+ 'GN',
12292
+ 'GW',
12293
+ 'GY',
12294
+ 'HT',
12295
+ 'HM',
12296
+ 'VA',
12297
+ 'HN',
12298
+ 'HK',
12299
+ 'HU',
12300
+ 'IS',
12301
+ 'IN',
12302
+ 'ID',
12303
+ 'IR',
12304
+ 'IQ',
12305
+ 'IE',
12306
+ 'IM',
12307
+ 'IL',
12308
+ 'IT',
12309
+ 'JM',
12310
+ 'JP',
12311
+ 'JE',
12312
+ 'JO',
12313
+ 'KZ',
12314
+ 'KE',
12315
+ 'KI',
12316
+ 'KP',
12317
+ 'KR',
12318
+ 'KW',
12319
+ 'KG',
12320
+ 'LA',
12321
+ 'LV',
12322
+ 'LB',
12323
+ 'LS',
12324
+ 'LR',
12325
+ 'LY',
12326
+ 'LI',
12327
+ 'LT',
12328
+ 'LU',
12329
+ 'MO',
12330
+ 'MK',
12331
+ 'MG',
12332
+ 'MW',
12333
+ 'MY',
12334
+ 'MV',
12335
+ 'ML',
12336
+ 'MT',
12337
+ 'MH',
12338
+ 'MQ',
12339
+ 'MR',
12340
+ 'MU',
12341
+ 'YT',
12342
+ 'MX',
12343
+ 'FM',
12344
+ 'MD',
12345
+ 'MC',
12346
+ 'MN',
12347
+ 'ME',
12348
+ 'MS',
12349
+ 'MA',
12350
+ 'MZ',
12351
+ 'MM',
12352
+ 'NA',
12353
+ 'NR',
12354
+ 'NP',
12355
+ 'NL',
12356
+ 'AN',
12357
+ 'NC',
12358
+ 'NZ',
12359
+ 'NI',
12360
+ 'NE',
12361
+ 'NG',
12362
+ 'NU',
12363
+ 'NF',
12364
+ 'MP',
12365
+ 'NO',
12366
+ 'OM',
12367
+ 'PK',
12368
+ 'PW',
12369
+ 'PS',
12370
+ 'PA',
12371
+ 'PG',
12372
+ 'PY',
12373
+ 'PE',
12374
+ 'PH',
12375
+ 'PN',
12376
+ 'PL',
12377
+ 'PT',
12378
+ 'PR',
12379
+ 'QA',
12380
+ 'RE',
12381
+ 'RO',
12382
+ 'RU',
12383
+ 'RW',
12384
+ 'BL',
12385
+ 'SH',
12386
+ 'KN',
12387
+ 'LC',
12388
+ 'MF',
12389
+ 'PM',
12390
+ 'VC',
12391
+ 'WS',
12392
+ 'SM',
12393
+ 'ST',
12394
+ 'SA',
12395
+ 'SN',
12396
+ 'RS',
12397
+ 'SC',
12398
+ 'SL',
12399
+ 'SG',
12400
+ 'SK',
12401
+ 'SI',
12402
+ 'SB',
12403
+ 'SO',
12404
+ 'ZA',
12405
+ 'GS',
12406
+ 'ES',
12407
+ 'LK',
12408
+ 'SD',
12409
+ 'SR',
12410
+ 'SJ',
12411
+ 'SZ',
12412
+ 'SE',
12413
+ 'CH',
12414
+ 'SY',
12415
+ 'TW',
12416
+ 'TJ',
12417
+ 'TZ',
12418
+ 'TH',
12419
+ 'TL',
12420
+ 'TG',
12421
+ 'TK',
12422
+ 'TO',
12423
+ 'TT',
12424
+ 'TN',
12425
+ 'TR',
12426
+ 'TM',
12427
+ 'TC',
12428
+ 'TV',
12429
+ 'UG',
12430
+ 'UA',
12431
+ 'AE',
12432
+ 'UM',
12433
+ 'UY',
12434
+ 'UZ',
12435
+ 'VU',
12436
+ 'VE',
12437
+ 'VN',
12438
+ 'VG',
12439
+ 'VI',
12440
+ 'WF',
12441
+ 'EH',
12442
+ 'YE',
12443
+ 'ZM',
12444
+ 'ZW',
12445
+ ]);
12446
+
12447
+ const proxyStatusSchema = z.enum([
12448
+ 'invalid',
12449
+ 'valid',
12450
+ 'pending_validation',
12451
+ ]);
12452
+ const proxyProviderSchema = z.enum([
12453
+ 'webshare',
12454
+ 'decodo',
12455
+ 'proxy-cheap',
12456
+ ]);
12457
+ const proxyTypeSchema = z.enum(['rotating', 'static']);
12458
+ const proxySchema = z.object({
12459
+ id: z.string(),
12460
+ externalId: z.string(),
12461
+ host: z.string(),
12462
+ port: z.number(),
12463
+ username: z.string(),
12464
+ password: z.string(),
12465
+ provider: proxyProviderSchema,
12466
+ fraudScore: z.number().nullable(),
12467
+ claimedCountry: proxyCountryEnum,
12468
+ status: proxyStatusSchema.nullable(),
12469
+ country: proxyCountryEnum.nullable(),
12470
+ accountId: z.string().nullable(),
12471
+ type: proxyTypeSchema,
12280
12472
  });
12281
- // SANDS (Skills and Services) schema
12282
- const sandsSkillSchema = objectType({
12283
- uid: stringType().nullable(),
12284
- name: stringType(),
12285
- isFreeText: booleanType(),
12286
- relevance: stringType(),
12473
+ const externalProxySchema = proxySchema.omit({
12474
+ id: true,
12475
+ accountId: true,
12476
+ status: true,
12477
+ country: true,
12478
+ fraudScore: true,
12287
12479
  });
12288
- const sandsSchema = objectType({
12289
- occupation: objectType({
12290
- freeText: stringType().nullable(),
12291
- ontologyId: stringType(),
12292
- prefLabel: stringType(),
12293
- id: stringType(),
12294
- uid: stringType(),
12295
- }),
12296
- ontologySkills: arrayType(anyType()),
12297
- additionalSkills: arrayType(sandsSkillSchema),
12480
+ const refreshRotatingProxiesRequestBodySchema = z.object({
12481
+ region: regionEnum,
12298
12482
  });
12299
- // Auth schema
12300
- const authSchema = objectType({
12301
- isVisitor: booleanType(),
12302
- isAgency: booleanType(),
12303
- isFreelancer: booleanType(),
12304
- isClient: booleanType(),
12305
- isUpworkPlusBuyer: booleanType(),
12306
- domestic: objectType({
12307
- country: anyType().nullable(),
12308
- isInfographicTooltipAvailable: booleanType(),
12309
- }),
12483
+
12484
+ const proxyAvailableReplacementsSchema = z.record(proxyProviderSchema, z.number());
12485
+
12486
+ const bidderAccountProvider = z.enum([
12487
+ 'user-provided',
12488
+ 'lancer-provided',
12489
+ ]);
12490
+ const bidderAccountAgencySchema = z.object({
12491
+ name: z.string(),
12492
+ logoUrl: z.string().nullable(),
12493
+ contractors: z.array(z.string()),
12494
+ organizationId: z.string(),
12310
12495
  });
12311
- // SEO schema
12312
- const seoSchema = objectType({
12313
- title: stringType(),
12314
- description: stringType(),
12315
- url: stringType(),
12496
+ const bidderAccountSchema = z.object({
12497
+ id: z.string(),
12498
+ provider: bidderAccountProvider,
12499
+ email: z.string().email(),
12500
+ password: z.string(),
12501
+ securityQuestionAnswer: z.string().nullable(),
12502
+ assignedOrganizations: z.array(z.string()),
12503
+ googleOauthTokens: z.any().nullable(),
12504
+ lastUsed: z.number().nullable(),
12505
+ multiLoginProfileId: z.string().nullable(),
12506
+ proxyId: z.string().nullable(),
12507
+ profilePhotoUrl: z.string().nullable(),
12508
+ name: z.string().nullable(),
12509
+ agencies: z.array(bidderAccountAgencySchema).nullable(),
12510
+ instanceId: stringType().nullable(),
12511
+ createdAt: z.number(),
12512
+ updatedAt: z.number(),
12513
+ region: regionEnum,
12514
+ isProtected: z.boolean().optional(),
12316
12515
  });
12317
- // Main job details state schema
12318
- const jobDetailsStateSchema = objectType({
12319
- cache: booleanType(),
12320
- job: jobDetailsSchema,
12321
- buyer: buyerSchema,
12322
- currentUserInfo: currentUserInfoSchema,
12323
- openJobs: arrayType(openJobSchema),
12324
- workHistory: arrayType(anyType()),
12325
- similarJobs: arrayType(similarJobSchema),
12326
- sands: sandsSchema,
12327
- auth: authSchema,
12328
- applicants: anyType().nullable(),
12329
- connects: anyType().nullable(),
12330
- enterpriseJobAdditionalInfo: recordType(anyType()),
12331
- applicationContext: anyType().nullable(),
12332
- profileMatchServiceUid: stringType().nullable(),
12333
- seo: seoSchema,
12334
- teamUid: anyType().nullable(),
12335
- proposalPermissions: anyType().nullable(),
12336
- jobSlug: anyType().nullable(),
12337
- prefillWith: anyType().nullable(),
12338
- isGroupOpportunity: booleanType(),
12339
- isPhoneVerified: booleanType(),
12340
- errorResponse: anyType().nullable(),
12341
- isApplyBlocked: booleanType(),
12342
- hasAiInterview: booleanType(),
12343
- talentFeePromotion: anyType().nullable(),
12344
- aiInterviewRoomId: anyType().nullable(),
12345
- aiInterviewLinkSent: booleanType(),
12346
- aiInterviewStatus: anyType().nullable(),
12347
- aiInterviewJoinLimitReached: booleanType(),
12516
+ const createBidderAccountSchema = bidderAccountSchema
12517
+ .pick({
12518
+ email: true,
12519
+ password: true,
12520
+ provider: true,
12521
+ securityQuestionAnswer: true,
12522
+ profilePhotoUrl: true,
12523
+ name: true,
12524
+ agencies: true,
12525
+ assignedOrganizations: true,
12526
+ region: true,
12527
+ })
12528
+ .extend({
12529
+ proxyCountry: proxyCountryEnum.nullable(),
12348
12530
  });
12349
- const nuxtStateJobDetailsSchema = objectType({
12350
- layout: stringType(),
12351
- data: arrayType(recordType(anyType())),
12352
- fetch: recordType(anyType()),
12353
- error: anyType().nullable(),
12354
- state: objectType({
12355
- job: objectType({
12356
- errorResponse: anyType().nullable(),
12357
- channel: anyType().nullable(),
12358
- visitedJobs: arrayType(anyType()),
12359
- }),
12360
- qt: objectType({
12361
- isNewVisitorNavV1Enabled: booleanType(),
12362
- }),
12363
- tracker: objectType({
12364
- guids: recordType(anyType()),
12365
- }),
12366
- tracing: objectType({
12367
- native: objectType({
12368
- span: objectType({
12369
- id: stringType(),
12370
- parentId: stringType(),
12371
- traceId: stringType(),
12372
- isPopulated: booleanType(),
12373
- geoIpHeader: stringType(),
12374
- }),
12375
- }),
12376
- }),
12377
- context: objectType({
12378
- loaded: booleanType(),
12379
- loading: booleanType(),
12380
- error: anyType().nullable(),
12381
- isLoggedIn: booleanType().nullable(),
12382
- auth: booleanType(),
12383
- }),
12384
- orgs: objectType({
12385
- current: objectType({
12386
- id: stringType().nullable(),
12387
- rid: stringType().nullable(),
12388
- type: stringType().nullable(),
12389
- legacyType: stringType().nullable(),
12390
- enterpriseType: stringType().nullable(),
12391
- title: stringType().nullable(),
12392
- typeTitle: stringType().nullable(),
12393
- photoUrl: stringType().nullable(),
12394
- flag: objectType({
12395
- client: booleanType().nullable(),
12396
- vendor: booleanType().nullable(),
12397
- agency: booleanType().nullable(),
12398
- individual: booleanType().nullable(),
12399
- }),
12400
- portrait100: stringType().nullable(),
12401
- }),
12402
- orgs: arrayType(anyType()),
12403
- loading: booleanType().nullable(),
12404
- loaded: booleanType().nullable(),
12405
- }),
12406
- user: objectType({
12407
- id: stringType().nullable(),
12408
- rid: stringType().nullable(),
12409
- nid: stringType().nullable(),
12410
- loading: booleanType().nullable(),
12411
- loaded: booleanType().nullable(),
12412
- isSudo: booleanType().nullable(),
12413
- }),
12414
- visitor: objectType({
12415
- id: stringType(),
12416
- ip: stringType(),
12417
- }),
12418
- vpn: objectType({
12419
- isVpn: booleanType(),
12420
- loading: booleanType(),
12421
- loaded: booleanType(),
12422
- error: anyType().nullable(),
12423
- }),
12424
- organizations: objectType({
12425
- items: arrayType(anyType()),
12426
- }),
12427
- currency: objectType({
12428
- currencyRate: anyType().nullable(),
12429
- currencyCode: stringType().nullable(),
12430
- currencyPopupShow: booleanType().nullable(),
12431
- currencyName: stringType().nullable(),
12432
- currencySymbol: stringType().nullable(),
12433
- }),
12434
- bot: objectType({
12435
- isBot: booleanType(),
12436
- loaded: booleanType(),
12437
- }),
12438
- flags: objectType({
12439
- qt: recordType(anyType()),
12440
- qtAllocationType: recordType(anyType()),
12441
- ff: recordType(booleanType()),
12442
- computedName: recordType(anyType()),
12443
- }),
12444
- geo: objectType({
12445
- countryCode: stringType(),
12446
- promise: anyType().nullable(),
12447
- }),
12448
- i18n: objectType({
12449
- routeParams: recordType(anyType()),
12450
- }),
12451
- umq: objectType({
12452
- width: numberType().nullable(),
12453
- mobile: booleanType(),
12454
- desktop: booleanType(),
12455
- tablet: booleanType(),
12456
- }),
12457
- tracking: objectType({
12458
- location: stringType(),
12459
- visitorApiKey: stringType().nullable(),
12460
- loading: booleanType().nullable(),
12461
- loaded: booleanType().nullable(),
12462
- promise: anyType().nullable(),
12463
- error: anyType().nullable(),
12464
- suit2Enabled: booleanType(),
12465
- context: objectType({
12466
- visitor_id: stringType().nullable(),
12467
- user_uid: stringType().nullable(),
12468
- user_nid: stringType().nullable(),
12469
- organization_uid: stringType().nullable(),
12470
- organization_type_title: stringType().nullable(),
12471
- user_is_sudo: booleanType().nullable(),
12472
- is_logged_in: booleanType().nullable(),
12473
- }),
12474
- }),
12475
- theme: objectType({
12476
- isSystemThemeMode: booleanType().nullable(),
12477
- }),
12478
- getfeedback: objectType({
12479
- disabled: booleanType(),
12480
- event: anyType().nullable(),
12481
- }),
12482
- statsig: objectType({
12483
- experiments: recordType(objectType({
12484
- name: stringType(),
12485
- params: recordType(anyType()),
12486
- })),
12487
- }),
12488
- jobDetails: jobDetailsStateSchema,
12489
- forter: objectType({
12490
- core: booleanType(),
12491
- token: stringType(),
12492
- }).optional(),
12493
- }),
12494
- serverRendered: booleanType(),
12495
- routePath: stringType(),
12496
- config: objectType({
12497
- designSystem: stringType(),
12498
- _app: objectType({
12499
- basePath: stringType(),
12500
- assetsPath: stringType(),
12501
- cdnURL: stringType(),
12502
- }),
12503
- }),
12504
- isCacheable: booleanType(),
12505
- __i18n: objectType({
12506
- langs: recordType(anyType()),
12507
- }),
12508
- microAppUtilsOverrides: objectType({
12509
- userNavOverrides: recordType(anyType()).optional(),
12510
- userSkinnyNavSkinnyOverrides: recordType(anyType()).optional(),
12511
- visitorNavSkinnyOverrides: recordType(anyType()).optional(),
12512
- }),
12531
+ const updateBidderAccountSchema = bidderAccountSchema
12532
+ .omit({
12533
+ id: true,
12534
+ })
12535
+ .partial();
12536
+ const verifyBidderAccountCredentialsSchema = z.object({
12537
+ email: z.string().email(),
12538
+ password: z.string(),
12539
+ securityQuestionAnswer: z.string(),
12540
+ multiloginProfileId: z.string(),
12541
+ proxy: proxySchema,
12542
+ });
12543
+ const verifyBidderAccountCredentialsResponseSchema = z.object({
12544
+ accountName: z.string().nullable(),
12545
+ accountPhotoUrl: z.string().nullable(),
12546
+ agencies: z.array(bidderAccountAgencySchema).nullable(),
12547
+ });
12548
+ const acceptUpworkInvitationSchema = z.object({
12549
+ code: z.string(),
12550
+ });
12551
+ const acceptUpworkInvitationResponseSchema = z.object({
12552
+ agencyName: z.string(),
12553
+ photoUrl: z.string(),
12554
+ contractors: z.array(z.string()),
12513
12555
  });
12514
12556
 
12515
- class JobIsPrivateException extends Error {
12516
- code = 'JOB_IS_PRIVATE';
12517
- constructor(url) {
12518
- super(`Job is private: ${url}`);
12557
+ class BidderAccountAlreadyConnectedException extends Error {
12558
+ code = 'BIDDER_ACCOUNT_ALREADY_CONNECTED';
12559
+ email;
12560
+ constructor(email) {
12561
+ super(`Bidder account ${email} is already connected to a scraper account`);
12562
+ this.email = email;
12519
12563
  }
12520
12564
  }
12521
- const jobIsPrivateException = (url) => new JobIsPrivateException(url);
12522
- class FailedToParseNuxtJobException extends Error {
12523
- code = 'FAILED_TO_PARSE_NUXT_JOB';
12524
- constructor(url) {
12525
- super(`Failed to parse Nuxt job: ${url}`);
12565
+ const bidderAccountAlreadyConnectedException = (email) => new BidderAccountAlreadyConnectedException(email);
12566
+
12567
+ class InvalidGoogleOAuthTokenException extends Error {
12568
+ code = 'INVALID_GOOGLE_OAUTH_TOKEN';
12569
+ constructor(message) {
12570
+ super(message);
12526
12571
  }
12527
12572
  }
12528
- const failedToParseNuxtJobException = (message, url) => new FailedToParseNuxtJobException(`${message}: ${url}`);
12573
+ const invalidGoogleOAuthTokenSchema = (message) => new InvalidGoogleOAuthTokenException(message);
12529
12574
 
12530
- const jobSkillsSchema = objectType({
12531
- name: stringType(),
12532
- });
12533
- const vendorQualificationSchema = objectType({
12534
- location: stringType().nullable(),
12535
- talentType: z.enum(['Agency', 'Independent', 'unspecified']).nullable(),
12536
- englishLevel: stringType().nullable(),
12537
- minimumEarnings: numberType().nullable(),
12538
- jobSuccessScore: stringType().nullable(),
12539
- includeRisingTalent: stringType().nullable(),
12540
- });
12541
- const clientInfoSchema = objectType({
12542
- isPaymentVerified: booleanType().nullable(),
12543
- isPhoneVerified: booleanType().nullable(),
12544
- numberOfReviews: numberType().nullable(),
12545
- rating: numberType().nullable(),
12546
- country: stringType().nullable(),
12547
- region: stringType().nullable(),
12548
- jobsPosted: numberType().nullable(),
12549
- totalSpent: numberType().nullable(),
12550
- numberOfHires: numberType().nullable(),
12551
- activeEngagements: numberType().nullable(),
12552
- openJobs: numberType().nullable(),
12553
- hireRate: numberType().nullable(),
12554
- memberSince: stringType().nullable(),
12555
- companyIndustry: stringType().nullable(),
12556
- companySize: stringType().nullable(),
12557
- enterpriseClient: booleanType().nullable(),
12558
- avgHourlyRatePaid: numberType().nullable(),
12559
- });
12560
- const clientReviewSchema = objectType({
12561
- jobTitle: stringType().nullable(),
12562
- freelancerName: stringType().nullable(),
12563
- freelancerRating: numberType().nullable(),
12564
- freelancerFeedback: stringType().nullable(),
12565
- clientFeedback: stringType().nullable(),
12566
- clientFeedbackRating: numberType().nullable(),
12567
- dateRange: stringType().nullable(),
12568
- paymentType: stringType().nullable(),
12569
- fixedPrice: numberType().nullable(),
12570
- hourlyRate: numberType().nullable(),
12571
- numHours: numberType().nullable(),
12572
- totalBilled: numberType().nullable(),
12573
- });
12574
- const bidRangeSchema = objectType({
12575
- high: numberType().nullable(),
12576
- avg: numberType().nullable(),
12577
- low: numberType().nullable(),
12578
- });
12579
- const jobActivitySchema = objectType({
12580
- proposals: objectType({
12581
- min: numberType().nullable(),
12582
- max: numberType().nullable(),
12583
- }),
12584
- lastViewedByClient: stringType().nullable(),
12585
- lastViewedByClientTimestamp: numberType().nullable(),
12586
- hires: numberType().nullable(),
12587
- interviewing: numberType().nullable(),
12588
- invitesSent: numberType().nullable(),
12589
- unansweredInvites: numberType().nullable(),
12590
- updatedAt: numberType().nullable(),
12591
- });
12592
- const jobActivityDeltaSchema = objectType({
12593
- proposals: numberType(),
12594
- interviewing: numberType(),
12595
- hires: numberType(),
12596
- invitesSent: numberType(),
12597
- unansweredInvites: numberType(),
12598
- });
12599
- const metadataSchema = objectType({
12600
- hours: stringType().nullable(),
12601
- duration: stringType().nullable(),
12602
- experienceLevel: stringType().nullable(),
12603
- hourlyRate: z
12604
- .object({
12605
- min: numberType().nullable(),
12606
- max: numberType().nullable(),
12607
- })
12608
- .nullable(),
12609
- paymentType: stringType().nullable(),
12610
- fixedPrice: numberType().nullable(),
12611
- });
12612
- const jobActivityOffsetHours = [4, 24];
12613
- const jobActivityOffsetEnum = z.enum(jobActivityOffsetHours.map((h) => `${h}h`));
12614
- const upworkJobSchema = objectType({
12615
- id: stringType().nullable(),
12616
- uid: stringType().nullable(),
12617
- createdAt: numberType().nullable(),
12618
- title: stringType().nullable(),
12619
- category: stringType().nullable(),
12620
- skills: arrayType(jobSkillsSchema).nullable(),
12621
- datetime: numberType().nullable(),
12622
- description: stringType().nullable(),
12623
- descriptionLength: numberType().nullable(),
12624
- connectsRequired: numberType().nullable(),
12625
- projectType: stringType().nullable(),
12626
- projectDuration: stringType().nullable(),
12627
- questions: arrayType(stringType()).nullable(),
12628
- jobUrl: stringType().nullable(),
12629
- metadata: metadataSchema.nullable(),
12630
- clientInfo: clientInfoSchema.nullable(),
12631
- vendorQualifications: vendorQualificationSchema.nullable(),
12632
- processed: booleanType().nullable(),
12633
- isFeatured: booleanType().nullable(),
12634
- clientReviews: arrayType(clientReviewSchema).nullable(),
12635
- region: regionSchema.nullable(),
12636
- bidRange: bidRangeSchema.nullable(),
12637
- jobActivity: jobActivitySchema.nullable(),
12638
- activityUpdates: z
12639
- .union([z.literal(1), z.literal(2), z.literal(3)])
12640
- .nullable(),
12641
- activity: recordType(jobActivityOffsetEnum, jobActivitySchema).nullish(),
12642
- activityDelta: jobActivityDeltaSchema.nullish(),
12643
- });
12644
- const jobActivityOffsetHourSchema = custom((val) => jobActivityOffsetHours.includes(val));
12645
- const jobActivityUpdateSchema = objectType({
12646
- jobUrl: stringType(),
12647
- data: jobActivitySchema,
12648
- offsetHour: jobActivityOffsetHourSchema,
12649
- scrapedAt: numberType(),
12575
+ class NoBidderAccountsAvailableException extends Error {
12576
+ code = 'NO_BIDDER_ACCOUNTS_AVAILABLE';
12577
+ constructor(message) {
12578
+ super(message);
12579
+ }
12580
+ }
12581
+ const noBidderAccountsAvailableException = (message) => {
12582
+ return new NoBidderAccountsAvailableException(message);
12583
+ };
12584
+
12585
+ class NoGoogleOAuthTokensFoundException extends Error {
12586
+ code = 'NO_GOOGLE_OAUTH_TOKENS_FOUND';
12587
+ constructor(message) {
12588
+ super(message);
12589
+ }
12590
+ }
12591
+ const noGoogleOAuthTokensFoundException = (message) => new NoGoogleOAuthTokensFoundException(message);
12592
+
12593
+ const scraperAccountType = z.enum([
12594
+ 'feed',
12595
+ 'job',
12596
+ 'status',
12597
+ 'activity',
12598
+ 'profile',
12599
+ 'unauthenticated',
12600
+ ]);
12601
+ const scraperAccountRegionEnum = z.enum([
12602
+ 'Worldwide',
12603
+ 'UKOnly',
12604
+ 'USOnly',
12605
+ ]);
12606
+ const scraperAccountSchema = z.object({
12607
+ id: z.string(),
12608
+ isActive: z.boolean(),
12609
+ region: scraperAccountRegionEnum,
12610
+ email: z.string().email(),
12611
+ password: z.string(),
12612
+ securityQuestionAnswer: z.string().nullable(),
12613
+ lastUsed: z.number().nullable(),
12614
+ multiloginProfileId: z.string().nullable(),
12615
+ proxyId: z.string().nullable(),
12616
+ type: scraperAccountType,
12617
+ createdAt: z.number(),
12618
+ updatedAt: z.number(),
12619
+ isProtected: z.boolean().optional(),
12650
12620
  });
12651
- const jobActivitySnapshotSchema = objectType({
12652
- jobUrl: stringType(),
12653
- activity: jobActivitySchema,
12654
- postedAt: numberType(),
12655
- scrapedAt: numberType(),
12656
- hoursSincePosted: numberType(),
12621
+ const createScraperAccountSchema = scraperAccountSchema
12622
+ .pick({
12623
+ region: true,
12624
+ email: true,
12625
+ password: true,
12626
+ securityQuestionAnswer: true,
12627
+ isActive: true,
12628
+ type: true,
12629
+ })
12630
+ .extend({
12631
+ proxyCountry: proxyCountryEnum.optional(),
12632
+ rotatingProxy: z.boolean().optional(),
12657
12633
  });
12658
- const feedJobSchema = objectType({
12659
- uid: stringType().nullable(),
12660
- title: stringType().nullable(),
12661
- jobUrl: stringType().nullable(),
12662
- datetime: stringType().nullable(),
12663
- isFeatured: booleanType().nullable(),
12664
- region: regionSchema.nullable(),
12634
+ const updateScraperAccountSchema = scraperAccountSchema
12635
+ .omit({
12636
+ id: true,
12637
+ })
12638
+ .partial();
12639
+
12640
+ const agentStatusSchema = z.enum([
12641
+ "suitabilityPending",
12642
+ "suitabilityProcessing",
12643
+ "suitabilityComplete",
12644
+ "suitabilityFailed",
12645
+ "proposalProcessing",
12646
+ "proposalComplete",
12647
+ "proposalFailed",
12648
+ "biddingProcessing",
12649
+ "biddingComplete",
12650
+ "biddingFailed",
12651
+ "jobArchived",
12652
+ ]);
12653
+ const leadStatusSchema = z.enum([
12654
+ "leads",
12655
+ "contacted",
12656
+ "viewed",
12657
+ "replied",
12658
+ "won",
12659
+ ]);
12660
+ const updateLeadStatusSchema = z.object({
12661
+ leadId: z.string(),
12662
+ organizationId: z.string(),
12663
+ campaignId: z.string(),
12664
+ status: leadStatusSchema,
12665
+ proposalId: z.string().optional(),
12666
+ userId: z.string().optional(),
12667
+ wonAmount: z.number().optional(),
12665
12668
  });
12666
12669
 
12667
12670
  const questionAnswerPairSchema = z.object({
@@ -13558,7 +13561,8 @@ const agentGenerateProposalRequestSchema = z.object({
13558
13561
  organizationId: z.string(),
13559
13562
  campaignId: z.string(),
13560
13563
  job: z.object({
13561
- id: z.string(),
13564
+ leadId: z.string(),
13565
+ jobId: z.string(),
13562
13566
  title: z.string(),
13563
13567
  description: z.string(),
13564
13568
  questions: z.array(z.string()),
@@ -14736,6 +14740,7 @@ exports.puppeteerConnectionErrorException = puppeteerConnectionErrorException;
14736
14740
  exports.questionAnswerPairSchema = questionAnswerPairSchema;
14737
14741
  exports.questionPairNotMatchingException = questionPairNotMatchingException;
14738
14742
  exports.questionRulesSchema = questionRulesSchema;
14743
+ exports.refreshRotatingProxiesRequestBodySchema = refreshRotatingProxiesRequestBodySchema;
14739
14744
  exports.regionEnum = regionEnum;
14740
14745
  exports.regionMapping = regionMapping;
14741
14746
  exports.regionNames = regionNames;