lancer-shared 1.2.187 → 1.2.189

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.
@@ -6557,6 +6557,7 @@ const ROUTES = {
6557
6557
  TRACK_USAGE: (id) => `organizations/${id}/track-usage`,
6558
6558
  SUBSCRIBE: (id) => `organizations/${id}/subscribe`,
6559
6559
  BUY_US_BIDDER_ACCOUNT: (id) => `organizations/${id}/buy-us-bidder-account`,
6560
+ PAUSE_CAMPAIGNS: (id) => `organizations/${id}/pause-campaigns`,
6560
6561
  BIDDER_ACCOUNTS: {
6561
6562
  BASE: (id) => `organizations/${id}/bidder-accounts`,
6562
6563
  BY_ID: (id, bidderId) => `organizations/${id}/bidder-accounts/${bidderId}`,
@@ -12695,6 +12696,7 @@ const leadStatusEnum = z.enum([
12695
12696
  'insufficientConnects',
12696
12697
  'doesNotMeetCriteria',
12697
12698
  'syncedInAnotherCampaign',
12699
+ 'dailyLimitReached',
12698
12700
  'viewed',
12699
12701
  'replied',
12700
12702
  'won',
@@ -13078,7 +13080,7 @@ const campaignSchema = z.object({
13078
13080
  filters: jobFiltersSchema,
13079
13081
  createdAt: numberType(),
13080
13082
  updatedAt: numberType(),
13081
- confirmedBillingAt: numberType().nullable(),
13083
+ confirmedBillingAt: z.number().nullable(),
13082
13084
  // automatedSuitability: z.boolean().nullable(),
13083
13085
  boostingEnabled: z.boolean().nullable().default(false),
13084
13086
  maximumBoost: z.number().nullable().default(30),
@@ -13104,7 +13106,12 @@ const campaignSchema = z.object({
13104
13106
  priority: z.number().nullable(),
13105
13107
  coverLetterTemplate: coverLetterTemplateSchema.nullable(),
13106
13108
  organizationProfileId: z.string().nullable(),
13107
- lastSyncedProposalsAt: numberType().nullable(),
13109
+ lastSyncedProposalsAt: z.number().nullable(),
13110
+ limits: z.object({
13111
+ maxDailyProposalsSent: z.number().min(1),
13112
+ enabled: z.boolean(),
13113
+ windowAnchorAt: z.number().nullable(),
13114
+ }),
13108
13115
  });
13109
13116
  const upworkAccountConnectStatusSchema = z.union([
13110
13117
  z.literal('processing'),
@@ -13257,6 +13264,7 @@ const updateCampaignAnalyticsSchema = z.object({
13257
13264
  'replied',
13258
13265
  'doesNotMeetCriteria',
13259
13266
  'syncedInAnotherCampaign',
13267
+ 'dailyLimitReached',
13260
13268
  'insufficientConnects',
13261
13269
  'won',
13262
13270
  'leadsAnalyzed',
@@ -13372,6 +13380,149 @@ const campaignInsightsSchema = z.object({
13372
13380
  suitabilityRange90to100: z.number(),
13373
13381
  });
13374
13382
 
13383
+ const fallbackEnum = z.enum(['noBoostBid', 'ignore']);
13384
+ const boostFormSchema = z.object({
13385
+ minPlace: z.number().int().min(1).max(4), // Don't boost below this place
13386
+ maxConnects: z.number().int().min(1), // Maximum connects willing to spend
13387
+ fallback: fallbackEnum, // What to do if no place fits budget
13388
+ });
13389
+
13390
+ const nodeEnums = z.enum([
13391
+ 'clientAvgHourlyRateNode',
13392
+ 'bidNode',
13393
+ 'suitabilityNode',
13394
+ 'clientHireRateNode',
13395
+ 'clientSizeNode',
13396
+ 'boostNode',
13397
+ 'clientSpentNode',
13398
+ ]);
13399
+
13400
+ const sizeOverlap = (size1, size2) => {
13401
+ if (size1 === size2) {
13402
+ return true;
13403
+ }
13404
+ return false;
13405
+ };
13406
+ const createClientSizeFormSchema = (existingSizes) => z
13407
+ .object({
13408
+ sizes: z.array(clientSizeEnum).min(1),
13409
+ action: nodeEnums,
13410
+ })
13411
+ .refine((data) => {
13412
+ const newSizes = data.sizes;
13413
+ return !existingSizes.some((existingSize) => newSizes.some((newSize) => sizeOverlap(newSize, existingSize)));
13414
+ }, {
13415
+ message: 'Size overlaps with existing size',
13416
+ path: ['sizes'],
13417
+ });
13418
+ const addFromClientSizeNodeFormSchema = createClientSizeFormSchema([]);
13419
+
13420
+ const INFINITY = 99999999999;
13421
+ const rangesOverlap$3 = (range1, range2) => {
13422
+ return range1.from < range2.to && range2.from < range1.to;
13423
+ };
13424
+ const createClientSpentFormSchema = (existingRanges) => z
13425
+ .object({
13426
+ from: z.number().min(0),
13427
+ to: z.number().min(0),
13428
+ action: nodeEnums,
13429
+ })
13430
+ .refine((data) => data.from < data.to, {
13431
+ message: 'From must be less than To',
13432
+ path: ['from'],
13433
+ })
13434
+ .refine((data) => data.to > data.from, {
13435
+ message: 'To must be greater than From',
13436
+ path: ['to'],
13437
+ })
13438
+ .refine((data) => {
13439
+ const newRange = { from: data.from, to: data.to };
13440
+ return !existingRanges.some((existingRange) => rangesOverlap$3(newRange, existingRange));
13441
+ }, {
13442
+ message: 'Range overlaps with existing range',
13443
+ path: ['from'],
13444
+ });
13445
+ const addFromClientSpentNodeFormSchema = createClientSpentFormSchema([]);
13446
+
13447
+ const rangesOverlap$2 = (range1, range2) => {
13448
+ return range1.from < range2.to && range2.from < range1.to;
13449
+ };
13450
+ const createClientHireRateFormSchema = (existingRanges) => z
13451
+ .object({
13452
+ from: z.number().min(0),
13453
+ to: z.number().min(0),
13454
+ action: nodeEnums,
13455
+ })
13456
+ .refine((data) => data.from < data.to, {
13457
+ message: 'From must be less than To',
13458
+ path: ['from'],
13459
+ })
13460
+ .refine((data) => data.to > data.from, {
13461
+ message: 'To must be greater than From',
13462
+ path: ['to'],
13463
+ })
13464
+ .refine((data) => {
13465
+ const newRange = { from: data.from, to: data.to };
13466
+ return !existingRanges.some((existingRange) => rangesOverlap$2(newRange, existingRange));
13467
+ }, {
13468
+ message: 'Range overlaps with existing range',
13469
+ path: ['from'],
13470
+ });
13471
+ const addFromClientHireRateNodeFormSchema = createClientHireRateFormSchema([]);
13472
+
13473
+ const rangesOverlap$1 = (range1, range2) => {
13474
+ return range1.from < range2.to && range2.from < range1.to;
13475
+ };
13476
+ const createHourlyRateFormSchema = (existingRanges) => z
13477
+ .object({
13478
+ from: z.number().min(0),
13479
+ to: z.number().min(0),
13480
+ action: nodeEnums,
13481
+ })
13482
+ .refine((data) => data.from < data.to, {
13483
+ message: 'From must be less than To',
13484
+ path: ['from'],
13485
+ })
13486
+ .refine((data) => data.to > data.from, {
13487
+ message: 'To must be greater than From',
13488
+ path: ['to'],
13489
+ })
13490
+ .refine((data) => {
13491
+ const newRange = { from: data.from, to: data.to };
13492
+ return !existingRanges.some((existingRange) => rangesOverlap$1(newRange, existingRange));
13493
+ }, {
13494
+ message: 'Range overlaps with existing range',
13495
+ path: ['from'],
13496
+ });
13497
+ // Keep the original schema for backwards compatibility if needed
13498
+ const addFromHourlyRateNodeFormSchema = createHourlyRateFormSchema([]);
13499
+
13500
+ const rangesOverlap = (range1, range2) => {
13501
+ return range1.from < range2.to && range2.from < range1.to;
13502
+ };
13503
+ const createSuitabilityFormSchema = (existingRanges) => z
13504
+ .object({
13505
+ from: z.number().min(0).max(99),
13506
+ to: z.number().min(1).max(100),
13507
+ action: nodeEnums,
13508
+ })
13509
+ .refine((data) => data.from < data.to, {
13510
+ message: 'From must be less than To',
13511
+ path: ['from'],
13512
+ })
13513
+ .refine((data) => data.to > data.from, {
13514
+ message: 'To must be greater than From',
13515
+ path: ['to'],
13516
+ })
13517
+ .refine((data) => {
13518
+ const newRange = { from: data.from, to: data.to };
13519
+ return !existingRanges.some((existingRange) => rangesOverlap(newRange, existingRange));
13520
+ }, {
13521
+ message: 'Range overlaps with existing range',
13522
+ path: ['from'],
13523
+ });
13524
+ const addFromSuitabilityNodeFormSchema = createSuitabilityFormSchema([]);
13525
+
13375
13526
  const bidPayloadProposalDataSchema = z.object({
13376
13527
  organizationId: z.string(),
13377
13528
  campaignId: z.string(),
@@ -23113,6 +23264,7 @@ exports.FeedScrapeException = FeedScrapeException;
23113
23264
  exports.GetMultiloginBrowserException = GetMultiloginBrowserException;
23114
23265
  exports.GoToUrlException = GoToUrlException;
23115
23266
  exports.HIERARCHICAL_CATEGORIES_TO_CHILDREN = HIERARCHICAL_CATEGORIES_TO_CHILDREN;
23267
+ exports.INFINITY = INFINITY;
23116
23268
  exports.IncorrectSecurityQuestionAnswerException = IncorrectSecurityQuestionAnswerException;
23117
23269
  exports.InitBrowserException = InitBrowserException;
23118
23270
  exports.InsufficientConnectsException = InsufficientConnectsException;
@@ -23154,6 +23306,11 @@ exports.acceptUpworkInvitationSchema = acceptUpworkInvitationSchema;
23154
23306
  exports.accountStatusDisplayMap = accountStatusDisplayMap;
23155
23307
  exports.accountStatusOrder = accountStatusOrder;
23156
23308
  exports.accountStatusSchema = accountStatusSchema;
23309
+ exports.addFromClientHireRateNodeFormSchema = addFromClientHireRateNodeFormSchema;
23310
+ exports.addFromClientSizeNodeFormSchema = addFromClientSizeNodeFormSchema;
23311
+ exports.addFromClientSpentNodeFormSchema = addFromClientSpentNodeFormSchema;
23312
+ exports.addFromHourlyRateNodeFormSchema = addFromHourlyRateNodeFormSchema;
23313
+ exports.addFromSuitabilityNodeFormSchema = addFromSuitabilityNodeFormSchema;
23157
23314
  exports.agencyBidPayloadSchema = agencyBidPayloadSchema;
23158
23315
  exports.agencyBidProposalDataSchema = agencyBidProposalDataSchema;
23159
23316
  exports.agentCalculateSuitabilityRequestSchema = agentCalculateSuitabilityRequestSchema;
@@ -23185,6 +23342,7 @@ exports.biddingFailedEventMetadata = biddingFailedEventMetadata;
23185
23342
  exports.biddingHourlyRateStrategyEnum = biddingHourlyRateStrategyEnum;
23186
23343
  exports.biddingRejectedWithFeedbackEventMetadata = biddingRejectedWithFeedbackEventMetadata;
23187
23344
  exports.booleanSchema = booleanSchema;
23345
+ exports.boostFormSchema = boostFormSchema;
23188
23346
  exports.buildRoute = buildRoute;
23189
23347
  exports.campaignAIMetricsSchema = campaignAIMetricsSchema;
23190
23348
  exports.campaignActivityCreateSchema = campaignActivityCreateSchema;
@@ -23219,10 +23377,15 @@ exports.coverLetterTemplateSchema = coverLetterTemplateSchema;
23219
23377
  exports.createBidderAccountSchema = createBidderAccountSchema;
23220
23378
  exports.createCampaignSchema = createCampaignSchema;
23221
23379
  exports.createChatbotSchema = createChatbotSchema;
23380
+ exports.createClientHireRateFormSchema = createClientHireRateFormSchema;
23381
+ exports.createClientSizeFormSchema = createClientSizeFormSchema;
23382
+ exports.createClientSpentFormSchema = createClientSpentFormSchema;
23222
23383
  exports.createCoverLetterTemplateSchema = createCoverLetterTemplateSchema;
23384
+ exports.createHourlyRateFormSchema = createHourlyRateFormSchema;
23223
23385
  exports.createOrganizationProfileSchema = createOrganizationProfileSchema;
23224
23386
  exports.createOrganizationSchema = createOrganizationSchema;
23225
23387
  exports.createScraperAccountSchema = createScraperAccountSchema;
23388
+ exports.createSuitabilityFormSchema = createSuitabilityFormSchema;
23226
23389
  exports.dailyUsageSchema = dailyUsageSchema;
23227
23390
  exports.dateSchema = dateSchema;
23228
23391
  exports.deleteMultiloginProfileException = deleteMultiloginProfileException;
@@ -23323,6 +23486,7 @@ exports.newPageException = newPageException;
23323
23486
  exports.noBidderAccountsAvailableException = noBidderAccountsAvailableException;
23324
23487
  exports.noGoogleOAuthTokensFoundException = noGoogleOAuthTokensFoundException;
23325
23488
  exports.noScraperAccountAvailableException = noScraperAccountAvailableException;
23489
+ exports.nodeEnums = nodeEnums;
23326
23490
  exports.notificationConfigSchema = notificationConfigSchema;
23327
23491
  exports.nuxtStateJobDetailsSchema = nuxtStateJobDetailsSchema;
23328
23492
  exports.nuxtStateJobSchema = nuxtStateJobSchema;
@@ -134,6 +134,7 @@ export declare const ROUTES: {
134
134
  readonly TRACK_USAGE: (id: string) => string;
135
135
  readonly SUBSCRIBE: (id: string) => string;
136
136
  readonly BUY_US_BIDDER_ACCOUNT: (id: string) => string;
137
+ readonly PAUSE_CAMPAIGNS: (id: string) => string;
137
138
  readonly BIDDER_ACCOUNTS: {
138
139
  readonly BASE: (id: string) => string;
139
140
  readonly BY_ID: (id: string, bidderId: string) => string;
@@ -419,7 +419,7 @@ export declare const agentCalculateSuitabilityRequestSchema: z.ZodObject<{
419
419
  answer: string;
420
420
  }>, "many">>;
421
421
  agentStatus: z.ZodNullable<z.ZodEnum<["suitabilityPending", "suitabilityProcessing", "suitabilityComplete", "suitabilityFailed", "proposalProcessing", "proposalComplete", "proposalFailed", "biddingProcessing", "biddingComplete", "biddingFailed", "jobArchived"]>>;
422
- leadStatus: z.ZodNullable<z.ZodEnum<["leads", "contacted", "insufficientConnects", "doesNotMeetCriteria", "syncedInAnotherCampaign", "viewed", "replied", "won"]>>;
422
+ leadStatus: z.ZodNullable<z.ZodEnum<["leads", "contacted", "insufficientConnects", "doesNotMeetCriteria", "syncedInAnotherCampaign", "dailyLimitReached", "viewed", "replied", "won"]>>;
423
423
  biddingAmount: z.ZodNullable<z.ZodNumber>;
424
424
  boosted: z.ZodNullable<z.ZodBoolean>;
425
425
  boostingAmount: z.ZodNullable<z.ZodNumber>;
@@ -533,7 +533,7 @@ export declare const agentCalculateSuitabilityRequestSchema: z.ZodObject<{
533
533
  suitabilityReason: string | null;
534
534
  proposal: string | null;
535
535
  agentStatus: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
536
- leadStatus: "leads" | "contacted" | "insufficientConnects" | "doesNotMeetCriteria" | "syncedInAnotherCampaign" | "viewed" | "replied" | "won" | null;
536
+ leadStatus: "leads" | "contacted" | "insufficientConnects" | "doesNotMeetCriteria" | "syncedInAnotherCampaign" | "dailyLimitReached" | "viewed" | "replied" | "won" | null;
537
537
  biddingAmount: number | null;
538
538
  boosted: boolean | null;
539
539
  boostingAmount: number | null;
@@ -668,7 +668,7 @@ export declare const agentCalculateSuitabilityRequestSchema: z.ZodObject<{
668
668
  suitabilityReason: string | null;
669
669
  proposal: string | null;
670
670
  agentStatus: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
671
- leadStatus: "leads" | "contacted" | "insufficientConnects" | "doesNotMeetCriteria" | "syncedInAnotherCampaign" | "viewed" | "replied" | "won" | null;
671
+ leadStatus: "leads" | "contacted" | "insufficientConnects" | "doesNotMeetCriteria" | "syncedInAnotherCampaign" | "dailyLimitReached" | "viewed" | "replied" | "won" | null;
672
672
  biddingAmount: number | null;
673
673
  boosted: boolean | null;
674
674
  boostingAmount: number | null;
@@ -819,7 +819,7 @@ export declare const agentCalculateSuitabilityRequestSchema: z.ZodObject<{
819
819
  suitabilityReason: string | null;
820
820
  proposal: string | null;
821
821
  agentStatus: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
822
- leadStatus: "leads" | "contacted" | "insufficientConnects" | "doesNotMeetCriteria" | "syncedInAnotherCampaign" | "viewed" | "replied" | "won" | null;
822
+ leadStatus: "leads" | "contacted" | "insufficientConnects" | "doesNotMeetCriteria" | "syncedInAnotherCampaign" | "dailyLimitReached" | "viewed" | "replied" | "won" | null;
823
823
  biddingAmount: number | null;
824
824
  boosted: boolean | null;
825
825
  boostingAmount: number | null;
@@ -964,7 +964,7 @@ export declare const agentCalculateSuitabilityRequestSchema: z.ZodObject<{
964
964
  suitabilityReason: string | null;
965
965
  proposal: string | null;
966
966
  agentStatus: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalProcessing" | "proposalComplete" | "proposalFailed" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
967
- leadStatus: "leads" | "contacted" | "insufficientConnects" | "doesNotMeetCriteria" | "syncedInAnotherCampaign" | "viewed" | "replied" | "won" | null;
967
+ leadStatus: "leads" | "contacted" | "insufficientConnects" | "doesNotMeetCriteria" | "syncedInAnotherCampaign" | "dailyLimitReached" | "viewed" | "replied" | "won" | null;
968
968
  biddingAmount: number | null;
969
969
  boosted: boolean | null;
970
970
  boostingAmount: number | null;