lancer-shared 1.2.87 → 1.2.88

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 (206) hide show
  1. package/dist/bundle.cjs.js +249 -180
  2. package/dist/constants/account-status.d.ts +3 -0
  3. package/dist/constants/account-status.js +17 -0
  4. package/dist/constants/collections.d.ts +13 -0
  5. package/dist/constants/collections.js +16 -0
  6. package/dist/constants/common-questions.js +60 -0
  7. package/dist/constants/index.js +40 -0
  8. package/dist/constants/job-filter-options.js +268 -0
  9. package/dist/constants/job-status.js +26 -0
  10. package/dist/constants/mappings/countryMapping.js +122 -0
  11. package/dist/constants/mappings/regionMapping.js +242 -0
  12. package/dist/constants/organization.d.ts +2 -0
  13. package/dist/constants/routes.d.ts +12 -1
  14. package/dist/constants/routes.js +108 -0
  15. package/dist/constants/upwork-accounts.js +21 -0
  16. package/dist/index.js +20 -0
  17. package/dist/schemas/account/account-status.js +11 -0
  18. package/dist/schemas/account/bidder-account.js +37 -0
  19. package/dist/schemas/account/index.js +19 -0
  20. package/dist/schemas/account/manager-account.d.ts +116 -0
  21. package/dist/schemas/account/manager-account.js +38 -0
  22. package/dist/schemas/account/scraper-account.js +37 -0
  23. package/dist/schemas/agent/index.d.ts +41 -0
  24. package/dist/schemas/ai/ai-config.d.ts +36 -0
  25. package/dist/schemas/ai/ai-config.js +12 -0
  26. package/dist/schemas/ai/index.d.ts +3 -0
  27. package/dist/schemas/ai/index.js +19 -0
  28. package/dist/schemas/ai/proposal.d.ts +82 -0
  29. package/dist/schemas/ai/proposal.js +16 -0
  30. package/dist/schemas/ai/suitability.d.ts +37 -0
  31. package/dist/schemas/ai/suitability.js +17 -0
  32. package/dist/schemas/bid/bid-result.js +15 -0
  33. package/dist/schemas/bid/bid.js +36 -0
  34. package/dist/schemas/bid/index.js +18 -0
  35. package/dist/schemas/bidding/index.d.ts +1 -0
  36. package/dist/schemas/bidding/index.js +17 -0
  37. package/dist/schemas/bidding/proposal-bidding-status.d.ts +26 -0
  38. package/dist/schemas/bidding/proposal-bidding-status.js +18 -0
  39. package/dist/schemas/campaign/campaign-ai-metrics.js +9 -0
  40. package/dist/schemas/campaign/campaign-analytics.d.ts +95 -234
  41. package/dist/schemas/campaign/campaign-analytics.js +41 -0
  42. package/dist/schemas/campaign/campaign-expenses.js +9 -0
  43. package/dist/schemas/campaign/campaign-insights.js +31 -0
  44. package/dist/schemas/campaign/campaign-integrations.d.ts +87 -0
  45. package/dist/schemas/campaign/campaign-integrations.js +16 -0
  46. package/dist/schemas/campaign/campaign-job-count.d.ts +2 -0
  47. package/dist/schemas/campaign/campaign-job-count.js +6 -0
  48. package/dist/schemas/campaign/campaign-webhooks.d.ts +0 -58
  49. package/dist/schemas/campaign/campaign.d.ts +13 -133
  50. package/dist/schemas/campaign/campaign.js +44 -0
  51. package/dist/schemas/campaign/index.d.ts +1 -1
  52. package/dist/schemas/campaign/index.js +23 -0
  53. package/dist/schemas/chat-message/chat-message.d.ts +31 -0
  54. package/dist/schemas/chat-message/chat-message.js +13 -0
  55. package/dist/schemas/chat-message/index.d.ts +1 -0
  56. package/dist/schemas/chat-message/index.js +17 -0
  57. package/dist/schemas/config/agency-config.d.ts +17 -0
  58. package/dist/schemas/config/agency-config.js +10 -0
  59. package/dist/schemas/config/index.d.ts +1 -0
  60. package/dist/schemas/config/index.js +17 -0
  61. package/dist/schemas/index.js +32 -0
  62. package/dist/schemas/job/index.js +19 -0
  63. package/dist/schemas/job/job-details.d.ts +335 -0
  64. package/dist/schemas/job/job-details.js +29 -0
  65. package/dist/schemas/job/job-note.d.ts +83 -0
  66. package/dist/schemas/job/job-note.js +30 -0
  67. package/dist/schemas/job/job-status.d.ts +3 -0
  68. package/dist/schemas/job/job-status.js +27 -0
  69. package/dist/schemas/job/job.d.ts +1160 -0
  70. package/dist/schemas/job/job.js +90 -0
  71. package/dist/schemas/job/pipeline-job.d.ts +602 -0
  72. package/dist/schemas/job/pipeline-job.js +42 -0
  73. package/dist/schemas/job/upwork-job.d.ts +334 -0
  74. package/dist/schemas/job/upwork-job.js +60 -0
  75. package/dist/schemas/job-filters/index.d.ts +1 -0
  76. package/dist/schemas/job-filters/index.js +17 -0
  77. package/dist/schemas/job-filters/job-filters.d.ts +241 -0
  78. package/dist/schemas/job-filters/job-filters.js +87 -0
  79. package/dist/schemas/lead/index.d.ts +60 -8
  80. package/dist/schemas/lead/index.js +19 -0
  81. package/dist/schemas/lead/lead-note.d.ts +83 -0
  82. package/dist/schemas/lead/lead-note.js +30 -0
  83. package/dist/schemas/lead/lead-status.js +26 -0
  84. package/dist/schemas/lead/lead.d.ts +1897 -0
  85. package/dist/schemas/lead/lead.js +143 -0
  86. package/dist/schemas/lead/nuxt.d.ts +1664 -0
  87. package/dist/schemas/logger/index.js +17 -0
  88. package/dist/schemas/logger/log-event.d.ts +137 -52
  89. package/dist/schemas/logger/log-event.js +66 -0
  90. package/dist/schemas/organization/index.d.ts +11 -7
  91. package/dist/schemas/organization/index.js +17 -0
  92. package/dist/schemas/organization/organization.d.ts +70 -0
  93. package/dist/schemas/organization/organization.js +19 -0
  94. package/dist/schemas/proxy/index.js +17 -0
  95. package/dist/schemas/proxy/proxy-available-replacements.d.ts +1 -1
  96. package/dist/schemas/proxy/proxy.js +21 -0
  97. package/dist/schemas/saved-search/index.js +12 -0
  98. package/dist/schemas/scraper/index.js +18 -0
  99. package/dist/schemas/scraper/scrape-payload.d.ts +36 -64
  100. package/dist/schemas/scraper/scrape-payload.js +16 -0
  101. package/dist/schemas/scraper/scrape-result.js +23 -0
  102. package/dist/schemas/shared.js +16 -0
  103. package/dist/schemas/time-filter/index.js +9 -0
  104. package/dist/schemas/upwork-account/index.d.ts +3 -0
  105. package/dist/schemas/upwork-account/index.js +19 -0
  106. package/dist/schemas/upwork-account/upwork-account-status.d.ts +2 -0
  107. package/dist/schemas/upwork-account/upwork-account-status.js +11 -0
  108. package/dist/schemas/upwork-account/upwork-business-manager-account.d.ts +95 -0
  109. package/dist/schemas/upwork-account/upwork-business-manager-account.js +35 -0
  110. package/dist/schemas/upwork-account/upwork-scraping-account.d.ts +90 -0
  111. package/dist/schemas/upwork-account/upwork-scraping-account.js +29 -0
  112. package/dist/schemas/user/index.js +55 -0
  113. package/dist/types/account/account-status.d.ts +3 -0
  114. package/dist/types/account/account-status.js +2 -0
  115. package/dist/types/account/bidder-account.d.ts +7 -0
  116. package/dist/types/account/bidder-account.js +2 -0
  117. package/dist/types/account/index.d.ts +3 -0
  118. package/dist/types/account/index.js +19 -0
  119. package/dist/types/account/manager-account.d.ts +7 -0
  120. package/dist/types/account/manager-account.js +2 -0
  121. package/dist/types/account/scraper-account.d.ts +5 -0
  122. package/dist/types/account/scraper-account.js +2 -0
  123. package/dist/types/ai/ai-config.d.ts +6 -0
  124. package/dist/types/ai/ai-config.js +2 -0
  125. package/dist/types/ai/index.d.ts +3 -0
  126. package/dist/types/ai/index.js +19 -0
  127. package/dist/types/ai/proposal.d.ts +10 -0
  128. package/dist/types/ai/proposal.js +2 -0
  129. package/dist/types/ai/suitability.d.ts +6 -0
  130. package/dist/types/ai/suitability.js +2 -0
  131. package/dist/types/bid/bid-result.d.ts +5 -0
  132. package/dist/types/bid/bid-result.js +2 -0
  133. package/dist/types/bid/bid.d.ts +9 -0
  134. package/dist/types/bid/bid.js +2 -0
  135. package/dist/types/bid/index.d.ts +2 -0
  136. package/dist/types/bid/index.js +18 -0
  137. package/dist/types/bidding/index.d.ts +1 -0
  138. package/dist/types/bidding/index.js +17 -0
  139. package/dist/types/bidding/proposal-bidding-status.d.ts +3 -0
  140. package/dist/types/bidding/proposal-bidding-status.js +2 -0
  141. package/dist/types/campaign/campaign-analytics.d.ts +7 -0
  142. package/dist/types/campaign/campaign-analytics.js +2 -0
  143. package/dist/types/campaign/campaign-expenses.d.ts +3 -0
  144. package/dist/types/campaign/campaign-expenses.js +2 -0
  145. package/dist/types/campaign/campaign-insights.js +2 -0
  146. package/dist/types/campaign/campaign-integrations.d.ts +6 -0
  147. package/dist/types/campaign/campaign-integrations.js +2 -0
  148. package/dist/types/campaign/campaign-job-count.d.ts +4 -0
  149. package/dist/types/campaign/campaign-job-count.js +2 -0
  150. package/dist/types/campaign/campaign.d.ts +0 -2
  151. package/dist/types/campaign/campaign.js +2 -0
  152. package/dist/types/campaign/index.js +22 -0
  153. package/dist/types/chat-message/chat-message.d.ts +4 -0
  154. package/dist/types/chat-message/chat-message.js +2 -0
  155. package/dist/types/chat-message/index.d.ts +1 -0
  156. package/dist/types/chat-message/index.js +17 -0
  157. package/dist/types/config/agency-config.d.ts +4 -0
  158. package/dist/types/config/agency-config.js +2 -0
  159. package/dist/types/config/index.d.ts +1 -0
  160. package/dist/types/config/index.js +17 -0
  161. package/dist/types/index.d.ts +15 -0
  162. package/dist/types/index.js +29 -0
  163. package/dist/types/job/index.d.ts +48 -0
  164. package/dist/types/job/index.js +19 -0
  165. package/dist/types/job/job-details.d.ts +36 -0
  166. package/dist/types/job/job-details.js +2 -0
  167. package/dist/types/job/job-note.d.ts +10 -0
  168. package/dist/types/job/job-note.js +2 -0
  169. package/dist/types/job/job-status.d.ts +5 -0
  170. package/dist/types/job/job-status.js +12 -0
  171. package/dist/types/job/job.d.ts +36 -0
  172. package/dist/types/job/job.js +2 -0
  173. package/dist/types/job/nuxt.d.ts +4 -0
  174. package/dist/types/job-filters/index.d.ts +1 -0
  175. package/dist/types/job-filters/index.js +17 -0
  176. package/dist/types/job-filters/job-filters.d.ts +4 -0
  177. package/dist/types/job-filters/job-filters.js +2 -0
  178. package/dist/types/logger/index.d.ts +1 -0
  179. package/dist/types/logger/index.js +17 -0
  180. package/dist/types/logger/log-event.js +2 -0
  181. package/dist/types/saved-search/index.d.ts +6 -0
  182. package/dist/types/saved-search/index.js +2 -0
  183. package/dist/types/scraper/index.d.ts +2 -0
  184. package/dist/types/scraper/index.js +18 -0
  185. package/dist/types/scraper/scrape-payload.d.ts +10 -0
  186. package/dist/types/scraper/scrape-payload.js +2 -0
  187. package/dist/types/scraper/scrape-result.d.ts +8 -0
  188. package/dist/types/scraper/scrape-result.js +2 -0
  189. package/dist/types/shared.d.ts +8 -0
  190. package/dist/types/time-filter/index.d.ts +3 -0
  191. package/dist/types/time-filter/index.js +2 -0
  192. package/dist/types/transaction/index.d.ts +4 -0
  193. package/dist/types/upwork-account/index.d.ts +3 -0
  194. package/dist/types/upwork-account/index.js +19 -0
  195. package/dist/types/upwork-account/upwork-account-status.d.ts +3 -0
  196. package/dist/types/upwork-account/upwork-account-status.js +2 -0
  197. package/dist/types/upwork-account/upwork-business-manager-account.d.ts +7 -0
  198. package/dist/types/upwork-account/upwork-business-manager-account.js +2 -0
  199. package/dist/types/upwork-account/upwork-scraping-account.d.ts +5 -0
  200. package/dist/types/upwork-account/upwork-scraping-account.js +2 -0
  201. package/dist/types/usage/index.d.ts +6 -0
  202. package/dist/types/user/index.d.ts +15 -0
  203. package/dist/types/user/index.js +2 -0
  204. package/dist/utils/index.js +17 -0
  205. package/dist/utils/try-catch.js +25 -0
  206. package/package.json +1 -1
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.campaignActivitySchema = exports.campaignAnalyticsResponseSchema = exports.campaignAnalyticsStatsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const lead_1 = require("../lead");
6
+ exports.campaignAnalyticsStatsSchema = zod_1.z.object({
7
+ jobsAnalyzed: zod_1.z.number(),
8
+ totalStats: zod_1.z.object({
9
+ contacted: zod_1.z.number(),
10
+ viewed: zod_1.z.number(),
11
+ replied: zod_1.z.number(),
12
+ negotiations: zod_1.z.number(),
13
+ won: zod_1.z.number(),
14
+ }),
15
+ statsByDate: zod_1.z.array(zod_1.z.object({
16
+ label: zod_1.z.string(),
17
+ contacted: zod_1.z.number(),
18
+ viewed: zod_1.z.number(),
19
+ replied: zod_1.z.number(),
20
+ negotiations: zod_1.z.number(),
21
+ won: zod_1.z.number(),
22
+ })),
23
+ });
24
+ exports.campaignAnalyticsResponseSchema = zod_1.z.object({
25
+ jobsAnalyzed: zod_1.z.number(),
26
+ contacted: zod_1.z.number(),
27
+ viewed: zod_1.z.number(),
28
+ replied: zod_1.z.number(),
29
+ negotiations: zod_1.z.number(),
30
+ won: zod_1.z.number(),
31
+ });
32
+ exports.campaignActivitySchema = zod_1.z.object({
33
+ createdAt: zod_1.z.number(),
34
+ status: lead_1.leadStatusSchema,
35
+ job: lead_1.upworkJobSchema.pick({
36
+ id: true,
37
+ title: true,
38
+ datetime: true,
39
+ jobUrl: true,
40
+ }),
41
+ });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.campaignExpensesSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.campaignExpensesSchema = zod_1.z.object({
6
+ biddingAmount: zod_1.z.number().default(0),
7
+ boostingAmount: zod_1.z.number().default(0),
8
+ boosted: zod_1.z.number().default(0),
9
+ });
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.campaignInsightsSchema = exports.campaignCountByStatusSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const lead_1 = require("../lead");
6
+ exports.campaignCountByStatusSchema = zod_1.z.object(Object.assign({}, Object.fromEntries(Object.values(lead_1.agentStatusSchema.enum).map((status) => [
7
+ status,
8
+ zod_1.z.object({
9
+ boosted: zod_1.z.number(),
10
+ organic: zod_1.z.number(),
11
+ total: zod_1.z.number(),
12
+ }),
13
+ ]))));
14
+ exports.campaignInsightsSchema = zod_1.z.object({
15
+ pipelineHealth: exports.campaignCountByStatusSchema,
16
+ biddingAmount: zod_1.z.number().default(0),
17
+ boostingAmount: zod_1.z.number().default(0),
18
+ boostedProposalsCount: zod_1.z.number().default(0),
19
+ totalProposalsCount: zod_1.z.number().default(0),
20
+ totalExpenses: zod_1.z.number().default(0),
21
+ suitabilityRange0to10: zod_1.z.number(),
22
+ suitabilityRange10to20: zod_1.z.number(),
23
+ suitabilityRange20to30: zod_1.z.number(),
24
+ suitabilityRange30to40: zod_1.z.number(),
25
+ suitabilityRange40to50: zod_1.z.number(),
26
+ suitabilityRange50to60: zod_1.z.number(),
27
+ suitabilityRange60to70: zod_1.z.number(),
28
+ suitabilityRange70to80: zod_1.z.number(),
29
+ suitabilityRange80to90: zod_1.z.number(),
30
+ suitabilityRange90to100: zod_1.z.number(),
31
+ });
@@ -0,0 +1,87 @@
1
+ import { z } from "zod";
2
+ export declare const campaignIntegrations: z.ZodEnum<["discord", "slack"]>;
3
+ export declare const campaignIntegrationsSchema: z.ZodObject<{
4
+ suitabilityHooks: z.ZodObject<{
5
+ discord: z.ZodNullable<z.ZodString>;
6
+ slack: z.ZodNullable<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ discord: string | null;
9
+ slack: string | null;
10
+ }, {
11
+ discord: string | null;
12
+ slack: string | null;
13
+ }>;
14
+ proposalSentHooks: z.ZodObject<{
15
+ discord: z.ZodNullable<z.ZodString>;
16
+ slack: z.ZodNullable<z.ZodString>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ discord: string | null;
19
+ slack: string | null;
20
+ }, {
21
+ discord: string | null;
22
+ slack: string | null;
23
+ }>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ suitabilityHooks: {
26
+ discord: string | null;
27
+ slack: string | null;
28
+ };
29
+ proposalSentHooks: {
30
+ discord: string | null;
31
+ slack: string | null;
32
+ };
33
+ }, {
34
+ suitabilityHooks: {
35
+ discord: string | null;
36
+ slack: string | null;
37
+ };
38
+ proposalSentHooks: {
39
+ discord: string | null;
40
+ slack: string | null;
41
+ };
42
+ }>;
43
+ export declare const updateCampaignIntegrationsSchema: z.ZodObject<{
44
+ suitabilityHooks: z.ZodOptional<z.ZodObject<{
45
+ discord: z.ZodNullable<z.ZodString>;
46
+ slack: z.ZodNullable<z.ZodString>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ discord: string | null;
49
+ slack: string | null;
50
+ }, {
51
+ discord: string | null;
52
+ slack: string | null;
53
+ }>>;
54
+ proposalSentHooks: z.ZodOptional<z.ZodObject<{
55
+ discord: z.ZodNullable<z.ZodString>;
56
+ slack: z.ZodNullable<z.ZodString>;
57
+ }, "strip", z.ZodTypeAny, {
58
+ discord: string | null;
59
+ slack: string | null;
60
+ }, {
61
+ discord: string | null;
62
+ slack: string | null;
63
+ }>>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ suitabilityHooks?: {
66
+ discord: string | null;
67
+ slack: string | null;
68
+ } | undefined;
69
+ proposalSentHooks?: {
70
+ discord: string | null;
71
+ slack: string | null;
72
+ } | undefined;
73
+ }, {
74
+ suitabilityHooks?: {
75
+ discord: string | null;
76
+ slack: string | null;
77
+ } | undefined;
78
+ proposalSentHooks?: {
79
+ discord: string | null;
80
+ slack: string | null;
81
+ } | undefined;
82
+ }>;
83
+ export type CampaignIntegration = z.infer<typeof campaignIntegrations>;
84
+ export interface CampaignIntegrations extends z.infer<typeof campaignIntegrationsSchema> {
85
+ }
86
+ export interface UpdateCampaignIntegrations extends z.infer<typeof updateCampaignIntegrationsSchema> {
87
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateCampaignIntegrationsSchema = exports.campaignIntegrationsSchema = exports.campaignIntegrations = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.campaignIntegrations = zod_1.z.enum(["discord", "slack"]);
6
+ exports.campaignIntegrationsSchema = zod_1.z.object({
7
+ suitabilityHooks: zod_1.z.object({
8
+ discord: zod_1.z.string().url().nullable(),
9
+ slack: zod_1.z.string().url().nullable(),
10
+ }),
11
+ proposalSentHooks: zod_1.z.object({
12
+ discord: zod_1.z.string().url().nullable(),
13
+ slack: zod_1.z.string().url().nullable(),
14
+ }),
15
+ });
16
+ exports.updateCampaignIntegrationsSchema = exports.campaignIntegrationsSchema.partial();
@@ -0,0 +1,2 @@
1
+ import { z } from "zod";
2
+ export declare const campaignJobCountSchema: z.ZodRecord<z.ZodEnum<["leads", "contacted", "viewed", "replied", "negotiations", "won", "lost"]>, z.ZodNumber>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.campaignJobCountSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const lead_1 = require("../lead");
6
+ exports.campaignJobCountSchema = zod_1.z.record(lead_1.leadStatusSchema, zod_1.z.number());
@@ -1,58 +0,0 @@
1
- import { z } from "zod";
2
- export declare const campaignNotificationType: z.ZodEnum<["suitableLead", "proposalSent", "proposalViewed", "proposalReplied", "lowConnects", "noConnects", "accountDisconnected"]>;
3
- export type CampaignNotificationType = z.infer<typeof campaignNotificationType>;
4
- export declare const CAMPAIGN_WEBHOOK_TYPES: Record<CampaignNotificationType, string>;
5
- export declare const campaignWebhookSettingsSchema: z.ZodObject<{
6
- [k: string]: z.ZodDefault<z.ZodBoolean>;
7
- }, "strip", z.ZodTypeAny, {
8
- [x: string]: boolean;
9
- }, {
10
- [x: string]: boolean | undefined;
11
- }>;
12
- export declare const campaignWebhookSchema: z.ZodObject<{
13
- id: z.ZodString;
14
- title: z.ZodString;
15
- url: z.ZodString;
16
- notificationSettings: z.ZodObject<{
17
- [k: string]: z.ZodDefault<z.ZodBoolean>;
18
- }, "strip", z.ZodTypeAny, {
19
- [x: string]: boolean;
20
- }, {
21
- [x: string]: boolean | undefined;
22
- }>;
23
- }, "strip", z.ZodTypeAny, {
24
- id: string;
25
- title: string;
26
- url: string;
27
- notificationSettings: {
28
- [x: string]: boolean;
29
- };
30
- }, {
31
- id: string;
32
- title: string;
33
- url: string;
34
- notificationSettings: {
35
- [x: string]: boolean | undefined;
36
- };
37
- }>;
38
- export declare const sendNotificationRequestSchema: z.ZodObject<{
39
- organizationId: z.ZodString;
40
- campaignId: z.ZodString;
41
- leadId: z.ZodString;
42
- type: z.ZodEnum<["suitableLead", "proposalSent", "proposalViewed", "proposalReplied", "lowConnects", "noConnects", "accountDisconnected"]>;
43
- }, "strip", z.ZodTypeAny, {
44
- type: "suitableLead" | "proposalSent" | "proposalViewed" | "proposalReplied" | "lowConnects" | "noConnects" | "accountDisconnected";
45
- organizationId: string;
46
- campaignId: string;
47
- leadId: string;
48
- }, {
49
- type: "suitableLead" | "proposalSent" | "proposalViewed" | "proposalReplied" | "lowConnects" | "noConnects" | "accountDisconnected";
50
- organizationId: string;
51
- campaignId: string;
52
- leadId: string;
53
- }>;
54
- export type SendNotificationRequest = z.infer<typeof sendNotificationRequestSchema>;
55
- export interface CampaignWebhook extends z.infer<typeof campaignWebhookSchema> {
56
- }
57
- export interface CampaignWebhookSettings extends z.infer<typeof campaignWebhookSettingsSchema> {
58
- }
@@ -1,8 +1,7 @@
1
- import { infer, z } from "zod";
2
- import { JobFilters } from "../job";
3
- import { CoverLetterTemplate } from "../organization";
4
- import { CampaignExpenses } from "./campaign-expenses";
5
- import { CampaignWebhook } from "./campaign-webhooks";
1
+ import { infer, z } from 'zod';
2
+ import { JobFilters } from '../job';
3
+ import { CoverLetterTemplate } from '../organization';
4
+ import { CampaignExpenses } from './campaign-expenses';
6
5
  export declare const bidConfigSchema: z.ZodObject<{
7
6
  agencyName: z.ZodNullable<z.ZodString>;
8
7
  bidderId: z.ZodNullable<z.ZodString>;
@@ -272,32 +271,6 @@ export declare const campaignSchema: z.ZodObject<{
272
271
  boosted?: number | undefined;
273
272
  }>;
274
273
  notificationsEnabled: z.ZodNullable<z.ZodBoolean>;
275
- webhooks: z.ZodArray<z.ZodObject<{
276
- id: z.ZodString;
277
- title: z.ZodString;
278
- url: z.ZodString;
279
- notificationSettings: z.ZodObject<{
280
- [k: string]: z.ZodDefault<z.ZodBoolean>;
281
- }, "strip", z.ZodTypeAny, {
282
- [x: string]: boolean;
283
- }, {
284
- [x: string]: boolean | undefined;
285
- }>;
286
- }, "strip", z.ZodTypeAny, {
287
- id: string;
288
- title: string;
289
- url: string;
290
- notificationSettings: {
291
- [x: string]: boolean;
292
- };
293
- }, {
294
- id: string;
295
- title: string;
296
- url: string;
297
- notificationSettings: {
298
- [x: string]: boolean | undefined;
299
- };
300
- }>, "many">;
301
274
  status: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"active">, z.ZodLiteral<"draft">, z.ZodLiteral<"paused">, z.ZodLiteral<"error">]>>;
302
275
  bidConfig: z.ZodNullable<z.ZodObject<{
303
276
  agencyName: z.ZodNullable<z.ZodString>;
@@ -316,6 +289,7 @@ export declare const campaignSchema: z.ZodObject<{
316
289
  specialisedProfile: string | null;
317
290
  }>>;
318
291
  coverLetterTemplateId: z.ZodNullable<z.ZodString>;
292
+ priority: z.ZodNullable<z.ZodNumber>;
319
293
  }, "strip", z.ZodTypeAny, {
320
294
  id: string;
321
295
  name: string;
@@ -384,14 +358,6 @@ export declare const campaignSchema: z.ZodObject<{
384
358
  boosted: number;
385
359
  };
386
360
  notificationsEnabled: boolean | null;
387
- webhooks: {
388
- id: string;
389
- title: string;
390
- url: string;
391
- notificationSettings: {
392
- [x: string]: boolean;
393
- };
394
- }[];
395
361
  bidConfig: {
396
362
  agencyName: string | null;
397
363
  bidderId: string | null;
@@ -399,6 +365,7 @@ export declare const campaignSchema: z.ZodObject<{
399
365
  specialisedProfile: string | null;
400
366
  } | null;
401
367
  coverLetterTemplateId: string | null;
368
+ priority: number | null;
402
369
  status?: "active" | "draft" | "paused" | "error" | undefined;
403
370
  }, {
404
371
  id: string;
@@ -465,14 +432,6 @@ export declare const campaignSchema: z.ZodObject<{
465
432
  boosted?: number | undefined;
466
433
  };
467
434
  notificationsEnabled: boolean | null;
468
- webhooks: {
469
- id: string;
470
- title: string;
471
- url: string;
472
- notificationSettings: {
473
- [x: string]: boolean | undefined;
474
- };
475
- }[];
476
435
  bidConfig: {
477
436
  agencyName: string | null;
478
437
  bidderId: string | null;
@@ -480,6 +439,7 @@ export declare const campaignSchema: z.ZodObject<{
480
439
  specialisedProfile: string | null;
481
440
  } | null;
482
441
  coverLetterTemplateId: string | null;
442
+ priority: number | null;
483
443
  status?: "active" | "draft" | "paused" | "error" | undefined;
484
444
  boostingEnabled?: boolean | null | undefined;
485
445
  maximumBoost?: number | null | undefined;
@@ -750,32 +710,6 @@ export declare const createCampaignSchema: z.ZodObject<Omit<{
750
710
  boosted?: number | undefined;
751
711
  }>;
752
712
  notificationsEnabled: z.ZodNullable<z.ZodBoolean>;
753
- webhooks: z.ZodArray<z.ZodObject<{
754
- id: z.ZodString;
755
- title: z.ZodString;
756
- url: z.ZodString;
757
- notificationSettings: z.ZodObject<{
758
- [k: string]: z.ZodDefault<z.ZodBoolean>;
759
- }, "strip", z.ZodTypeAny, {
760
- [x: string]: boolean;
761
- }, {
762
- [x: string]: boolean | undefined;
763
- }>;
764
- }, "strip", z.ZodTypeAny, {
765
- id: string;
766
- title: string;
767
- url: string;
768
- notificationSettings: {
769
- [x: string]: boolean;
770
- };
771
- }, {
772
- id: string;
773
- title: string;
774
- url: string;
775
- notificationSettings: {
776
- [x: string]: boolean | undefined;
777
- };
778
- }>, "many">;
779
713
  status: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"active">, z.ZodLiteral<"draft">, z.ZodLiteral<"paused">, z.ZodLiteral<"error">]>>;
780
714
  bidConfig: z.ZodNullable<z.ZodObject<{
781
715
  agencyName: z.ZodNullable<z.ZodString>;
@@ -794,6 +728,7 @@ export declare const createCampaignSchema: z.ZodObject<Omit<{
794
728
  specialisedProfile: string | null;
795
729
  }>>;
796
730
  coverLetterTemplateId: z.ZodNullable<z.ZodString>;
731
+ priority: z.ZodNullable<z.ZodNumber>;
797
732
  }, "id" | "createdAt" | "updatedAt" | "bidConfig">, "strip", z.ZodTypeAny, {
798
733
  name: string;
799
734
  filters: {
@@ -859,15 +794,8 @@ export declare const createCampaignSchema: z.ZodObject<Omit<{
859
794
  boosted: number;
860
795
  };
861
796
  notificationsEnabled: boolean | null;
862
- webhooks: {
863
- id: string;
864
- title: string;
865
- url: string;
866
- notificationSettings: {
867
- [x: string]: boolean;
868
- };
869
- }[];
870
797
  coverLetterTemplateId: string | null;
798
+ priority: number | null;
871
799
  status?: "active" | "draft" | "paused" | "error" | undefined;
872
800
  }, {
873
801
  name: string;
@@ -931,15 +859,8 @@ export declare const createCampaignSchema: z.ZodObject<Omit<{
931
859
  boosted?: number | undefined;
932
860
  };
933
861
  notificationsEnabled: boolean | null;
934
- webhooks: {
935
- id: string;
936
- title: string;
937
- url: string;
938
- notificationSettings: {
939
- [x: string]: boolean | undefined;
940
- };
941
- }[];
942
862
  coverLetterTemplateId: string | null;
863
+ priority: number | null;
943
864
  status?: "active" | "draft" | "paused" | "error" | undefined;
944
865
  boostingEnabled?: boolean | null | undefined;
945
866
  maximumBoost?: number | null | undefined;
@@ -1196,32 +1117,6 @@ export declare const updateCampaignSchema: z.ZodObject<{
1196
1117
  boosted?: number | undefined;
1197
1118
  }>>;
1198
1119
  notificationsEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
1199
- webhooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1200
- id: z.ZodString;
1201
- title: z.ZodString;
1202
- url: z.ZodString;
1203
- notificationSettings: z.ZodObject<{
1204
- [k: string]: z.ZodDefault<z.ZodBoolean>;
1205
- }, "strip", z.ZodTypeAny, {
1206
- [x: string]: boolean;
1207
- }, {
1208
- [x: string]: boolean | undefined;
1209
- }>;
1210
- }, "strip", z.ZodTypeAny, {
1211
- id: string;
1212
- title: string;
1213
- url: string;
1214
- notificationSettings: {
1215
- [x: string]: boolean;
1216
- };
1217
- }, {
1218
- id: string;
1219
- title: string;
1220
- url: string;
1221
- notificationSettings: {
1222
- [x: string]: boolean | undefined;
1223
- };
1224
- }>, "many">>;
1225
1120
  bidConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1226
1121
  agencyName: z.ZodNullable<z.ZodString>;
1227
1122
  bidderId: z.ZodNullable<z.ZodString>;
@@ -1239,6 +1134,7 @@ export declare const updateCampaignSchema: z.ZodObject<{
1239
1134
  specialisedProfile: string | null;
1240
1135
  }>>>;
1241
1136
  coverLetterTemplateId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1137
+ priority: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1242
1138
  }, "strip", z.ZodTypeAny, {
1243
1139
  status?: "active" | "draft" | "paused" | "error" | undefined;
1244
1140
  id?: string | undefined;
@@ -1306,14 +1202,6 @@ export declare const updateCampaignSchema: z.ZodObject<{
1306
1202
  boosted: number;
1307
1203
  } | undefined;
1308
1204
  notificationsEnabled?: boolean | null | undefined;
1309
- webhooks?: {
1310
- id: string;
1311
- title: string;
1312
- url: string;
1313
- notificationSettings: {
1314
- [x: string]: boolean;
1315
- };
1316
- }[] | undefined;
1317
1205
  bidConfig?: {
1318
1206
  agencyName: string | null;
1319
1207
  bidderId: string | null;
@@ -1321,6 +1209,7 @@ export declare const updateCampaignSchema: z.ZodObject<{
1321
1209
  specialisedProfile: string | null;
1322
1210
  } | null | undefined;
1323
1211
  coverLetterTemplateId?: string | null | undefined;
1212
+ priority?: number | null | undefined;
1324
1213
  }, {
1325
1214
  status?: "active" | "draft" | "paused" | "error" | undefined;
1326
1215
  id?: string | undefined;
@@ -1388,14 +1277,6 @@ export declare const updateCampaignSchema: z.ZodObject<{
1388
1277
  boosted?: number | undefined;
1389
1278
  } | undefined;
1390
1279
  notificationsEnabled?: boolean | null | undefined;
1391
- webhooks?: {
1392
- id: string;
1393
- title: string;
1394
- url: string;
1395
- notificationSettings: {
1396
- [x: string]: boolean | undefined;
1397
- };
1398
- }[] | undefined;
1399
1280
  bidConfig?: {
1400
1281
  agencyName: string | null;
1401
1282
  bidderId: string | null;
@@ -1403,11 +1284,11 @@ export declare const updateCampaignSchema: z.ZodObject<{
1403
1284
  specialisedProfile: string | null;
1404
1285
  } | null | undefined;
1405
1286
  coverLetterTemplateId?: string | null | undefined;
1287
+ priority?: number | null | undefined;
1406
1288
  }>;
1407
1289
  export interface Campaign extends z.infer<typeof campaignSchema> {
1408
1290
  filters: JobFilters;
1409
1291
  expenses: CampaignExpenses;
1410
- webhooks: CampaignWebhook[];
1411
1292
  bidConfig: BidConfig | null;
1412
1293
  coverLetterTemplate: CoverLetterTemplate | null;
1413
1294
  }
@@ -1418,7 +1299,6 @@ export interface CreateCampaign extends z.infer<typeof createCampaignSchema> {
1418
1299
  export interface UpdateCampaign extends z.infer<typeof updateCampaignSchema> {
1419
1300
  filters?: JobFilters;
1420
1301
  expenses?: CampaignExpenses;
1421
- webhooks?: CampaignWebhook[];
1422
1302
  bidConfig?: BidConfig;
1423
1303
  }
1424
1304
  export interface BidConfig extends infer<typeof bidConfigSchema> {
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateCampaignSchema = exports.createCampaignSchema = exports.campaignSchema = exports.campaignStatusSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const job_filters_1 = require("../job-filters");
6
+ const lead_1 = require("../lead");
7
+ const campaign_expenses_1 = require("./campaign-expenses");
8
+ const campaign_integrations_1 = require("./campaign-integrations");
9
+ exports.campaignStatusSchema = zod_1.z.union([
10
+ zod_1.z.literal('active'),
11
+ zod_1.z.literal('draft'),
12
+ zod_1.z.literal('paused'),
13
+ zod_1.z.literal('error'),
14
+ ]);
15
+ exports.campaignSchema = zod_1.z.object({
16
+ id: zod_1.z.string(),
17
+ name: zod_1.z.string(),
18
+ filters: job_filters_1.jobFiltersSchema,
19
+ createdAt: (0, zod_1.number)(),
20
+ updatedAt: (0, zod_1.number)(),
21
+ confirmedBillingAt: (0, zod_1.number)().nullable(),
22
+ automatedSuitability: zod_1.z.boolean().nullable(),
23
+ automatedBidding: zod_1.z.boolean().nullable(),
24
+ boostingEnabled: zod_1.z.boolean().nullable().default(false),
25
+ maximumBoost: zod_1.z.number().nullable().default(30),
26
+ minimumBoost: zod_1.z.number().nullable().default(0),
27
+ webhookUrl: zod_1.z.string().nullable(),
28
+ monthlyBudget: zod_1.z.number().nullable(),
29
+ suitabilityThreshold: zod_1.z.number().min(0).max(100).nullable().default(0),
30
+ boostingThreshold: zod_1.z.number().min(0).max(100).nullable().default(0),
31
+ leadCounts: zod_1.z.record(lead_1.leadStatusSchema, zod_1.z.number()).nullable(),
32
+ expenses: campaign_expenses_1.campaignExpensesSchema,
33
+ integrations: campaign_integrations_1.campaignIntegrationsSchema,
34
+ status: exports.campaignStatusSchema.optional(),
35
+ });
36
+ exports.createCampaignSchema = exports.campaignSchema.omit({
37
+ id: true,
38
+ createdAt: true,
39
+ updatedAt: true,
40
+ });
41
+ exports.updateCampaignSchema = exports.campaignSchema.omit({
42
+ createdAt: true,
43
+ updatedAt: true,
44
+ });
@@ -1,6 +1,6 @@
1
1
  export * from './campaign';
2
2
  export * from './campaign-ai-metrics';
3
3
  export * from './campaign-analytics';
4
+ export * from './campaign-chat-bot';
4
5
  export * from './campaign-expenses';
5
6
  export * from './campaign-insights';
6
- export * from './campaign-webhooks';
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./campaign"), exports);
18
+ __exportStar(require("./campaign-insights"), exports);
19
+ __exportStar(require("./campaign-job-count"), exports);
20
+ __exportStar(require("./campaign-expenses"), exports);
21
+ __exportStar(require("./campaign-integrations"), exports);
22
+ __exportStar(require("./campaign-analytics"), exports);
23
+ __exportStar(require("./campaign-ai-metrics"), exports);
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ export declare const chatMessageSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ content: z.ZodString;
5
+ role: z.ZodEnum<["user", "assistant"]>;
6
+ timestamp: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ id: string;
9
+ content: string;
10
+ role: "user" | "assistant";
11
+ timestamp: string;
12
+ }, {
13
+ id: string;
14
+ content: string;
15
+ role: "user" | "assistant";
16
+ timestamp: string;
17
+ }>;
18
+ export declare const newChatMessageSchema: z.ZodObject<Omit<{
19
+ id: z.ZodString;
20
+ content: z.ZodString;
21
+ role: z.ZodEnum<["user", "assistant"]>;
22
+ timestamp: z.ZodString;
23
+ }, "id">, "strip", z.ZodTypeAny, {
24
+ content: string;
25
+ role: "user" | "assistant";
26
+ timestamp: string;
27
+ }, {
28
+ content: string;
29
+ role: "user" | "assistant";
30
+ timestamp: string;
31
+ }>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.newChatMessageSchema = exports.chatMessageSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.chatMessageSchema = zod_1.z.object({
6
+ id: zod_1.z.string(),
7
+ content: zod_1.z.string(),
8
+ role: zod_1.z.enum(['user', 'assistant']),
9
+ timestamp: zod_1.z.string(),
10
+ });
11
+ exports.newChatMessageSchema = exports.chatMessageSchema.omit({
12
+ id: true,
13
+ });
@@ -0,0 +1 @@
1
+ export * from './chat-message';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./chat-message"), exports);