lancer-shared 1.2.83 → 1.2.85

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 (252) hide show
  1. package/dist/bundle.cjs.js +211 -167
  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/proxies.d.ts +4 -0
  14. package/dist/constants/routes.d.ts +10 -1
  15. package/dist/constants/routes.js +114 -0
  16. package/dist/constants/upwork-accounts.js +21 -0
  17. package/dist/constants/upwork-filters.d.ts +5 -0
  18. package/dist/constants/upwork-filters.js +75 -0
  19. package/dist/index.js +20 -0
  20. package/dist/schemas/account/account-status.js +11 -0
  21. package/dist/schemas/account/bidder-account.js +37 -0
  22. package/dist/schemas/account/exceptions/no-bidder-accounts-available.d.ts +5 -0
  23. package/dist/schemas/account/index.js +19 -0
  24. package/dist/schemas/account/manager-account.d.ts +116 -0
  25. package/dist/schemas/account/manager-account.js +38 -0
  26. package/dist/schemas/account/scraper-account.js +37 -0
  27. package/dist/schemas/agent/index.d.ts +10 -0
  28. package/dist/schemas/ai/ai-config.d.ts +36 -0
  29. package/dist/schemas/ai/ai-config.js +12 -0
  30. package/dist/schemas/ai/index.d.ts +3 -0
  31. package/dist/schemas/ai/index.js +19 -0
  32. package/dist/schemas/ai/proposal.d.ts +82 -0
  33. package/dist/schemas/ai/proposal.js +16 -0
  34. package/dist/schemas/ai/suitability.d.ts +37 -0
  35. package/dist/schemas/ai/suitability.js +17 -0
  36. package/dist/schemas/ai-config/ai-config.d.ts +39 -0
  37. package/dist/schemas/ai-config/ai-config.js +12 -0
  38. package/dist/schemas/ai-config/index.d.ts +1 -0
  39. package/dist/schemas/ai-config/index.js +17 -0
  40. package/dist/schemas/bid/bid-result.js +15 -0
  41. package/dist/schemas/bid/bid-status.d.ts +30 -0
  42. package/dist/schemas/bid/bid-status.js +15 -0
  43. package/dist/schemas/bid/bid.js +36 -0
  44. package/dist/schemas/bid/exceptions/base-exception.d.ts +4 -0
  45. package/dist/schemas/bid/exceptions/evalute-element.exception.d.ts +5 -0
  46. package/dist/schemas/bid/exceptions/wait-for-function-timeout.d.ts +5 -0
  47. package/dist/schemas/bid/index.js +18 -0
  48. package/dist/schemas/bidding/index.d.ts +1 -0
  49. package/dist/schemas/bidding/index.js +17 -0
  50. package/dist/schemas/bidding/proposal-bidding-status.d.ts +26 -0
  51. package/dist/schemas/bidding/proposal-bidding-status.js +18 -0
  52. package/dist/schemas/bidding/proposal-dto.d.ts +26 -0
  53. package/dist/schemas/bidding/proposal-dto.js +18 -0
  54. package/dist/schemas/campaign/campaign-ai-metrics.js +9 -0
  55. package/dist/schemas/campaign/campaign-analytics.d.ts +67 -232
  56. package/dist/schemas/campaign/campaign-analytics.js +41 -0
  57. package/dist/schemas/campaign/campaign-chat-bot.d.ts +154 -0
  58. package/dist/schemas/campaign/campaign-expenses.js +9 -0
  59. package/dist/schemas/campaign/campaign-insights.js +31 -0
  60. package/dist/schemas/campaign/campaign-integrations.d.ts +82 -0
  61. package/dist/schemas/campaign/campaign-integrations.js +16 -0
  62. package/dist/schemas/campaign/campaign-job-count.d.ts +2 -0
  63. package/dist/schemas/campaign/campaign-job-count.js +6 -0
  64. package/dist/schemas/campaign/campaign-webhooks.d.ts +0 -58
  65. package/dist/schemas/campaign/campaign.d.ts +4 -133
  66. package/dist/schemas/campaign/campaign.js +44 -0
  67. package/dist/schemas/campaign/index.d.ts +1 -1
  68. package/dist/schemas/campaign/index.js +23 -0
  69. package/dist/schemas/chat-message/chat-message.d.ts +31 -0
  70. package/dist/schemas/chat-message/chat-message.js +13 -0
  71. package/dist/schemas/chat-message/index.d.ts +1 -0
  72. package/dist/schemas/chat-message/index.js +17 -0
  73. package/dist/schemas/config/agency-config.d.ts +17 -0
  74. package/dist/schemas/config/agency-config.js +10 -0
  75. package/dist/schemas/config/index.d.ts +1 -0
  76. package/dist/schemas/config/index.js +17 -0
  77. package/dist/schemas/index.js +32 -0
  78. package/dist/schemas/job/index.js +19 -0
  79. package/dist/schemas/job/job-details.d.ts +335 -0
  80. package/dist/schemas/job/job-details.js +29 -0
  81. package/dist/schemas/job/job-note.d.ts +83 -0
  82. package/dist/schemas/job/job-note.js +30 -0
  83. package/dist/schemas/job/job-pipeline.d.ts +74 -0
  84. package/dist/schemas/job/job-pipeline.js +29 -0
  85. package/dist/schemas/job/job-status.d.ts +3 -0
  86. package/dist/schemas/job/job-status.js +27 -0
  87. package/dist/schemas/job/job-suitability.d.ts +12 -0
  88. package/dist/schemas/job/job-suitability.js +13 -0
  89. package/dist/schemas/job/job.d.ts +1160 -0
  90. package/dist/schemas/job/job.js +90 -0
  91. package/dist/schemas/job/pipeline-job.d.ts +608 -0
  92. package/dist/schemas/job/pipeline-job.js +43 -0
  93. package/dist/schemas/job/upwork-job.d.ts +334 -0
  94. package/dist/schemas/job/upwork-job.js +60 -0
  95. package/dist/schemas/job-filters/index.d.ts +1 -0
  96. package/dist/schemas/job-filters/index.js +17 -0
  97. package/dist/schemas/job-filters/job-filters.d.ts +241 -0
  98. package/dist/schemas/job-filters/job-filters.js +87 -0
  99. package/dist/schemas/knowledge-object/index.d.ts +1 -0
  100. package/dist/schemas/knowledge-object/index.js +17 -0
  101. package/dist/schemas/knowledge-object/knowledge-object.d.ts +128 -0
  102. package/dist/schemas/knowledge-object/knowledge-object.js +47 -0
  103. package/dist/schemas/lead/index.d.ts +30 -4
  104. package/dist/schemas/lead/index.js +19 -0
  105. package/dist/schemas/lead/lead-note.d.ts +83 -0
  106. package/dist/schemas/lead/lead-note.js +30 -0
  107. package/dist/schemas/lead/lead-status.js +26 -0
  108. package/dist/schemas/lead/lead.d.ts +1897 -0
  109. package/dist/schemas/lead/lead.js +143 -0
  110. package/dist/schemas/lead/nuxt.d.ts +1664 -0
  111. package/dist/schemas/logger/index.js +17 -0
  112. package/dist/schemas/logger/log-event.d.ts +19 -11
  113. package/dist/schemas/logger/log-event.js +66 -0
  114. package/dist/schemas/organization/index.d.ts +11 -7
  115. package/dist/schemas/organization/index.js +17 -0
  116. package/dist/schemas/organization/organization.d.ts +70 -0
  117. package/dist/schemas/organization/organization.js +19 -0
  118. package/dist/schemas/proxy/index.js +17 -0
  119. package/dist/schemas/proxy/proxy-available-replacements.d.ts +1 -1
  120. package/dist/schemas/proxy/proxy.js +23 -0
  121. package/dist/schemas/saved-search/index.js +12 -0
  122. package/dist/schemas/scraper/index.js +18 -0
  123. package/dist/schemas/scraper/scrape-payload.d.ts +15 -58
  124. package/dist/schemas/scraper/scrape-payload.js +16 -0
  125. package/dist/schemas/scraper/scrape-response.d.ts +345 -0
  126. package/dist/schemas/scraper/scrape-response.js +9 -0
  127. package/dist/schemas/scraper/scrape-result.js +23 -0
  128. package/dist/schemas/shared.js +16 -0
  129. package/dist/schemas/time-filter/index.js +9 -0
  130. package/dist/schemas/upwork-account/index.d.ts +3 -0
  131. package/dist/schemas/upwork-account/index.js +19 -0
  132. package/dist/schemas/upwork-account/upwork-account-status.d.ts +2 -0
  133. package/dist/schemas/upwork-account/upwork-account-status.js +11 -0
  134. package/dist/schemas/upwork-account/upwork-business-manager-account.d.ts +95 -0
  135. package/dist/schemas/upwork-account/upwork-business-manager-account.js +35 -0
  136. package/dist/schemas/upwork-account/upwork-scraper-account.d.ts +92 -0
  137. package/dist/schemas/upwork-account/upwork-scraper-account.js +31 -0
  138. package/dist/schemas/upwork-account/upwork-scraping-account.d.ts +90 -0
  139. package/dist/schemas/upwork-account/upwork-scraping-account.js +30 -0
  140. package/dist/schemas/user/index.js +55 -0
  141. package/dist/types/account/account-status.d.ts +3 -0
  142. package/dist/types/account/account-status.js +2 -0
  143. package/dist/types/account/bidder-account.d.ts +7 -0
  144. package/dist/types/account/bidder-account.js +2 -0
  145. package/dist/types/account/index.d.ts +3 -0
  146. package/dist/types/account/index.js +19 -0
  147. package/dist/types/account/manager-account.d.ts +7 -0
  148. package/dist/types/account/manager-account.js +2 -0
  149. package/dist/types/account/scraper-account.d.ts +5 -0
  150. package/dist/types/account/scraper-account.js +2 -0
  151. package/dist/types/ai/ai-config.d.ts +6 -0
  152. package/dist/types/ai/ai-config.js +2 -0
  153. package/dist/types/ai/index.d.ts +3 -0
  154. package/dist/types/ai/index.js +19 -0
  155. package/dist/types/ai/proposal.d.ts +10 -0
  156. package/dist/types/ai/proposal.js +2 -0
  157. package/dist/types/ai/suitability.d.ts +6 -0
  158. package/dist/types/ai/suitability.js +2 -0
  159. package/dist/types/ai-config/ai-config.d.ts +6 -0
  160. package/dist/types/ai-config/ai-config.js +2 -0
  161. package/dist/types/ai-config/index.d.ts +1 -0
  162. package/dist/types/ai-config/index.js +17 -0
  163. package/dist/types/bid/bid-result.d.ts +5 -0
  164. package/dist/types/bid/bid-result.js +2 -0
  165. package/dist/types/bid/bid-status.d.ts +5 -0
  166. package/dist/types/bid/bid-status.js +2 -0
  167. package/dist/types/bid/bid.d.ts +9 -0
  168. package/dist/types/bid/bid.js +2 -0
  169. package/dist/types/bid/index.d.ts +2 -0
  170. package/dist/types/bid/index.js +18 -0
  171. package/dist/types/bidding/index.d.ts +1 -0
  172. package/dist/types/bidding/index.js +17 -0
  173. package/dist/types/bidding/proposal-bidding-status.d.ts +3 -0
  174. package/dist/types/bidding/proposal-bidding-status.js +2 -0
  175. package/dist/types/bidding/proposal-dto.d.ts +3 -0
  176. package/dist/types/bidding/proposal-dto.js +2 -0
  177. package/dist/types/campaign/campaign-analytics.d.ts +7 -0
  178. package/dist/types/campaign/campaign-analytics.js +2 -0
  179. package/dist/types/campaign/campaign-expenses.d.ts +3 -0
  180. package/dist/types/campaign/campaign-expenses.js +2 -0
  181. package/dist/types/campaign/campaign-insights.js +2 -0
  182. package/dist/types/campaign/campaign-integrations.d.ts +6 -0
  183. package/dist/types/campaign/campaign-integrations.js +2 -0
  184. package/dist/types/campaign/campaign-job-count.d.ts +4 -0
  185. package/dist/types/campaign/campaign-job-count.js +2 -0
  186. package/dist/types/campaign/campaign.d.ts +0 -2
  187. package/dist/types/campaign/campaign.js +2 -0
  188. package/dist/types/campaign/index.js +22 -0
  189. package/dist/types/chat-message/chat-message.d.ts +4 -0
  190. package/dist/types/chat-message/chat-message.js +2 -0
  191. package/dist/types/chat-message/index.d.ts +1 -0
  192. package/dist/types/chat-message/index.js +17 -0
  193. package/dist/types/config/agency-config.d.ts +4 -0
  194. package/dist/types/config/agency-config.js +2 -0
  195. package/dist/types/config/index.d.ts +1 -0
  196. package/dist/types/config/index.js +17 -0
  197. package/dist/types/index.d.ts +15 -0
  198. package/dist/types/index.js +29 -0
  199. package/dist/types/job/index.d.ts +48 -0
  200. package/dist/types/job/index.js +19 -0
  201. package/dist/types/job/job-details.d.ts +36 -0
  202. package/dist/types/job/job-details.js +2 -0
  203. package/dist/types/job/job-note.d.ts +10 -0
  204. package/dist/types/job/job-note.js +2 -0
  205. package/dist/types/job/job-pipeline.d.ts +4 -0
  206. package/dist/types/job/job-pipeline.js +2 -0
  207. package/dist/types/job/job-status.d.ts +5 -0
  208. package/dist/types/job/job-status.js +12 -0
  209. package/dist/types/job/job-suitability.d.ts +3 -0
  210. package/dist/types/job/job-suitability.js +2 -0
  211. package/dist/types/job/job.d.ts +36 -0
  212. package/dist/types/job/job.js +2 -0
  213. package/dist/types/job/nuxt.d.ts +4 -0
  214. package/dist/types/job-filters/index.d.ts +1 -0
  215. package/dist/types/job-filters/index.js +17 -0
  216. package/dist/types/job-filters/job-filters.d.ts +4 -0
  217. package/dist/types/job-filters/job-filters.js +2 -0
  218. package/dist/types/knowledge-object/index.d.ts +1 -0
  219. package/dist/types/knowledge-object/index.js +17 -0
  220. package/dist/types/knowledge-object/knowledge-object.d.ts +4 -0
  221. package/dist/types/knowledge-object/knowledge-object.js +2 -0
  222. package/dist/types/logger/index.d.ts +1 -0
  223. package/dist/types/logger/index.js +17 -0
  224. package/dist/types/logger/log-event.js +2 -0
  225. package/dist/types/saved-search/index.d.ts +6 -0
  226. package/dist/types/saved-search/index.js +2 -0
  227. package/dist/types/scraper/index.d.ts +2 -0
  228. package/dist/types/scraper/index.js +18 -0
  229. package/dist/types/scraper/scrape-payload.d.ts +10 -0
  230. package/dist/types/scraper/scrape-payload.js +2 -0
  231. package/dist/types/scraper/scrape-response.d.ts +4 -0
  232. package/dist/types/scraper/scrape-response.js +2 -0
  233. package/dist/types/scraper/scrape-result.d.ts +8 -0
  234. package/dist/types/scraper/scrape-result.js +2 -0
  235. package/dist/types/shared.d.ts +8 -0
  236. package/dist/types/time-filter/index.d.ts +3 -0
  237. package/dist/types/time-filter/index.js +2 -0
  238. package/dist/types/transaction/index.d.ts +4 -0
  239. package/dist/types/upwork-account/index.d.ts +3 -0
  240. package/dist/types/upwork-account/index.js +19 -0
  241. package/dist/types/upwork-account/upwork-account-status.d.ts +3 -0
  242. package/dist/types/upwork-account/upwork-account-status.js +2 -0
  243. package/dist/types/upwork-account/upwork-business-manager-account.d.ts +7 -0
  244. package/dist/types/upwork-account/upwork-business-manager-account.js +2 -0
  245. package/dist/types/upwork-account/upwork-scraping-account.d.ts +5 -0
  246. package/dist/types/upwork-account/upwork-scraping-account.js +2 -0
  247. package/dist/types/usage/index.d.ts +6 -0
  248. package/dist/types/user/index.d.ts +15 -0
  249. package/dist/types/user/index.js +2 -0
  250. package/dist/utils/index.js +17 -0
  251. package/dist/utils/try-catch.js +25 -0
  252. 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,154 @@
