lancer-shared 1.2.1 → 1.2.2

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 (150) hide show
  1. package/dist/constants/account-status.d.ts +3 -0
  2. package/dist/constants/account-status.js +17 -0
  3. package/dist/constants/collections.js +16 -0
  4. package/dist/constants/common-questions.js +60 -0
  5. package/dist/constants/index.js +40 -0
  6. package/dist/constants/job-filter-options.js +268 -0
  7. package/dist/constants/job-status.js +26 -0
  8. package/dist/constants/mappings/countryMapping.js +122 -0
  9. package/dist/constants/mappings/regionMapping.js +242 -0
  10. package/dist/constants/routes.js +108 -0
  11. package/dist/constants/upwork-accounts.js +21 -0
  12. package/dist/index.js +20 -0
  13. package/dist/schemas/account/account-status.js +11 -0
  14. package/dist/schemas/account/bidder-account.js +37 -0
  15. package/dist/schemas/account/index.js +19 -0
  16. package/dist/schemas/account/manager-account.d.ts +116 -0
  17. package/dist/schemas/account/manager-account.js +38 -0
  18. package/dist/schemas/account/scraper-account.js +37 -0
  19. package/dist/schemas/ai/ai-config.d.ts +36 -0
  20. package/dist/schemas/ai/ai-config.js +12 -0
  21. package/dist/schemas/ai/index.d.ts +3 -0
  22. package/dist/schemas/ai/index.js +19 -0
  23. package/dist/schemas/ai/proposal.d.ts +82 -0
  24. package/dist/schemas/ai/proposal.js +16 -0
  25. package/dist/schemas/ai/suitability.d.ts +37 -0
  26. package/dist/schemas/ai/suitability.js +17 -0
  27. package/dist/schemas/bid/bid-result.js +15 -0
  28. package/dist/schemas/bid/bid.js +36 -0
  29. package/dist/schemas/bid/index.js +18 -0
  30. package/dist/schemas/bidding/index.d.ts +1 -0
  31. package/dist/schemas/bidding/index.js +17 -0
  32. package/dist/schemas/bidding/proposal-bidding-status.d.ts +26 -0
  33. package/dist/schemas/bidding/proposal-bidding-status.js +18 -0
  34. package/dist/schemas/campaign/campaign-ai-metrics.js +9 -0
  35. package/dist/schemas/campaign/campaign-analytics.js +41 -0
  36. package/dist/schemas/campaign/campaign-expenses.js +9 -0
  37. package/dist/schemas/campaign/campaign-insights.js +31 -0
  38. package/dist/schemas/campaign/campaign-integrations.js +16 -0
  39. package/dist/schemas/campaign/campaign-job-count.js +6 -0
  40. package/dist/schemas/campaign/campaign.js +44 -0
  41. package/dist/schemas/campaign/index.js +23 -0
  42. package/dist/schemas/chat-message/chat-message.js +13 -0
  43. package/dist/schemas/chat-message/index.js +17 -0
  44. package/dist/schemas/config/agency-config.js +10 -0
  45. package/dist/schemas/config/index.js +17 -0
  46. package/dist/schemas/index.js +32 -0
  47. package/dist/schemas/job/index.d.ts +3 -0
  48. package/dist/schemas/job/index.js +19 -0
  49. package/dist/schemas/job/job-details.d.ts +335 -0
  50. package/dist/schemas/job/job-details.js +29 -0
  51. package/dist/schemas/job/job-note.d.ts +83 -0
  52. package/dist/schemas/job/job-note.js +30 -0
  53. package/dist/schemas/job/job-status.d.ts +3 -0
  54. package/dist/schemas/job/job-status.js +27 -0
  55. package/dist/schemas/job/job.d.ts +1160 -0
  56. package/dist/schemas/job/job.js +90 -0
  57. package/dist/schemas/job/pipeline-job.d.ts +602 -0
  58. package/dist/schemas/job/pipeline-job.js +42 -0
  59. package/dist/schemas/job/upwork-job.d.ts +334 -0
  60. package/dist/schemas/job/upwork-job.js +60 -0
  61. package/dist/schemas/job-filters/index.js +17 -0
  62. package/dist/schemas/job-filters/job-filters.js +87 -0
  63. package/dist/schemas/lead/index.js +19 -0
  64. package/dist/schemas/lead/lead-note.js +30 -0
  65. package/dist/schemas/lead/lead-status.js +26 -0
  66. package/dist/schemas/lead/lead.d.ts +1897 -0
  67. package/dist/schemas/lead/lead.js +143 -0
  68. package/dist/schemas/logger/index.js +17 -0
  69. package/dist/schemas/logger/log-event.js +66 -0
  70. package/dist/schemas/organization/index.js +17 -0
  71. package/dist/schemas/organization/organization.d.ts +13 -87
  72. package/dist/schemas/organization/organization.js +19 -0
  73. package/dist/schemas/proxy/index.js +17 -0
  74. package/dist/schemas/proxy/proxy.js +21 -0
  75. package/dist/schemas/saved-search/index.js +12 -0
  76. package/dist/schemas/scraper/index.js +18 -0
  77. package/dist/schemas/scraper/scrape-payload.js +16 -0
  78. package/dist/schemas/scraper/scrape-result.js +23 -0
  79. package/dist/schemas/shared.js +16 -0
  80. package/dist/schemas/time-filter/index.js +9 -0
  81. package/dist/schemas/upwork-account/index.d.ts +3 -0
  82. package/dist/schemas/upwork-account/index.js +19 -0
  83. package/dist/schemas/upwork-account/upwork-account-status.d.ts +2 -0
  84. package/dist/schemas/upwork-account/upwork-account-status.js +11 -0
  85. package/dist/schemas/upwork-account/upwork-business-manager-account.d.ts +95 -0
  86. package/dist/schemas/upwork-account/upwork-business-manager-account.js +35 -0
  87. package/dist/schemas/upwork-account/upwork-scraping-account.d.ts +90 -0
  88. package/dist/schemas/upwork-account/upwork-scraping-account.js +29 -0
  89. package/dist/schemas/user/index.js +55 -0
  90. package/dist/types/account/account-status.js +2 -0
  91. package/dist/types/account/bidder-account.js +2 -0
  92. package/dist/types/account/index.js +19 -0
  93. package/dist/types/account/manager-account.d.ts +7 -0
  94. package/dist/types/account/manager-account.js +2 -0
  95. package/dist/types/account/scraper-account.js +2 -0
  96. package/dist/types/ai/ai-config.d.ts +6 -0
  97. package/dist/types/ai/ai-config.js +2 -0
  98. package/dist/types/ai/index.d.ts +3 -0
  99. package/dist/types/ai/index.js +19 -0
  100. package/dist/types/ai/proposal.d.ts +10 -0
  101. package/dist/types/ai/proposal.js +2 -0
  102. package/dist/types/ai/suitability.d.ts +6 -0
  103. package/dist/types/ai/suitability.js +2 -0
  104. package/dist/types/bid/bid-result.js +2 -0
  105. package/dist/types/bid/bid.js +2 -0
  106. package/dist/types/bid/index.js +18 -0
  107. package/dist/types/bidding/index.d.ts +1 -0
  108. package/dist/types/bidding/index.js +17 -0
  109. package/dist/types/bidding/proposal-bidding-status.d.ts +3 -0
  110. package/dist/types/bidding/proposal-bidding-status.js +2 -0
  111. package/dist/types/campaign/campaign-analytics.js +2 -0
  112. package/dist/types/campaign/campaign-expenses.js +2 -0
  113. package/dist/types/campaign/campaign-insights.js +2 -0
  114. package/dist/types/campaign/campaign-integrations.js +2 -0
  115. package/dist/types/campaign/campaign-job-count.js +2 -0
  116. package/dist/types/campaign/campaign.js +2 -0
  117. package/dist/types/campaign/index.js +22 -0
  118. package/dist/types/chat-message/chat-message.js +2 -0
  119. package/dist/types/chat-message/index.js +17 -0
  120. package/dist/types/config/agency-config.js +2 -0
  121. package/dist/types/config/index.js +17 -0
  122. package/dist/types/index.js +29 -0
  123. package/dist/types/job/index.js +19 -0
  124. package/dist/types/job/job-details.d.ts +36 -0
  125. package/dist/types/job/job-details.js +2 -0
  126. package/dist/types/job/job-note.js +2 -0
  127. package/dist/types/job/job-status.js +12 -0
  128. package/dist/types/job/job.d.ts +36 -0
  129. package/dist/types/job/job.js +2 -0
  130. package/dist/types/job-filters/index.js +17 -0
  131. package/dist/types/job-filters/job-filters.js +2 -0
  132. package/dist/types/logger/index.js +17 -0
  133. package/dist/types/logger/log-event.js +2 -0
  134. package/dist/types/saved-search/index.js +2 -0
  135. package/dist/types/scraper/index.js +18 -0
  136. package/dist/types/scraper/scrape-payload.js +2 -0
  137. package/dist/types/scraper/scrape-result.js +2 -0
  138. package/dist/types/time-filter/index.js +2 -0
  139. package/dist/types/upwork-account/index.d.ts +3 -0
  140. package/dist/types/upwork-account/index.js +19 -0
  141. package/dist/types/upwork-account/upwork-account-status.d.ts +3 -0
  142. package/dist/types/upwork-account/upwork-account-status.js +2 -0
  143. package/dist/types/upwork-account/upwork-business-manager-account.d.ts +7 -0
  144. package/dist/types/upwork-account/upwork-business-manager-account.js +2 -0
  145. package/dist/types/upwork-account/upwork-scraping-account.d.ts +5 -0
  146. package/dist/types/upwork-account/upwork-scraping-account.js +2 -0
  147. package/dist/types/user/index.js +2 -0
  148. package/dist/utils/index.js +17 -0
  149. package/dist/utils/try-catch.js +25 -0
  150. package/package.json +2 -2
