lancer-shared 1.2.188 → 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.
@@ -12696,6 +12696,7 @@ const leadStatusEnum = z.enum([
12696
12696
  'insufficientConnects',
12697
12697
  'doesNotMeetCriteria',
12698
12698
  'syncedInAnotherCampaign',
12699
+ 'dailyLimitReached',
12699
12700
  'viewed',
12700
12701
  'replied',
12701
12702
  'won',
@@ -13079,7 +13080,7 @@ const campaignSchema = z.object({
13079
13080
  filters: jobFiltersSchema,
13080
13081
  createdAt: numberType(),
13081
13082
  updatedAt: numberType(),
13082
- confirmedBillingAt: numberType().nullable(),
13083
+ confirmedBillingAt: z.number().nullable(),
13083
13084
  // automatedSuitability: z.boolean().nullable(),
13084
13085
  boostingEnabled: z.boolean().nullable().default(false),
13085
13086
  maximumBoost: z.number().nullable().default(30),
@@ -13105,7 +13106,12 @@ const campaignSchema = z.object({
13105
13106
  priority: z.number().nullable(),
13106
13107
  coverLetterTemplate: coverLetterTemplateSchema.nullable(),
13107
13108
  organizationProfileId: z.string().nullable(),
13108
- 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
+ }),
13109
13115
  });
13110
13116
  const upworkAccountConnectStatusSchema = z.union([
13111
13117
  z.literal('processing'),
@@ -13258,6 +13264,7 @@ const updateCampaignAnalyticsSchema = z.object({
13258
13264
  'replied',
13259
13265
  'doesNotMeetCriteria',
13260
13266
  'syncedInAnotherCampaign',
13267
+ 'dailyLimitReached',
13261
13268
  'insufficientConnects',
13262
13269
  'won',
13263
13270
  'leadsAnalyzed',
@@ -13373,6 +13380,149 @@ const campaignInsightsSchema = z.object({
13373
13380
  suitabilityRange90to100: z.number(),
13374
13381
  });
13375
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
+
13376
13526
  const bidPayloadProposalDataSchema = z.object({
13377
13527
  organizationId: z.string(),
13378
13528
  campaignId: z.string(),
@@ -23114,6 +23264,7 @@ exports.FeedScrapeException = FeedScrapeException;
23114
23264
  exports.GetMultiloginBrowserException = GetMultiloginBrowserException;
23115
23265
  exports.GoToUrlException = GoToUrlException;
23116
23266
  exports.HIERARCHICAL_CATEGORIES_TO_CHILDREN = HIERARCHICAL_CATEGORIES_TO_CHILDREN;
23267
+ exports.INFINITY = INFINITY;
23117
23268
  exports.IncorrectSecurityQuestionAnswerException = IncorrectSecurityQuestionAnswerException;
23118
23269
  exports.InitBrowserException = InitBrowserException;
23119
23270
  exports.InsufficientConnectsException = InsufficientConnectsException;
@@ -23155,6 +23306,11 @@ exports.acceptUpworkInvitationSchema = acceptUpworkInvitationSchema;
23155
23306
  exports.accountStatusDisplayMap = accountStatusDisplayMap;
23156
23307
  exports.accountStatusOrder = accountStatusOrder;
23157
23308
  exports.accountStatusSchema = accountStatusSchema;
23309
+ exports.addFromClientHireRateNodeFormSchema = addFromClientHireRateNodeFormSchema;
23310
+ exports.addFromClientSizeNodeFormSchema = addFromClientSizeNodeFormSchema;
23311
+ exports.addFromClientSpentNodeFormSchema = addFromClientSpentNodeFormSchema;
23312
+ exports.addFromHourlyRateNodeFormSchema = addFromHourlyRateNodeFormSchema;
23313
+ exports.addFromSuitabilityNodeFormSchema = addFromSuitabilityNodeFormSchema;
23158
23314
  exports.agencyBidPayloadSchema = agencyBidPayloadSchema;
23159
23315
  exports.agencyBidProposalDataSchema = agencyBidProposalDataSchema;
23160
23316
  exports.agentCalculateSuitabilityRequestSchema = agentCalculateSuitabilityRequestSchema;
@@ -23186,6 +23342,7 @@ exports.biddingFailedEventMetadata = biddingFailedEventMetadata;
23186
23342
  exports.biddingHourlyRateStrategyEnum = biddingHourlyRateStrategyEnum;
23187
23343
  exports.biddingRejectedWithFeedbackEventMetadata = biddingRejectedWithFeedbackEventMetadata;
23188
23344
  exports.booleanSchema = booleanSchema;
23345
+ exports.boostFormSchema = boostFormSchema;
23189
23346
  exports.buildRoute = buildRoute;
23190
23347
  exports.campaignAIMetricsSchema = campaignAIMetricsSchema;
23191
23348
  exports.campaignActivityCreateSchema = campaignActivityCreateSchema;
@@ -23220,10 +23377,15 @@ exports.coverLetterTemplateSchema = coverLetterTemplateSchema;
23220
23377
  exports.createBidderAccountSchema = createBidderAccountSchema;
23221
23378
  exports.createCampaignSchema = createCampaignSchema;
23222
23379
  exports.createChatbotSchema = createChatbotSchema;
23380
+ exports.createClientHireRateFormSchema = createClientHireRateFormSchema;
23381
+ exports.createClientSizeFormSchema = createClientSizeFormSchema;
23382
+ exports.createClientSpentFormSchema = createClientSpentFormSchema;
23223
23383
  exports.createCoverLetterTemplateSchema = createCoverLetterTemplateSchema;
23384
+ exports.createHourlyRateFormSchema = createHourlyRateFormSchema;
23224
23385
  exports.createOrganizationProfileSchema = createOrganizationProfileSchema;
23225
23386
  exports.createOrganizationSchema = createOrganizationSchema;
23226
23387
  exports.createScraperAccountSchema = createScraperAccountSchema;
23388
+ exports.createSuitabilityFormSchema = createSuitabilityFormSchema;
23227
23389
  exports.dailyUsageSchema = dailyUsageSchema;
23228
23390
  exports.dateSchema = dateSchema;
23229
23391
  exports.deleteMultiloginProfileException = deleteMultiloginProfileException;
@@ -23324,6 +23486,7 @@ exports.newPageException = newPageException;
23324
23486
  exports.noBidderAccountsAvailableException = noBidderAccountsAvailableException;
23325
23487
  exports.noGoogleOAuthTokensFoundException = noGoogleOAuthTokensFoundException;
23326
23488
  exports.noScraperAccountAvailableException = noScraperAccountAvailableException;
23489
+ exports.nodeEnums = nodeEnums;
23327
23490
  exports.notificationConfigSchema = notificationConfigSchema;
23328
23491
  exports.nuxtStateJobDetailsSchema = nuxtStateJobDetailsSchema;
23329
23492
  exports.nuxtStateJobSchema = nuxtStateJobSchema;
@@ -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;