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
@@ -5280,15 +5280,6 @@ const updateScraperAccountSchema = scraperAccountSchema
5280
5280
  })
5281
5281
  .partial();
5282
5282
 
5283
- const systemPromptSchema = objectType({
5284
- suitability: stringType(),
5285
- proposal: stringType(),
5286
- questionHandlingGuidelines: stringType(),
5287
- });
5288
- const systemSchema = objectType({
5289
- prompts: systemPromptSchema,
5290
- });
5291
-
5292
5283
  const agentStatusSchema = z.enum([
5293
5284
  "suitabilityPending",
5294
5285
  "suitabilityProcessing",
@@ -5358,180 +5349,6 @@ const findLeadsResponseSchema = z.object({
5358
5349
  error: z.string().optional(),
5359
5350
  });
5360
5351
 
5361
- const bidPayloadProposalDataSchema = z.object({
5362
- coverLetter: z.string(),
5363
- questionAnswerPairs: questionAnswerPairSchema.array().nullable(),
5364
- boostingEnabled: z.boolean(),
5365
- minimumBoost: z.number().nullable(),
5366
- maximumBoost: z.number().nullable(),
5367
- });
5368
- const freelancerBidProposalDataSchema = bidPayloadProposalDataSchema;
5369
- const agencyBidProposalDataSchema = bidPayloadProposalDataSchema.extend({
5370
- agencyName: z.string(),
5371
- contractorName: z.string(),
5372
- specializedProfile: z.string().nullable(),
5373
- });
5374
- const bidPayloadSchema = z.object({
5375
- jobUrl: z.string(),
5376
- username: z.string(),
5377
- password: z.string(),
5378
- });
5379
- const agencyBidPayloadSchema = bidPayloadSchema.extend({
5380
- proposalData: agencyBidProposalDataSchema,
5381
- });
5382
- const freelancerBidPayloadSchema = bidPayloadSchema.extend({
5383
- proposalData: freelancerBidProposalDataSchema,
5384
- });
5385
- const bidDtoSchema = z.object({
5386
- organizationId: z.string(),
5387
- campaignId: z.string(),
5388
- leadId: z.string(),
5389
- });
5390
-
5391
- const bidSuccessSchema = z.object({
5392
- status: z.literal("success"),
5393
- biddingAmount: z.number(),
5394
- boosted: z.boolean(),
5395
- boostingAmount: z.number(),
5396
- });
5397
- const bidFailedSchema = z.object({
5398
- status: z.literal("failed"),
5399
- errorMessage: z.string(),
5400
- });
5401
-
5402
- const campaignExpensesSchema = z.object({
5403
- biddingAmount: z.number().default(0),
5404
- boostingAmount: z.number().default(0),
5405
- boosted: z.number().default(0),
5406
- });
5407
-
5408
- const campaignIntegrations = z.enum(["discord", "slack"]);
5409
- const campaignIntegrationsSchema = z.object({
5410
- suitabilityHooks: z.object({
5411
- discord: z.string().url().nullable(),
5412
- slack: z.string().url().nullable(),
5413
- }),
5414
- proposalSentHooks: z.object({
5415
- discord: z.string().url().nullable(),
5416
- slack: z.string().url().nullable(),
5417
- }),
5418
- });
5419
- const updateCampaignIntegrationsSchema = campaignIntegrationsSchema.partial();
5420
-
5421
- const campaignStatusSchema = z.union([
5422
- z.literal("active"),
5423
- z.literal("draft"),
5424
- z.literal("paused"),
5425
- z.literal("error"),
5426
- ]);
5427
- const campaignSchema = z.object({
5428
- id: z.string(),
5429
- name: z.string(),
5430
- filters: jobFiltersSchema,
5431
- createdAt: numberType(),
5432
- updatedAt: numberType(),
5433
- confirmedBillingAt: numberType().nullable(),
5434
- automatedSuitability: z.boolean().nullable(),
5435
- automatedBidding: z.boolean().nullable(),
5436
- boostingEnabled: z.boolean().nullable().default(false),
5437
- maximumBoost: z.number().nullable().default(30),
5438
- minimumBoost: z.number().nullable().default(0),
5439
- webhookUrl: z.string().nullable(),
5440
- monthlyBudget: z.number().nullable(),
5441
- suitabilityThreshold: z.number().min(0).max(100).nullable().default(0),
5442
- boostingThreshold: z.number().min(0).max(100).nullable().default(0),
5443
- leadCounts: z.record(leadStatusSchema, z.number()).nullable(),
5444
- expenses: campaignExpensesSchema,
5445
- integrations: campaignIntegrationsSchema,
5446
- status: campaignStatusSchema.optional(),
5447
- });
5448
- const createCampaignSchema = campaignSchema.omit({
5449
- id: true,
5450
- createdAt: true,
5451
- updatedAt: true,
5452
- });
5453
- const updateCampaignSchema = campaignSchema.omit({
5454
- createdAt: true,
5455
- updatedAt: true,
5456
- });
5457
-
5458
- const campaignCountByStatusSchema = z.object({
5459
- // Using z.enum values to create a schema with all possible job statuses
5460
- ...Object.fromEntries(Object.values(agentStatusSchema.enum).map((status) => [
5461
- status,
5462
- z.object({
5463
- boosted: z.number(),
5464
- organic: z.number(),
5465
- total: z.number(),
5466
- }),
5467
- ])),
5468
- });
5469
- const campaignInsightsSchema = z.object({
5470
- pipelineHealth: campaignCountByStatusSchema,
5471
- biddingAmount: z.number().default(0),
5472
- boostingAmount: z.number().default(0),
5473
- boostedProposalsCount: z.number().default(0),
5474
- totalProposalsCount: z.number().default(0),
5475
- totalExpenses: z.number().default(0),
5476
- suitabilityRange0to10: z.number(),
5477
- suitabilityRange10to20: z.number(),
5478
- suitabilityRange20to30: z.number(),
5479
- suitabilityRange30to40: z.number(),
5480
- suitabilityRange40to50: z.number(),
5481
- suitabilityRange50to60: z.number(),
5482
- suitabilityRange60to70: z.number(),
5483
- suitabilityRange70to80: z.number(),
5484
- suitabilityRange80to90: z.number(),
5485
- suitabilityRange90to100: z.number(),
5486
- });
5487
-
5488
- const campaignAnalyticsStatsSchema = z.object({
5489
- jobsAnalyzed: z.number(),
5490
- totalStats: z.object({
5491
- contacted: z.number(),
5492
- viewed: z.number(),
5493
- replied: z.number(),
5494
- interview: z.number(),
5495
- won: z.number(),
5496
- }),
5497
- statsByDate: z.array(z.object({
5498
- label: z.string(),
5499
- contacted: z.number(),
5500
- viewed: z.number(),
5501
- replied: z.number(),
5502
- interview: z.number(),
5503
- won: z.number(),
5504
- })),
5505
- });
5506
- const campaignAnalyticsResponseSchema = z.object({
5507
- jobsAnalyzed: z.number(),
5508
- contacted: z.number(),
5509
- viewed: z.number(),
5510
- replied: z.number(),
5511
- negotiations: z.number(),
5512
- won: z.number(),
5513
- });
5514
- const campaignActivitySchema = z.object({
5515
- createdAt: z.number(),
5516
- status: leadStatusSchema,
5517
- job: upworkJobSchema.pick({
5518
- id: true,
5519
- title: true,
5520
- datetime: true,
5521
- jobUrl: true,
5522
- }),
5523
- });
5524
- const campaignActivityCreateSchema = campaignActivitySchema.pick({
5525
- status: true,
5526
- job: true,
5527
- });
5528
-
5529
- const campaignAIMetricsSchema = z.object({
5530
- leadsAnalyzed: z.number(),
5531
- leadsBidded: z.number(),
5532
- connectsSaved: z.number(),
5533
- });
5534
-
5535
5352
  const LogEventTypeEnum = z.enum([
5536
5353
  // Scraper Events
5537
5354
  "scraperStarted",
@@ -5647,122 +5464,441 @@ const biddingFailedEventMetadata = objectType({
5647
5464
  const biddingWarningAlertEventMetadata = objectType({
5648
5465
  warningMessage: stringType(),
5649
5466
  });
5650
- const biddingRetryEventMetadata = objectType({
5651
- errorMessage: stringType(),
5467
+ const biddingRetryEventMetadata = objectType({
5468
+ errorMessage: stringType(),
5469
+ });
5470
+ const leadStatusEventMetadata = objectType({
5471
+ campaignId: stringType(),
5472
+ organizationId: stringType(),
5473
+ leadId: stringType(),
5474
+ userId: stringType(),
5475
+ metadata: z.object({
5476
+ status: leadStatusSchema,
5477
+ proposalId: stringType().nullable(),
5478
+ }),
5479
+ });
5480
+
5481
+ const billingStripeMetadataSchema = objectType({
5482
+ customer: objectType({ id: stringType().nullable() }),
5483
+ });
5484
+ const billingSchema = objectType({
5485
+ savedCard: booleanType(),
5486
+ stripe: billingStripeMetadataSchema,
5487
+ });
5488
+
5489
+ const subscriptionStatusEnum = z.enum([
5490
+ "active",
5491
+ "trialing",
5492
+ "cancelled",
5493
+ "paused",
5494
+ "payment_pending",
5495
+ "payment_failed",
5496
+ ]);
5497
+ const subscriptionSourceEnum = z.enum(["stripe", "manual"]);
5498
+ const subscriptionStripeMetadataItemSchema = objectType({
5499
+ id: stringType(),
5500
+ price: objectType({
5501
+ id: stringType(),
5502
+ }),
5503
+ });
5504
+ const subscriptionStripeMetadataSchema = objectType({
5505
+ id: stringType(),
5506
+ items: arrayType(subscriptionStripeMetadataItemSchema),
5507
+ });
5508
+ const subscriptionSchema = objectType({
5509
+ planId: stringType(),
5510
+ status: subscriptionStatusEnum,
5511
+ startedAt: numberType(),
5512
+ currentPeriodEnd: numberType(),
5513
+ stripe: subscriptionStripeMetadataSchema,
5514
+ source: subscriptionSourceEnum,
5515
+ });
5516
+
5517
+ const organizationMemberRoleEnum = z.enum(["admin", "member"]);
5518
+ const organizationMemberSchema = objectType({
5519
+ role: organizationMemberRoleEnum,
5520
+ joinedAt: numberType(),
5521
+ invitedBy: stringType(),
5522
+ });
5523
+
5524
+ const onboardingProgressSchema = z.object({
5525
+ profileSetup: z.number(),
5526
+ campaignCreated: z.number(),
5527
+ filtersAdded: z.number(),
5528
+ rulesConfigured: z.number(), // 2 is completed, 1 is when the system generates ai config
5529
+ automationEnabled: z.number(),
5530
+ });
5531
+
5532
+ const bidConfigSchema = objectType({
5533
+ agencyName: stringType().nullable(),
5534
+ bidderId: stringType().nullable(),
5535
+ contractorName: stringType().nullable(),
5536
+ specialisedProfile: stringType().nullable(),
5537
+ });
5538
+ const organizationTypeSchema = z.enum(["agency", "freelancer"]);
5539
+ const organizationTierEnum = z.enum(["free", "premium"]);
5540
+ const limitsSchema = objectType({
5541
+ monthlyCredits: numberType(),
5542
+ usedCredits: numberType(),
5543
+ extraCredits: numberType(),
5544
+ });
5545
+ const organizationSchema = objectType({
5546
+ id: stringType(),
5547
+ name: stringType(),
5548
+ type: organizationTypeSchema,
5549
+ tierId: organizationTierEnum,
5550
+ subscription: subscriptionSchema.nullable(),
5551
+ bidConfig: bidConfigSchema,
5552
+ active: booleanType(),
5553
+ limits: limitsSchema,
5554
+ billing: billingSchema.nullable(),
5555
+ createdAt: numberType(),
5556
+ updatedAt: numberType(),
5557
+ });
5558
+ const createOrganizationSchema = organizationSchema.pick({
5559
+ name: true,
5560
+ type: true,
5561
+ tierId: true,
5562
+ });
5563
+ const trackUsageEventTypeEnum = LogEventTypeEnum.extract([
5564
+ "suitabilityComplete",
5565
+ "proposalComplete",
5566
+ "biddingComplete",
5567
+ ]);
5568
+ const trackUsagePayloadSchema = objectType({
5569
+ event: trackUsageEventTypeEnum,
5570
+ campaignId: stringType().nullish(),
5571
+ });
5572
+ const aiConfigOldSchema = objectType({
5573
+ id: stringType(),
5574
+ suitabilityPrompt: stringType().nullable(),
5575
+ proposalPrompt: stringType().nullable(),
5576
+ questionProposalPrompt: stringType().nullable(),
5577
+ knowledgeBase: stringType().nullable(),
5578
+ });
5579
+ const aiConfigSchema = objectType({
5580
+ suitabilityRules: stringType().nullable(),
5581
+ coverLetterRules: stringType().nullable(),
5582
+ coverLetterTemplate: stringType().nullable(),
5583
+ questionRules: stringType().nullable(),
5584
+ });
5585
+ const knowledgeBaseSchema = objectType({
5586
+ about: stringType(),
5587
+ caseStudies: stringType(),
5588
+ });
5589
+ const notificationConfigSchema = objectType({
5590
+ emailEnabled: booleanType(),
5591
+ discordWebhookUrl: stringType().nullable(),
5592
+ slackWebhookUrl: stringType().nullable(),
5593
+ });
5594
+ const organizationSettingsSchema = objectType({
5595
+ aiConfig: aiConfigSchema,
5596
+ knowledgeBase: knowledgeBaseSchema,
5597
+ notifications: notificationConfigSchema,
5598
+ });
5599
+ const subscribePayloadSchema = objectType({
5600
+ planId: stringType().min(1, "Plan id is required."),
5601
+ paymentMethodId: stringType().min(1, "Payment method is required."),
5602
+ });
5603
+
5604
+ const systemPromptSchema = objectType({
5605
+ suitability: stringType(),
5606
+ proposal: stringType(),
5607
+ questionHandlingGuidelines: stringType(),
5608
+ });
5609
+ const systemSchema = objectType({
5610
+ prompts: systemPromptSchema,
5611
+ });
5612
+
5613
+ const agentTaskRequestSchema = z.object({
5614
+ organizationId: z.string(),
5615
+ userId: z.string().optional(),
5616
+ campaignId: z.string().optional(),
5617
+ leadId: z.string(),
5618
+ aiConfig: aiConfigSchema,
5619
+ lead: leadSchema,
5620
+ });
5621
+ const testSystemPromptsRequestSchema = z.object({
5622
+ organizationId: z.string(),
5623
+ modelSuitability: z.string(),
5624
+ modelProposal: z.string(),
5625
+ systemPrompt: systemPromptSchema,
5626
+ aiConfig: aiConfigSchema,
5627
+ lead: leadSchema,
5628
+ });
5629
+ const generateKnowledgeBaseRequestSchema = z.object({
5630
+ profileUrl: z.string(),
5631
+ organizationId: z.string(),
5632
+ });
5633
+ const suitabilityRatingSchema = z.object({
5634
+ rating: z.number(),
5635
+ reason: z.string(),
5636
+ });
5637
+ const proposalSchema = z.object({
5638
+ coverLetter: z.string(),
5639
+ questionAnswerPairs: questionAnswerPairSchema.array(),
5640
+ });
5641
+ const agentTaskResponseSchema = z.object({
5642
+ result: z.union([suitabilityRatingSchema, proposalSchema]),
5643
+ model: z.string(),
5644
+ provider: z.string(),
5645
+ promptTokens: z.number(),
5646
+ completionTokens: z.number(),
5647
+ });
5648
+ const testSystemPromptsResponseSchema = z.object({
5649
+ proposal: z.object({
5650
+ result: proposalSchema,
5651
+ model: z.string(),
5652
+ provider: z.string(),
5653
+ promptTokens: z.number(),
5654
+ completionTokens: z.number(),
5655
+ }),
5656
+ suitability: z.object({
5657
+ result: suitabilityRatingSchema,
5658
+ model: z.string(),
5659
+ provider: z.string(),
5660
+ promptTokens: z.number(),
5661
+ completionTokens: z.number(),
5662
+ }),
5663
+ });
5664
+
5665
+ const bidPayloadProposalDataSchema = z.object({
5666
+ coverLetter: z.string(),
5667
+ questionAnswerPairs: questionAnswerPairSchema.array().nullable(),
5668
+ boostingEnabled: z.boolean(),
5669
+ minimumBoost: z.number().nullable(),
5670
+ maximumBoost: z.number().nullable(),
5671
+ });
5672
+ const freelancerBidProposalDataSchema = bidPayloadProposalDataSchema;
5673
+ const agencyBidProposalDataSchema = bidPayloadProposalDataSchema.extend({
5674
+ agencyName: z.string(),
5675
+ contractorName: z.string(),
5676
+ specializedProfile: z.string().nullable(),
5677
+ });
5678
+ const bidPayloadSchema = z.object({
5679
+ jobUrl: z.string(),
5680
+ username: z.string(),
5681
+ password: z.string(),
5682
+ });
5683
+ const agencyBidPayloadSchema = bidPayloadSchema.extend({
5684
+ proposalData: agencyBidProposalDataSchema,
5685
+ });
5686
+ const freelancerBidPayloadSchema = bidPayloadSchema.extend({
5687
+ proposalData: freelancerBidProposalDataSchema,
5688
+ });
5689
+ const bidDtoSchema = z.object({
5690
+ organizationId: z.string(),
5691
+ campaignId: z.string(),
5692
+ leadId: z.string(),
5693
+ });
5694
+
5695
+ const bidSuccessSchema = z.object({
5696
+ status: z.literal("success"),
5697
+ biddingAmount: z.number(),
5698
+ boosted: z.boolean(),
5699
+ boostingAmount: z.number(),
5700
+ });
5701
+ const bidFailedSchema = z.object({
5702
+ status: z.literal("failed"),
5703
+ errorMessage: z.string(),
5704
+ });
5705
+
5706
+ const campaignExpensesSchema = z.object({
5707
+ biddingAmount: z.number().default(0),
5708
+ boostingAmount: z.number().default(0),
5709
+ boosted: z.number().default(0),
5710
+ });
5711
+
5712
+ const campaignIntegrations = z.enum(["discord", "slack"]);
5713
+ const campaignIntegrationsSchema = z.object({
5714
+ suitabilityHooks: z.object({
5715
+ discord: z.string().url().nullable(),
5716
+ slack: z.string().url().nullable(),
5717
+ }),
5718
+ proposalSentHooks: z.object({
5719
+ discord: z.string().url().nullable(),
5720
+ slack: z.string().url().nullable(),
5721
+ }),
5722
+ });
5723
+ const updateCampaignIntegrationsSchema = campaignIntegrationsSchema.partial();
5724
+
5725
+ const campaignStatusSchema = z.union([
5726
+ z.literal("active"),
5727
+ z.literal("draft"),
5728
+ z.literal("paused"),
5729
+ z.literal("error"),
5730
+ ]);
5731
+ const campaignSchema = z.object({
5732
+ id: z.string(),
5733
+ name: z.string(),
5734
+ filters: jobFiltersSchema,
5735
+ createdAt: numberType(),
5736
+ updatedAt: numberType(),
5737
+ confirmedBillingAt: numberType().nullable(),
5738
+ automatedSuitability: z.boolean().nullable(),
5739
+ automatedBidding: z.boolean().nullable(),
5740
+ boostingEnabled: z.boolean().nullable().default(false),
5741
+ maximumBoost: z.number().nullable().default(30),
5742
+ minimumBoost: z.number().nullable().default(0),
5743
+ webhookUrl: z.string().nullable(),
5744
+ monthlyBudget: z.number().nullable(),
5745
+ suitabilityThreshold: z.number().min(0).max(100).nullable().default(0),
5746
+ boostingThreshold: z.number().min(0).max(100).nullable().default(0),
5747
+ leadCounts: z.record(leadStatusSchema, z.number()).nullable(),
5748
+ expenses: campaignExpensesSchema,
5749
+ integrations: campaignIntegrationsSchema,
5750
+ status: campaignStatusSchema.optional(),
5751
+ });
5752
+ const createCampaignSchema = campaignSchema.omit({
5753
+ id: true,
5754
+ createdAt: true,
5755
+ updatedAt: true,
5756
+ });
5757
+ const updateCampaignSchema = campaignSchema.omit({
5758
+ createdAt: true,
5759
+ updatedAt: true,
5760
+ });
5761
+
5762
+ const campaignCountByStatusSchema = z.object({
5763
+ // Using z.enum values to create a schema with all possible job statuses
5764
+ ...Object.fromEntries(Object.values(agentStatusSchema.enum).map((status) => [
5765
+ status,
5766
+ z.object({
5767
+ boosted: z.number(),
5768
+ organic: z.number(),
5769
+ total: z.number(),
5770
+ }),
5771
+ ])),
5772
+ });
5773
+ const campaignInsightsSchema = z.object({
5774
+ pipelineHealth: campaignCountByStatusSchema,
5775
+ biddingAmount: z.number().default(0),
5776
+ boostingAmount: z.number().default(0),
5777
+ boostedProposalsCount: z.number().default(0),
5778
+ totalProposalsCount: z.number().default(0),
5779
+ totalExpenses: z.number().default(0),
5780
+ suitabilityRange0to10: z.number(),
5781
+ suitabilityRange10to20: z.number(),
5782
+ suitabilityRange20to30: z.number(),
5783
+ suitabilityRange30to40: z.number(),
5784
+ suitabilityRange40to50: z.number(),
5785
+ suitabilityRange50to60: z.number(),
5786
+ suitabilityRange60to70: z.number(),
5787
+ suitabilityRange70to80: z.number(),
5788
+ suitabilityRange80to90: z.number(),
5789
+ suitabilityRange90to100: z.number(),
5652
5790
  });
5653
- const leadStatusEventMetadata = objectType({
5654
- campaignId: stringType(),
5655
- organizationId: stringType(),
5656
- leadId: stringType(),
5657
- userId: stringType(),
5658
- metadata: z.object({
5659
- status: leadStatusSchema,
5660
- proposalId: stringType().nullable(),
5791
+
5792
+ const campaignAnalyticsStatsSchema = z.object({
5793
+ jobsAnalyzed: z.number(),
5794
+ totalStats: z.object({
5795
+ contacted: z.number(),
5796
+ viewed: z.number(),
5797
+ replied: z.number(),
5798
+ interview: z.number(),
5799
+ won: z.number(),
5661
5800
  }),
5801
+ statsByDate: z.array(z.object({
5802
+ label: z.string(),
5803
+ contacted: z.number(),
5804
+ viewed: z.number(),
5805
+ replied: z.number(),
5806
+ interview: z.number(),
5807
+ won: z.number(),
5808
+ })),
5662
5809
  });
5663
-
5664
- const subscriptionStatusEnum = z.enum([
5665
- "active",
5666
- "trialing",
5667
- "cancelled",
5668
- "paused",
5669
- ]);
5670
- const subscriptionSourceEnum = z.enum(["stripe", "manual"]);
5671
- const organizationSubscriptionSchema = objectType({
5672
- tierId: stringType(),
5673
- status: subscriptionStatusEnum,
5674
- creditsRemaining: numberType(),
5675
- startedAt: numberType(),
5676
- currentPeriodEnd: numberType(),
5677
- stripeSubscriptionId: stringType(),
5678
- source: subscriptionSourceEnum,
5810
+ const campaignAnalyticsResponseSchema = z.object({
5811
+ jobsAnalyzed: z.number(),
5812
+ contacted: z.number(),
5813
+ viewed: z.number(),
5814
+ replied: z.number(),
5815
+ interview: z.number(),
5816
+ won: z.number(),
5679
5817
  });
5680
-
5681
- const organizationMemberRoleEnum = z.enum(["admin", "member"]);
5682
- const organizationMemberSchema = objectType({
5683
- role: organizationMemberRoleEnum,
5684
- joinedAt: numberType(),
5685
- invitedBy: stringType(),
5818
+ const campaignActivitySchema = z.object({
5819
+ createdAt: z.number(),
5820
+ status: leadStatusSchema,
5821
+ lead: leadSchema.pick({
5822
+ id: true,
5823
+ title: true,
5824
+ datetime: true,
5825
+ jobUrl: true,
5826
+ }),
5686
5827
  });
5687
-
5688
- const onboardingProgressSchema = z.object({
5689
- profileSetup: z.number(),
5690
- campaignCreated: z.number(),
5691
- filtersAdded: z.number(),
5692
- rulesConfigured: z.number(), // 2 is completed, 1 is when the system generates ai config
5693
- automationEnabled: z.number(),
5828
+ const campaignActivityCreateSchema = campaignActivitySchema.pick({
5829
+ status: true,
5830
+ lead: true,
5694
5831
  });
5695
5832
 
5696
- const bidConfigSchema = objectType({
5697
- agencyName: stringType().nullable(),
5698
- bidderId: stringType().nullable(),
5699
- contractorName: stringType().nullable(),
5700
- specialisedProfile: stringType().nullable(),
5701
- });
5702
- const organizationTypeSchema = z.enum(["agency", "freelancer"]);
5703
- const organizationTierEnum = z.enum(["free", "premium"]);
5704
- const organizationLimitsSchema = objectType({
5705
- monthlyCredits: numberType(),
5706
- usedCredits: numberType(),
5707
- extraCredits: numberType(),
5833
+ const campaignAIMetricsSchema = z.object({
5834
+ leadsAnalyzed: z.number(),
5835
+ leadsBidded: z.number(),
5836
+ connectsSaved: z.number(),
5708
5837
  });
5709
- const organizationBillingSchema = objectType({
5710
- stripeCustomerId: stringType(),
5711
- savedCard: booleanType(),
5712
- creditsRemaining: numberType(),
5838
+
5839
+ const invoiceStripeMetadataLineSchema = objectType({
5840
+ description: stringType(),
5841
+ amount: numberType(),
5842
+ quantity: numberType(),
5843
+ currency: stringType(),
5844
+ subscription_item_id: stringType(),
5713
5845
  });
5714
- const organizationSchema = objectType({
5846
+ const invoiceStripeMetadataSchema = objectType({
5715
5847
  id: stringType(),
5716
- name: stringType(),
5717
- type: organizationTypeSchema,
5718
- tierId: organizationTierEnum,
5719
- subscription: organizationSubscriptionSchema.nullable(),
5720
- bidConfig: bidConfigSchema,
5721
- active: booleanType(),
5722
- limits: organizationLimitsSchema,
5723
- billing: organizationBillingSchema.nullable(),
5724
- createdAt: numberType(),
5725
- updatedAt: numberType(),
5848
+ subscription_id: stringType(),
5849
+ hosted_invoice_url: stringType(),
5850
+ lines: arrayType(invoiceStripeMetadataLineSchema),
5851
+ amount_paid: numberType(),
5852
+ amount_due: numberType(),
5853
+ amount_remaining: numberType(),
5854
+ attempt_count: numberType(),
5726
5855
  });
5727
- const createOrganizationSchema = organizationSchema.pick({
5728
- name: true,
5729
- type: true,
5730
- tierId: true,
5856
+ const invoiceLineItemSchema = objectType({
5857
+ description: stringType(),
5858
+ total: numberType(),
5859
+ quantity: numberType(),
5860
+ currency: stringType(),
5731
5861
  });
5732
- const creditDeductionEventTypeEnum = LogEventTypeEnum.extract([
5733
- "suitabilityComplete",
5734
- "proposalComplete",
5862
+ const invoiceStatusEnum = z.enum([
5863
+ "open",
5864
+ "paid",
5865
+ "past_due",
5866
+ "payment_failed",
5735
5867
  ]);
5736
- const creditDeductionPayloadSchema = objectType({
5737
- event: creditDeductionEventTypeEnum,
5738
- campaignId: stringType().nullish(),
5739
- });
5740
- const aiConfigOldSchema = objectType({
5868
+ const invoiceSchema = objectType({
5741
5869
  id: stringType(),
5742
- suitabilityPrompt: stringType().nullable(),
5743
- proposalPrompt: stringType().nullable(),
5744
- questionProposalPrompt: stringType().nullable(),
5745
- knowledgeBase: stringType().nullable(),
5746
- });
5747
- const aiConfigSchema = objectType({
5748
- suitabilityRules: stringType().nullable(),
5749
- coverLetterRules: stringType().nullable(),
5750
- coverLetterTemplate: stringType().nullable(),
5751
- questionRules: stringType().nullable(),
5752
- });
5753
- const knowledgeBaseSchema = objectType({
5754
- about: stringType(),
5755
- caseStudies: stringType(),
5870
+ status: invoiceStatusEnum,
5871
+ subtotal: numberType(),
5872
+ total: numberType(),
5873
+ amountPaid: numberType(),
5874
+ amountDue: numberType(),
5875
+ amountRemaining: numberType(),
5876
+ currency: stringType(),
5877
+ lineItems: arrayType(invoiceLineItemSchema),
5878
+ stripe: invoiceStripeMetadataSchema,
5879
+ createdAt: numberType(),
5756
5880
  });
5757
- const notificationConfigSchema = objectType({
5758
- emailEnabled: booleanType(),
5759
- discordWebhookUrl: stringType().nullable(),
5760
- slackWebhookUrl: stringType().nullable(),
5881
+
5882
+ const planStripeMetadataSchema = objectType({
5883
+ id: stringType().regex(/^prod_[a-zA-Z0-9]+$/),
5884
+ name: stringType(),
5885
+ prices: arrayType(objectType({
5886
+ id: stringType().regex(/^price_[a-zA-Z0-9]+$/),
5887
+ nickname: stringType(),
5888
+ lookup_key: stringType(),
5889
+ })),
5761
5890
  });
5762
- const organizationSettingsSchema = objectType({
5763
- aiConfig: aiConfigSchema,
5764
- knowledgeBase: knowledgeBaseSchema,
5765
- notifications: notificationConfigSchema,
5891
+ const planSchema = objectType({
5892
+ id: stringType().regex(/^prod_[a-zA-Z0-9]+$/),
5893
+ name: stringType(),
5894
+ slug: stringType().regex(/^[a-z0-9-]+$/),
5895
+ stripe: planStripeMetadataSchema,
5896
+ version: numberType().int().positive(),
5897
+ features: arrayType(stringType()),
5898
+ sortOrder: numberType().int().positive(),
5899
+ isActive: booleanType(),
5900
+ createdAt: numberType(),
5901
+ archivedAt: numberType().nullable(),
5766
5902
  });
5767
5903
 
5768
5904
  const proxyCountrySchema = z.enum([
@@ -6154,24 +6290,10 @@ const timeFilterSchema = z.union([
6154
6290
  z.literal("all_time"),
6155
6291
  ]);
6156
6292
 
6157
- const breakdownSchema = objectType({
6158
- suitability: numberType(),
6159
- proposal: numberType(),
6160
- bidding: numberType(),
6161
- });
6162
- const dailyUsageSchema = objectType({
6163
- breakdown: breakdownSchema,
6164
- tokensUsed: numberType().optional(),
6165
- campaignId: stringType().optional(),
6166
- model: stringType(),
6167
- timestamp: numberType(),
6168
- });
6169
- const periodUsageSchema = objectType({
6170
- usedCredits: numberType(),
6171
- breakdown: breakdownSchema,
6172
- lastUpdated: numberType(),
6293
+ const transactionStripeMetadataSchema = objectType({
6294
+ subscription: objectType({ id: stringType().nullable() }),
6295
+ invoice: objectType({ id: stringType().nullable() }),
6173
6296
  });
6174
-
6175
6297
  const transactionTypeEnum = z.enum(["subscription", "add-on", "refund"]);
6176
6298
  const transactionStatusEnum = z.enum([
6177
6299
  "succeeded",
@@ -6181,64 +6303,28 @@ const transactionStatusEnum = z.enum([
6181
6303
  const transactionSchema = objectType({
6182
6304
  orgId: stringType(),
6183
6305
  type: transactionTypeEnum,
6184
- creditsPurchased: numberType(),
6185
- creditsGranted: numberType().nullable(),
6186
6306
  amountUsd: numberType(),
6187
- stripeInvoiceId: stringType(),
6188
6307
  status: transactionStatusEnum,
6189
6308
  timestamp: numberType(),
6309
+ stripe: transactionStripeMetadataSchema,
6190
6310
  });
6191
6311
 
6192
- const agentTaskRequestSchema = z.object({
6193
- organizationId: z.string(),
6194
- userId: z.string().optional(),
6195
- campaignId: z.string().optional(),
6196
- leadId: z.string(),
6197
- aiConfig: aiConfigSchema,
6198
- lead: leadSchema,
6199
- });
6200
- const testSystemPromptsRequestSchema = z.object({
6201
- organizationId: z.string(),
6202
- modelSuitability: z.string(),
6203
- modelProposal: z.string(),
6204
- systemPrompt: systemPromptSchema,
6205
- aiConfig: aiConfigSchema,
6206
- lead: leadSchema,
6207
- });
6208
- const generateKnowledgeBaseRequestSchema = z.object({
6209
- profileUrl: z.string(),
6210
- organizationId: z.string(),
6211
- });
6212
- const suitabilityRatingSchema = z.object({
6213
- rating: z.number(),
6214
- reason: z.string(),
6215
- });
6216
- const proposalSchema = z.object({
6217
- coverLetter: z.string(),
6218
- questionAnswerPairs: questionAnswerPairSchema.array(),
6312
+ const breakdownSchema = objectType({
6313
+ suitability: numberType(),
6314
+ proposal: numberType(),
6315
+ bidding: numberType(),
6219
6316
  });
6220
- const agentTaskResponseSchema = z.object({
6221
- result: z.union([suitabilityRatingSchema, proposalSchema]),
6222
- model: z.string(),
6223
- provider: z.string(),
6224
- promptTokens: z.number(),
6225
- completionTokens: z.number(),
6317
+ const dailyUsageSchema = objectType({
6318
+ breakdown: breakdownSchema,
6319
+ tokensUsed: numberType().optional(),
6320
+ campaignId: stringType().optional(),
6321
+ model: stringType(),
6322
+ timestamp: numberType(),
6226
6323
  });
6227
- const testSystemPromptsResponseSchema = z.object({
6228
- proposal: z.object({
6229
- result: proposalSchema,
6230
- model: z.string(),
6231
- provider: z.string(),
6232
- promptTokens: z.number(),
6233
- completionTokens: z.number(),
6234
- }),
6235
- suitability: z.object({
6236
- result: suitabilityRatingSchema,
6237
- model: z.string(),
6238
- provider: z.string(),
6239
- promptTokens: z.number(),
6240
- completionTokens: z.number(),
6241
- }),
6324
+ const periodUsageSchema = objectType({
6325
+ usedCredits: numberType(),
6326
+ breakdown: breakdownSchema,
6327
+ lastUpdated: numberType(),
6242
6328
  });
6243
6329
 
6244
6330
  const commonQuestions = [
@@ -12480,7 +12566,8 @@ const ROUTES = {
12480
12566
  SETTINGS: (id) => `organizations/${id}/settings`,
12481
12567
  CHARGES: (id) => `organizations/${id}/charges`,
12482
12568
  PAYMENT_METHODS: (id) => `organizations/${id}/payment-methods`,
12483
- DEDUCT_CREDITS: (id) => `organizations/${id}/deduct-credits`,
12569
+ TRACK_USAGE: (id) => `organizations/${id}/track-usage`,
12570
+ SUBSCRIBE: (id) => `organizations/${id}/subscribe`,
12484
12571
  CAMPAIGNS: {
12485
12572
  BASE: (organizationId) => `organizations/${organizationId}/campaigns`,
12486
12573
  BY_ID: (organizationId, campaignId) => `organizations/${organizationId}/campaigns/${campaignId}`,
@@ -12539,6 +12626,14 @@ const ROUTES = {
12539
12626
  BY_DATE: (organizationId, date) => `usage-summaries/${organizationId}/yearly/${moment(date).format("YYYY")}`,
12540
12627
  },
12541
12628
  },
12629
+ INVOICES: {
12630
+ BASE: (organizationId) => `organizations/${organizationId}/invoices`,
12631
+ BY_ID: (organizationId, invoiceId) => `organizations/${organizationId}/invoices/${invoiceId}`,
12632
+ },
12633
+ USERS: {
12634
+ BASE: (id) => `organizations/${id}/users`,
12635
+ BY_ID: (organizationId, userId) => `organizations/${organizationId}/users/${userId}`,
12636
+ },
12542
12637
  },
12543
12638
  TRANSACTIONS: {
12544
12639
  BASE: "transactions",
@@ -12555,6 +12650,10 @@ const ROUTES = {
12555
12650
  BASE: "bidders",
12556
12651
  BY_ID: (id) => `bidders/${id}`,
12557
12652
  },
12653
+ PLANS: {
12654
+ BASE: "plans",
12655
+ BY_ID: (id) => `plans/${id}`,
12656
+ },
12558
12657
  };
12559
12658
  // Helper function to build route with parameters
12560
12659
  const buildRoute = (route, params = {}) => {
@@ -12590,7 +12689,8 @@ const bidderAccountProviderDisplayMap = {
12590
12689
 
12591
12690
  const creditDeductionAmountMap = {
12592
12691
  suitabilityComplete: 1,
12593
- proposalComplete: 5,
12692
+ proposalComplete: 1,
12693
+ biddingComplete: 5,
12594
12694
  };
12595
12695
 
12596
12696
  // Main wrapper function
@@ -12832,6 +12932,84 @@ function requireCurrencySymbolMap () {
12832
12932
  var currencySymbolMapExports = requireCurrencySymbolMap();
12833
12933
  var getSymbolFromCurrency = /*@__PURE__*/getDefaultExportFromCjs(currencySymbolMapExports);
12834
12934
 
12935
+ var slugify$2 = {exports: {}};
12936
+
12937
+ var slugify$1 = slugify$2.exports;
12938
+
12939
+ var hasRequiredSlugify;
12940
+
12941
+ function requireSlugify () {
12942
+ if (hasRequiredSlugify) return slugify$2.exports;
12943
+ hasRequiredSlugify = 1;
12944
+ (function (module, exports) {
12945
+ (function (name, root, factory) {
12946
+ {
12947
+ module.exports = factory();
12948
+ module.exports['default'] = factory();
12949
+ }
12950
+ }('slugify', slugify$1, function () {
12951
+ var charMap = JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E\'","Ը":"Y\'","Թ":"T\'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C\'","Կ":"K","Հ":"H","Ձ":"D\'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R\'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P\'","Ք":"Q\'","Օ":"O\'\'","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"\'","’":"\'","“":"\\\"","”":"\\\"","„":"\\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}');
12952
+ var locales = JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');
12953
+
12954
+ function replace (string, options) {
12955
+ if (typeof string !== 'string') {
12956
+ throw new Error('slugify: string argument expected')
12957
+ }
12958
+
12959
+ options = (typeof options === 'string')
12960
+ ? {replacement: options}
12961
+ : options || {};
12962
+
12963
+ var locale = locales[options.locale] || {};
12964
+
12965
+ var replacement = options.replacement === undefined ? '-' : options.replacement;
12966
+
12967
+ var trim = options.trim === undefined ? true : options.trim;
12968
+
12969
+ var slug = string.normalize().split('')
12970
+ // replace characters based on charMap
12971
+ .reduce(function (result, ch) {
12972
+ var appendChar = locale[ch];
12973
+ if (appendChar === undefined) appendChar = charMap[ch];
12974
+ if (appendChar === undefined) appendChar = ch;
12975
+ if (appendChar === replacement) appendChar = ' ';
12976
+ return result + appendChar
12977
+ // remove not allowed characters
12978
+ .replace(options.remove || /[^\w\s$*_+~.()'"!\-:@]+/g, '')
12979
+ }, '');
12980
+
12981
+ if (options.strict) {
12982
+ slug = slug.replace(/[^A-Za-z0-9\s]/g, '');
12983
+ }
12984
+
12985
+ if (trim) {
12986
+ slug = slug.trim();
12987
+ }
12988
+
12989
+ // Replace spaces with replacement character, treating multiple consecutive
12990
+ // spaces as a single space.
12991
+ slug = slug.replace(/\s+/g, replacement);
12992
+
12993
+ if (options.lower) {
12994
+ slug = slug.toLowerCase();
12995
+ }
12996
+
12997
+ return slug
12998
+ }
12999
+
13000
+ replace.extend = function (customMap) {
13001
+ Object.assign(charMap, customMap);
13002
+ };
13003
+
13004
+ return replace
13005
+ }));
13006
+ } (slugify$2));
13007
+ return slugify$2.exports;
13008
+ }
13009
+
13010
+ var slugifyExports = requireSlugify();
13011
+ var slugify = /*@__PURE__*/getDefaultExportFromCjs(slugifyExports);
13012
+
12835
13013
  const isNumeric = (num) => (typeof num === "number" || (typeof num === "string" && num.trim() !== "")) &&
12836
13014
  !isNaN(num);
12837
13015
  const formatCurrency = (price, currencyCode = "USD") => {
@@ -12851,6 +13029,7 @@ const capitalize = (str) => {
12851
13029
  }
12852
13030
  return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
12853
13031
  };
13032
+ const generateSlug = (name) => slugify(name, { lower: true, trim: true, replacement: "-" });
12854
13033
 
12855
13034
  exports.JOB_FILTER_OPTIONS = JOB_FILTER_OPTIONS;
12856
13035
  exports.LogEventTypeEnum = LogEventTypeEnum;
@@ -12907,8 +13086,6 @@ exports.createCampaignSchema = createCampaignSchema;
12907
13086
  exports.createOrganizationSchema = createOrganizationSchema;
12908
13087
  exports.createScraperAccountSchema = createScraperAccountSchema;
12909
13088
  exports.creditDeductionAmountMap = creditDeductionAmountMap;
12910
- exports.creditDeductionEventTypeEnum = creditDeductionEventTypeEnum;
12911
- exports.creditDeductionPayloadSchema = creditDeductionPayloadSchema;
12912
13089
  exports.dailyUsageSchema = dailyUsageSchema;
12913
13090
  exports.dateSchema = dateSchema;
12914
13091
  exports.engagementTypeEnum = engagementTypeEnum;
@@ -12925,9 +13102,15 @@ exports.formatCurrency = formatCurrency;
12925
13102
  exports.freelancerBidPayloadSchema = freelancerBidPayloadSchema;
12926
13103
  exports.freelancerBidProposalDataSchema = freelancerBidProposalDataSchema;
12927
13104
  exports.generateKnowledgeBaseRequestSchema = generateKnowledgeBaseRequestSchema;
13105
+ exports.generateSlug = generateSlug;
12928
13106
  exports.getNextStatus = getNextStatus;
12929
13107
  exports.getPreviousStatus = getPreviousStatus;
12930
13108
  exports.getRouteWithoutAdminPrefix = getRouteWithoutAdminPrefix;
13109
+ exports.invoiceLineItemSchema = invoiceLineItemSchema;
13110
+ exports.invoiceSchema = invoiceSchema;
13111
+ exports.invoiceStatusEnum = invoiceStatusEnum;
13112
+ exports.invoiceStripeMetadataLineSchema = invoiceStripeMetadataLineSchema;
13113
+ exports.invoiceStripeMetadataSchema = invoiceStripeMetadataSchema;
12931
13114
  exports.isNumeric = isNumeric;
12932
13115
  exports.jobActivityDeltaSchema = jobActivityDeltaSchema;
12933
13116
  exports.jobActivityOffsetEnum = jobActivityOffsetEnum;
@@ -12947,6 +13130,7 @@ exports.leadResponseSchema = leadResponseSchema;
12947
13130
  exports.leadSchema = leadSchema;
12948
13131
  exports.leadStatusEventMetadata = leadStatusEventMetadata;
12949
13132
  exports.leadStatusSchema = leadStatusSchema;
13133
+ exports.limitsSchema = limitsSchema;
12950
13134
  exports.listingScrapedEventMetadata = listingScrapedEventMetadata;
12951
13135
  exports.logEventSchema = logEventSchema;
12952
13136
  exports.loginSchema = loginSchema;
@@ -12954,18 +13138,17 @@ exports.metadataSchema = metadataSchema;
12954
13138
  exports.notificationConfigSchema = notificationConfigSchema;
12955
13139
  exports.nuxtStateJobSchema = nuxtStateJobSchema;
12956
13140
  exports.onboardingProgressSchema = onboardingProgressSchema;
12957
- exports.organizationBillingSchema = organizationBillingSchema;
12958
- exports.organizationLimitsSchema = organizationLimitsSchema;
12959
13141
  exports.organizationMemberRoleEnum = organizationMemberRoleEnum;
12960
13142
  exports.organizationMemberSchema = organizationMemberSchema;
12961
13143
  exports.organizationSchema = organizationSchema;
12962
13144
  exports.organizationSettingsSchema = organizationSettingsSchema;
12963
- exports.organizationSubscriptionSchema = organizationSubscriptionSchema;
12964
13145
  exports.organizationTierEnum = organizationTierEnum;
12965
13146
  exports.organizationTypeSchema = organizationTypeSchema;
12966
13147
  exports.passwordSchema = passwordSchema;
12967
13148
  exports.paymentTypeEnum = paymentTypeEnum;
12968
13149
  exports.periodUsageSchema = periodUsageSchema;
13150
+ exports.planSchema = planSchema;
13151
+ exports.planStripeMetadataSchema = planStripeMetadataSchema;
12969
13152
  exports.projectDurationEnum = projectDurationEnum;
12970
13153
  exports.proposalSchema = proposalSchema;
12971
13154
  exports.proxyAvailableReplacementsSchema = proxyAvailableReplacementsSchema;
@@ -12989,8 +13172,12 @@ exports.scrapeResultSchema = scrapeResultSchema;
12989
13172
  exports.scrapeUserProfilePayloadSchema = scrapeUserProfilePayloadSchema;
12990
13173
  exports.scrapeUserProfileResultSchema = scrapeUserProfileResultSchema;
12991
13174
  exports.scraperAccountSchema = scraperAccountSchema;
13175
+ exports.subscribePayloadSchema = subscribePayloadSchema;
13176
+ exports.subscriptionSchema = subscriptionSchema;
12992
13177
  exports.subscriptionSourceEnum = subscriptionSourceEnum;
12993
13178
  exports.subscriptionStatusEnum = subscriptionStatusEnum;
13179
+ exports.subscriptionStripeMetadataItemSchema = subscriptionStripeMetadataItemSchema;
13180
+ exports.subscriptionStripeMetadataSchema = subscriptionStripeMetadataSchema;
12994
13181
  exports.suitabilityRatingSchema = suitabilityRatingSchema;
12995
13182
  exports.systemPromptSchema = systemPromptSchema;
12996
13183
  exports.systemSchema = systemSchema;
@@ -12998,8 +13185,11 @@ exports.talentTypeEnum = talentTypeEnum;
12998
13185
  exports.testSystemPromptsRequestSchema = testSystemPromptsRequestSchema;
12999
13186
  exports.testSystemPromptsResponseSchema = testSystemPromptsResponseSchema;
13000
13187
  exports.timeFilterSchema = timeFilterSchema;
13188
+ exports.trackUsageEventTypeEnum = trackUsageEventTypeEnum;
13189
+ exports.trackUsagePayloadSchema = trackUsagePayloadSchema;
13001
13190
  exports.transactionSchema = transactionSchema;
13002
13191
  exports.transactionStatusEnum = transactionStatusEnum;
13192
+ exports.transactionStripeMetadataSchema = transactionStripeMetadataSchema;
13003
13193
  exports.transactionTypeEnum = transactionTypeEnum;
13004
13194
  exports.tryCatch = tryCatch;
13005
13195
  exports.updateBidderAccountSchema = updateBidderAccountSchema;