@@ -0,0 +1,36 @@
1
+ import { z } from "zod";
2
+ export declare const aiConfigSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ suitabilityPrompt: z.ZodNullable<z.ZodString>;
5
+ proposalPrompt: z.ZodNullable<z.ZodString>;
6
+ questionProposalPrompt: z.ZodNullable<z.ZodString>;
7
+ knowledgeBase: z.ZodNullable<z.ZodString>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ id: string;
10
+ suitabilityPrompt: string | null;
11
+ proposalPrompt: string | null;
12
+ questionProposalPrompt: string | null;
13
+ knowledgeBase: string | null;
14
+ }, {
15
+ id: string;
16
+ suitabilityPrompt: string | null;
17
+ proposalPrompt: string | null;
18
+ questionProposalPrompt: string | null;
19
+ knowledgeBase: string | null;
20
+ }>;
21
+ export declare const updateAiConfigSchema: z.ZodObject<{
22
+ suitabilityPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ proposalPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
+ questionProposalPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
+ knowledgeBase: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ suitabilityPrompt?: string | null | undefined;
28
+ proposalPrompt?: string | null | undefined;
29
+ questionProposalPrompt?: string | null | undefined;
30
+ knowledgeBase?: string | null | undefined;
31
+ }, {
32
+ suitabilityPrompt?: string | null | undefined;
33
+ proposalPrompt?: string | null | undefined;
34
+ questionProposalPrompt?: string | null | undefined;
35
+ knowledgeBase?: string | null | undefined;
36
+ }>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateAiConfigSchema = exports.aiConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.aiConfigSchema = zod_1.z.object({
6
+ id: zod_1.z.string(),
7
+ suitabilityPrompt: zod_1.z.string().nullable(),
8
+ proposalPrompt: zod_1.z.string().nullable(),
9
+ questionProposalPrompt: zod_1.z.string().nullable(),
10
+ knowledgeBase: zod_1.z.string().nullable(),
11
+ });
12
+ exports.updateAiConfigSchema = exports.aiConfigSchema.omit({ id: true }).partial();
@@ -0,0 +1,3 @@
1
+ export * from './ai-config';
2
+ export * from './proposal';
3
+ export * from './suitability';
@@ -0,0 +1,19 @@
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("./ai-config"), exports);
18
+ __exportStar(require("./proposal"), exports);
19
+ __exportStar(require("./suitability"), exports);
@@ -0,0 +1,82 @@
1
+ import { z } from "zod";
2
+ export declare const questionAnswerPairSchema: z.ZodObject<{
3
+ question: z.ZodString;
4
+ answer: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ question: string;
7
+ answer: string;
8
+ }, {
9
+ question: string;
10
+ answer: string;
11
+ }>;
12
+ export declare const proposalSchema: z.ZodObject<{
13
+ coverLetter: z.ZodString;
14
+ questionAnswerPairs: z.ZodArray<z.ZodObject<{
15
+ question: z.ZodString;
16
+ answer: z.ZodString;
17
+ }, "strip", z.ZodTypeAny, {
18
+ question: string;
19
+ answer: string;
20
+ }, {
21
+ question: string;
22
+ answer: string;
23
+ }>, "many">;
24
+ }, "strip", z.ZodTypeAny, {
25
+ coverLetter: string;
26
+ questionAnswerPairs: {
27
+ question: string;
28
+ answer: string;
29
+ }[];
30
+ }, {
31
+ coverLetter: string;
32
+ questionAnswerPairs: {
33
+ question: string;
34
+ answer: string;
35
+ }[];
36
+ }>;
37
+ export declare const proposalResponseSchema: z.ZodArray<z.ZodObject<{
38
+ modelName: z.ZodString;
39
+ proposal: z.ZodObject<{
40
+ coverLetter: z.ZodString;
41
+ questionAnswerPairs: z.ZodArray<z.ZodObject<{
42
+ question: z.ZodString;
43
+ answer: z.ZodString;
44
+ }, "strip", z.ZodTypeAny, {
45
+ question: string;
46
+ answer: string;
47
+ }, {
48
+ question: string;
49
+ answer: string;
50
+ }>, "many">;
51
+ }, "strip", z.ZodTypeAny, {
52
+ coverLetter: string;
53
+ questionAnswerPairs: {
54
+ question: string;
55
+ answer: string;
56
+ }[];
57
+ }, {
58
+ coverLetter: string;
59
+ questionAnswerPairs: {
60
+ question: string;
61
+ answer: string;
62
+ }[];
63
+ }>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ modelName: string;
66
+ proposal: {
67
+ coverLetter: string;
68
+ questionAnswerPairs: {
69
+ question: string;
70
+ answer: string;
71
+ }[];
72
+ };
73
+ }, {
74
+ modelName: string;
75
+ proposal: {
76
+ coverLetter: string;
77
+ questionAnswerPairs: {
78
+ question: string;
79
+ answer: string;
80
+ }[];
81
+ };
82
+ }>, "many">;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.proposalResponseSchema = exports.proposalSchema = exports.questionAnswerPairSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.questionAnswerPairSchema = zod_1.z.object({
6
+ question: zod_1.z.string(),
7
+ answer: zod_1.z.string(),
8
+ });
9
+ exports.proposalSchema = zod_1.z.object({
10
+ coverLetter: zod_1.z.string(),
11
+ questionAnswerPairs: zod_1.z.array(exports.questionAnswerPairSchema),
12
+ });
13
+ exports.proposalResponseSchema = zod_1.z.array(zod_1.z.object({
14
+ modelName: zod_1.z.string(),
15
+ proposal: exports.proposalSchema,
16
+ }));
@@ -0,0 +1,37 @@
1
+ import { z } from 'zod';
2
+ export declare const suitabilitySchema: z.ZodObject<{
3
+ rating: z.ZodString;
4
+ reason: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ rating: string;
7
+ reason: string;
8
+ }, {
9
+ rating: string;
10
+ reason: string;
11
+ }>;
12
+ export declare const suitabilityStatusSchema: z.ZodEnum<["completed", "pending", "failed"]>;
13
+ export declare const suitabilityResponseSchema: z.ZodArray<z.ZodObject<{
14
+ modelName: z.ZodString;
15
+ suitability: z.ZodObject<{
16
+ rating: z.ZodString;
17
+ reason: z.ZodString;
18
+ }, "strip", z.ZodTypeAny, {
19
+ rating: string;
20
+ reason: string;
21
+ }, {
22
+ rating: string;
23
+ reason: string;
24
+ }>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ modelName: string;
27
+ suitability: {
28
+ rating: string;
29
+ reason: string;
30
+ };
31
+ }, {
32
+ modelName: string;
33
+ suitability: {
34
+ rating: string;
35
+ reason: string;
36
+ };
37
+ }>, "many">;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.suitabilityResponseSchema = exports.suitabilityStatusSchema = exports.suitabilitySchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.suitabilitySchema = zod_1.z.object({
6
+ rating: zod_1.z.string(),
7
+ reason: zod_1.z.string(),
8
+ });
9
+ exports.suitabilityStatusSchema = zod_1.z.enum([
10
+ 'completed',
11
+ 'pending',
12
+ 'failed',
13
+ ]);
14
+ exports.suitabilityResponseSchema = zod_1.z.array(zod_1.z.object({
15
+ modelName: zod_1.z.string(),
16
+ suitability: exports.suitabilitySchema,
17
+ }));
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bidFailedSchema = exports.bidSuccessSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.bidSuccessSchema = zod_1.z.object({
6
+ status: zod_1.z.literal('success'),
7
+ biddingAmount: zod_1.z.number(),
8
+ boosted: zod_1.z.boolean(),
9
+ boostingAmount: zod_1.z.number(),
10
+ cookies: zod_1.z.array(zod_1.z.any()),
11
+ });
12
+ exports.bidFailedSchema = zod_1.z.object({
13
+ status: zod_1.z.literal('failed'),
14
+ errorMessage: zod_1.z.string(),
15
+ });
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bidDtoSchema = exports.freelancerBidPayloadSchema = exports.agencyBidPayloadSchema = exports.bidPayloadSchema = exports.agencyBidProposalDataSchema = exports.freelancerBidProposalDataSchema = exports.bidPayloadProposalDataSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const ai_1 = require("../ai");
6
+ exports.bidPayloadProposalDataSchema = zod_1.z.object({
7
+ coverLetter: zod_1.z.string(),
8
+ questionAnswerPairs: zod_1.z.array(ai_1.questionAnswerPairSchema).nullable(),
9
+ boostingEnabled: zod_1.z.boolean(),
10
+ minimumBoost: zod_1.z.number().nullable(),
11
+ maximumBoost: zod_1.z.number().nullable(),
12
+ });
13
+ exports.freelancerBidProposalDataSchema = exports.bidPayloadProposalDataSchema;
14
+ exports.agencyBidProposalDataSchema = exports.bidPayloadProposalDataSchema.extend({
15
+ agencyName: zod_1.z.string(),
16
+ contractorName: zod_1.z.string(),
17
+ specializedProfile: zod_1.z.string().nullable(),
18
+ });
19
+ exports.bidPayloadSchema = zod_1.z.object({
20
+ jobUrl: zod_1.z.string(),
21
+ username: zod_1.z.string(),
22
+ password: zod_1.z.string(),
23
+ cookies: zod_1.z.array(zod_1.z.any()),
24
+ multiLoginProfileId: zod_1.z.string(),
25
+ });
26
+ exports.agencyBidPayloadSchema = exports.bidPayloadSchema.extend({
27
+ proposalData: exports.agencyBidProposalDataSchema,
28
+ });
29
+ exports.freelancerBidPayloadSchema = exports.bidPayloadSchema.extend({
30
+ proposalData: exports.freelancerBidProposalDataSchema,
31
+ });
32
+ exports.bidDtoSchema = zod_1.z.object({
33
+ organizationId: zod_1.z.string(),
34
+ campaignId: zod_1.z.string(),
35
+ leadId: zod_1.z.string(),
36
+ });
@@ -0,0 +1,18 @@
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("./bid"), exports);
18
+ __exportStar(require("./bid-result"), exports);
@@ -0,0 +1 @@
1
+ export * from './proposal-bidding-status';
@@ -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("./proposal-bidding-status"), exports);
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ export declare const proposalBiddingStatusSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
3
+ status: z.ZodLiteral<"success">;
4
+ biddingAmount: z.ZodNumber;
5
+ boosted: z.ZodBoolean;
6
+ boostingAmount: z.ZodNumber;
7
+ }, "strip", z.ZodTypeAny, {
8
+ status: "success";
9
+ biddingAmount: number;
10
+ boosted: boolean;
11
+ boostingAmount: number;
12
+ }, {
13
+ status: "success";
14
+ biddingAmount: number;
15
+ boosted: boolean;
16
+ boostingAmount: number;
17
+ }>, z.ZodObject<{
18
+ status: z.ZodLiteral<"failed">;
19
+ errorMessage: z.ZodString;
20
+ }, "strip", z.ZodTypeAny, {
21
+ status: "failed";
22
+ errorMessage: string;
23
+ }, {
24
+ status: "failed";
25
+ errorMessage: string;
26
+ }>]>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.proposalBiddingStatusSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.proposalBiddingStatusSchema = zod_1.z.discriminatedUnion('status', [
6
+ // Success case
7
+ zod_1.z.object({
8
+ status: zod_1.z.literal('success'),
9
+ biddingAmount: zod_1.z.number(),
10
+ boosted: zod_1.z.boolean(),
11
+ boostingAmount: zod_1.z.number(),
12
+ }),
13
+ // Failed case
14
+ zod_1.z.object({
15
+ status: zod_1.z.literal('failed'),
16
+ errorMessage: zod_1.z.string(),
17
+ }),
18
+ ]);
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.campaignAIMetricsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.campaignAIMetricsSchema = zod_1.z.object({
6
+ leadsAnalyzed: zod_1.z.number(),
7
+ leadsBidded: zod_1.z.number(),
8
+ connectsSaved: zod_1.z.number(),
9
+ });
@@ -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,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,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());
@@ -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
+ });
@@ -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,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,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);
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.agencyConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.agencyConfigSchema = zod_1.z.object({
6
+ agencyName: zod_1.z.string(),
7
+ contractorName: zod_1.z.string(),
8
+ specializedProfile: zod_1.z.string().nullable(),
9
+ accountId: zod_1.z.string(),
10
+ });
@@ -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("./agency-config"), exports);
@@ -0,0 +1,32 @@
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("./account"), exports);
18
+ __exportStar(require("./ai"), exports);
19
+ __exportStar(require("./bid"), exports);
20
+ __exportStar(require("./campaign"), exports);
21
+ __exportStar(require("./chat-message"), exports);
22
+ __exportStar(require("./config"), exports);
23
+ __exportStar(require("./job-filters"), exports);
24
+ __exportStar(require("./lead"), exports);
25
+ __exportStar(require("./logger"), exports);
26
+ __exportStar(require("./organization"), exports);
27
+ __exportStar(require("./proxy"), exports);
28
+ __exportStar(require("./saved-search"), exports);
29
+ __exportStar(require("./scraper"), exports);
30
+ __exportStar(require("./shared"), exports);
31
+ __exportStar(require("./time-filter"), exports);
32
+ __exportStar(require("./user"), exports);