1
+ import { z } from 'zod';
2
+ export declare const campaignNotificationType: z.ZodEnum<["suitableLead", "proposalSent", "proposalViewed", "proposalReplied", "noConnects", "accountDisconnected"]>;
3
+ export declare const chatbotChannelSchema: z.ZodObject<{
4
+ id: z.ZodString;
5
+ name: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ id: string;
8
+ name: string;
9
+ }, {
10
+ id: string;
11
+ name: string;
12
+ }>;
13
+ export declare const chatbotPlatforms: z.ZodEnum<["discord"]>;
14
+ export declare const chatbotSchema: z.ZodObject<{
15
+ guildId: z.ZodString;
16
+ channels: z.ZodArray<z.ZodObject<{
17
+ id: z.ZodString;
18
+ name: z.ZodString;
19
+ }, "strip", z.ZodTypeAny, {
20
+ id: string;
21
+ name: string;
22
+ }, {
23
+ id: string;
24
+ name: string;
25
+ }>, "many">;
26
+ selectedChannelId: z.ZodNullable<z.ZodString>;
27
+ notificationsEnabled: z.ZodDefault<z.ZodBoolean>;
28
+ notificationSettings: z.ZodRecord<z.ZodEnum<["suitableLead", "proposalSent", "proposalViewed", "proposalReplied", "noConnects", "accountDisconnected"]>, z.ZodDefault<z.ZodBoolean>>;
29
+ organizationId: z.ZodString;
30
+ campaignId: z.ZodString;
31
+ createdAt: z.ZodNumber;
32
+ updatedAt: z.ZodNumber;
33
+ }, "strip", z.ZodTypeAny, {
34
+ guildId: string;
35
+ channels: {
36
+ id: string;
37
+ name: string;
38
+ }[];
39
+ selectedChannelId: string | null;
40
+ notificationsEnabled: boolean;
41
+ notificationSettings: Partial<Record<"suitableLead" | "proposalSent" | "proposalViewed" | "proposalReplied" | "noConnects" | "accountDisconnected", boolean>>;
42
+ organizationId: string;
43
+ campaignId: string;
44
+ createdAt: number;
45
+ updatedAt: number;
46
+ }, {
47
+ guildId: string;
48
+ channels: {
49
+ id: string;
50
+ name: string;
51
+ }[];
52
+ selectedChannelId: string | null;
53
+ notificationSettings: Partial<Record<"suitableLead" | "proposalSent" | "proposalViewed" | "proposalReplied" | "noConnects" | "accountDisconnected", boolean | undefined>>;
54
+ organizationId: string;
55
+ campaignId: string;
56
+ createdAt: number;
57
+ updatedAt: number;
58
+ notificationsEnabled?: boolean | undefined;
59
+ }>;
60
+ export declare const createChatbotSchema: z.ZodObject<Pick<{
61
+ guildId: z.ZodString;
62
+ channels: z.ZodArray<z.ZodObject<{
63
+ id: z.ZodString;
64
+ name: z.ZodString;
65
+ }, "strip", z.ZodTypeAny, {
66
+ id: string;
67
+ name: string;
68
+ }, {
69
+ id: string;
70
+ name: string;
71
+ }>, "many">;
72
+ selectedChannelId: z.ZodNullable<z.ZodString>;
73
+ notificationsEnabled: z.ZodDefault<z.ZodBoolean>;
74
+ notificationSettings: z.ZodRecord<z.ZodEnum<["suitableLead", "proposalSent", "proposalViewed", "proposalReplied", "noConnects", "accountDisconnected"]>, z.ZodDefault<z.ZodBoolean>>;
75
+ organizationId: z.ZodString;
76
+ campaignId: z.ZodString;
77
+ createdAt: z.ZodNumber;
78
+ updatedAt: z.ZodNumber;
79
+ }, "guildId" | "channels" | "organizationId" | "campaignId">, "strip", z.ZodTypeAny, {
80
+ guildId: string;
81
+ channels: {
82
+ id: string;
83
+ name: string;
84
+ }[];
85
+ organizationId: string;
86
+ campaignId: string;
87
+ }, {
88
+ guildId: string;
89
+ channels: {
90
+ id: string;
91
+ name: string;
92
+ }[];
93
+ organizationId: string;
94
+ campaignId: string;
95
+ }>;
96
+ export declare const updateChatbotSchema: z.ZodObject<Pick<{
97
+ guildId: z.ZodString;
98
+ channels: z.ZodArray<z.ZodObject<{
99
+ id: z.ZodString;
100
+ name: z.ZodString;
101
+ }, "strip", z.ZodTypeAny, {
102
+ id: string;
103
+ name: string;
104
+ }, {
105
+ id: string;
106
+ name: string;
107
+ }>, "many">;
108
+ selectedChannelId: z.ZodNullable<z.ZodString>;
109
+ notificationsEnabled: z.ZodDefault<z.ZodBoolean>;
110
+ notificationSettings: z.ZodRecord<z.ZodEnum<["suitableLead", "proposalSent", "proposalViewed", "proposalReplied", "noConnects", "accountDisconnected"]>, z.ZodDefault<z.ZodBoolean>>;
111
+ organizationId: z.ZodString;
112
+ campaignId: z.ZodString;
113
+ createdAt: z.ZodNumber;
114
+ updatedAt: z.ZodNumber;
115
+ }, "selectedChannelId" | "notificationsEnabled" | "notificationSettings">, "strip", z.ZodTypeAny, {
116
+ selectedChannelId: string | null;
117
+ notificationsEnabled: boolean;
118
+ notificationSettings: Partial<Record<"suitableLead" | "proposalSent" | "proposalViewed" | "proposalReplied" | "noConnects" | "accountDisconnected", boolean>>;
119
+ }, {
120
+ selectedChannelId: string | null;
121
+ notificationSettings: Partial<Record<"suitableLead" | "proposalSent" | "proposalViewed" | "proposalReplied" | "noConnects" | "accountDisconnected", boolean | undefined>>;
122
+ notificationsEnabled?: boolean | undefined;
123
+ }>;
124
+ export declare const sendNotifictionRequestSchema: z.ZodObject<{
125
+ organizationId: z.ZodString;
126
+ campaignId: z.ZodString;
127
+ leadId: z.ZodString;
128
+ notificationType: z.ZodEnum<["suitableLead", "proposalSent", "proposalViewed", "proposalReplied", "noConnects", "accountDisconnected"]>;
129
+ }, "strip", z.ZodTypeAny, {
130
+ organizationId: string;
131
+ campaignId: string;
132
+ leadId: string;
133
+ notificationType: "suitableLead" | "proposalSent" | "proposalViewed" | "proposalReplied" | "noConnects" | "accountDisconnected";
134
+ }, {
135
+ organizationId: string;
136
+ campaignId: string;
137
+ leadId: string;
138
+ notificationType: "suitableLead" | "proposalSent" | "proposalViewed" | "proposalReplied" | "noConnects" | "accountDisconnected";
139
+ }>;
140
+ export type CampaignNotificationType = z.infer<typeof campaignNotificationType>;
141
+ export interface SendNotificationRequest extends z.infer<typeof sendNotifictionRequestSchema> {
142
+ notificationType: CampaignNotificationType;
143
+ }
144
+ export declare const CAMPAIGN_NOTIFICATION_TYPES: Record<CampaignNotificationType, string>;
145
+ export declare const CAMPAIGN_NOTIFICATION_SETTINGS: Record<CampaignNotificationType, string>;
146
+ export interface ChatbotChannel extends z.infer<typeof chatbotChannelSchema> {
147
+ }
148
+ export type ChatbotPlatform = z.infer<typeof chatbotPlatforms>;
149
+ export interface CreateChatbot extends z.infer<typeof createChatbotSchema> {
150
+ channels: ChatbotChannel[];
151
+ }
152
+ export interface Chatbot extends z.infer<typeof chatbotSchema> {
153
+ channels: ChatbotChannel[];
154
+ }
@@ -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,82 @@
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
+ }>;
@@ -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>;
@@ -384,14 +357,6 @@ export declare const campaignSchema: z.ZodObject<{
384
357
  boosted: number;
385
358
  };
386
359
  notificationsEnabled: boolean | null;
387
- webhooks: {
388
- id: string;
389
- title: string;
390
- url: string;
391
- notificationSettings: {
392
- [x: string]: boolean;
393
- };
394
- }[];
395
360
  bidConfig: {
396
361
  agencyName: string | null;
397
362
  bidderId: string | null;
@@ -465,14 +430,6 @@ export declare const campaignSchema: z.ZodObject<{
465
430
  boosted?: number | undefined;
466
431
  };
467
432
  notificationsEnabled: boolean | null;
468
- webhooks: {
469
- id: string;
470
- title: string;
471
- url: string;
472
- notificationSettings: {
473
- [x: string]: boolean | undefined;
474
- };
475
- }[];
476
433
  bidConfig: {
477
434
  agencyName: string | null;
478
435
  bidderId: string | null;
@@ -750,32 +707,6 @@ export declare const createCampaignSchema: z.ZodObject<Omit<{
750
707
  boosted?: number | undefined;
751
708
  }>;
752
709
  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
710
  status: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"active">, z.ZodLiteral<"draft">, z.ZodLiteral<"paused">, z.ZodLiteral<"error">]>>;
780
711
  bidConfig: z.ZodNullable<z.ZodObject<{
781
712
  agencyName: z.ZodNullable<z.ZodString>;
@@ -859,14 +790,6 @@ export declare const createCampaignSchema: z.ZodObject<Omit<{
859
790
  boosted: number;
860
791
  };
861
792
  notificationsEnabled: boolean | null;
862
- webhooks: {
863
- id: string;
864
- title: string;
865
- url: string;
866
- notificationSettings: {
867
- [x: string]: boolean;
868
- };
869
- }[];
870
793
  coverLetterTemplateId: string | null;
871
794
  status?: "active" | "draft" | "paused" | "error" | undefined;
872
795
  }, {
@@ -931,14 +854,6 @@ export declare const createCampaignSchema: z.ZodObject<Omit<{
931
854
  boosted?: number | undefined;
932
855
  };
933
856
  notificationsEnabled: boolean | null;
934
- webhooks: {
935
- id: string;
936
- title: string;
937
- url: string;
938
- notificationSettings: {
939
- [x: string]: boolean | undefined;
940
- };
941
- }[];
942
857
  coverLetterTemplateId: string | null;
943
858
  status?: "active" | "draft" | "paused" | "error" | undefined;
944
859
  boostingEnabled?: boolean | null | undefined;
@@ -1196,32 +1111,6 @@ export declare const updateCampaignSchema: z.ZodObject<{
1196
1111
  boosted?: number | undefined;
1197
1112
  }>>;
1198
1113
  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
1114
  bidConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1226
1115
  agencyName: z.ZodNullable<z.ZodString>;
1227
1116
  bidderId: z.ZodNullable<z.ZodString>;
@@ -1306,14 +1195,6 @@ export declare const updateCampaignSchema: z.ZodObject<{
1306
1195
  boosted: number;
1307
1196
  } | undefined;
1308
1197
  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
1198
  bidConfig?: {
1318
1199
  agencyName: string | null;
1319
1200
  bidderId: string | null;
@@ -1388,14 +1269,6 @@ export declare const updateCampaignSchema: z.ZodObject<{
1388
1269
  boosted?: number | undefined;
1389
1270
  } | undefined;
1390
1271
  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
1272
  bidConfig?: {
1400
1273
  agencyName: string | null;
1401
1274
  bidderId: string | null;
@@ -1407,7 +1280,6 @@ export declare const updateCampaignSchema: z.ZodObject<{
1407
1280
  export interface Campaign extends z.infer<typeof campaignSchema> {
1408
1281
  filters: JobFilters;
1409
1282
  expenses: CampaignExpenses;
1410
- webhooks: CampaignWebhook[];
1411
1283
  bidConfig: BidConfig | null;
1412
1284
  coverLetterTemplate: CoverLetterTemplate | null;
1413
1285
  }
@@ -1418,7 +1290,6 @@ export interface CreateCampaign extends z.infer<typeof createCampaignSchema> {
1418
1290
  export interface UpdateCampaign extends z.infer<typeof updateCampaignSchema> {
1419
1291
  filters?: JobFilters;
1420
1292
  expenses?: CampaignExpenses;
1421
- webhooks?: CampaignWebhook[];
1422
1293
  bidConfig?: BidConfig;
1423
1294
  }
1424
1295
  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';