lancer-shared 1.2.146 → 1.2.148
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.
- package/dist/bundle.cjs.js +42 -42
- package/dist/constants/collections.js +11 -13
- package/dist/constants/common-questions.js +1 -4
- package/dist/constants/index.js +10 -32
- package/dist/constants/job-filter-options.js +1 -4
- package/dist/constants/job-status.js +7 -12
- package/dist/constants/mappings/countryMapping.js +1 -3
- package/dist/constants/mappings/regionMapping.js +1 -3
- package/dist/constants/organization.d.ts +2 -2
- package/dist/constants/routes.js +39 -37
- package/dist/constants/upwork-accounts.js +3 -6
- package/dist/index.js +4 -20
- package/dist/schemas/account/account-status.js +2 -5
- package/dist/schemas/account/bidder-account.js +22 -24
- package/dist/schemas/account/index.js +3 -19
- package/dist/schemas/account/scraper-account.js +21 -24
- package/dist/schemas/ai/ai-config.js +8 -11
- package/dist/schemas/ai/index.js +3 -19
- package/dist/schemas/ai/proposal.js +10 -13
- package/dist/schemas/ai/suitability.js +8 -11
- package/dist/schemas/bid/bid-result.js +9 -13
- package/dist/schemas/bid/bid.js +29 -30
- package/dist/schemas/bid/index.js +2 -18
- package/dist/schemas/campaign/campaign-ai-metrics.js +5 -8
- package/dist/schemas/campaign/campaign-analytics.d.ts +8 -0
- package/dist/schemas/campaign/campaign-analytics.js +32 -31
- package/dist/schemas/campaign/campaign-expenses.js +5 -8
- package/dist/schemas/campaign/campaign-insights.js +30 -30
- package/dist/schemas/campaign/campaign-integrations.d.ts +5 -0
- package/dist/schemas/campaign/campaign-integrations.js +10 -13
- package/dist/schemas/campaign/campaign-job-count.js +3 -6
- package/dist/schemas/campaign/campaign.js +32 -35
- package/dist/schemas/campaign/index.js +7 -23
- package/dist/schemas/chat-message/chat-message.js +7 -10
- package/dist/schemas/chat-message/index.js +1 -17
- package/dist/schemas/config/agency-config.js +6 -9
- package/dist/schemas/config/index.js +1 -17
- package/dist/schemas/event/index.d.ts +58 -0
- package/dist/schemas/index.js +17 -32
- package/dist/schemas/job/haha.json +581 -0
- package/dist/schemas/job-filters/index.js +1 -17
- package/dist/schemas/job-filters/job-filters.js +62 -65
- package/dist/schemas/lead/index.js +173 -19
- package/dist/schemas/lead/lead-note.js +13 -16
- package/dist/schemas/lead/lead-status.js +3 -6
- package/dist/schemas/lead/nuxt.js +287 -0
- package/dist/schemas/logger/index.js +1 -17
- package/dist/schemas/logger/log-event.d.ts +10 -10
- package/dist/schemas/logger/log-event.js +100 -49
- package/dist/schemas/logger/scraper-events.d.ts +17 -17
- package/dist/schemas/meter-event/index.d.ts +12 -0
- package/dist/schemas/organization/index.js +70 -17
- package/dist/schemas/organization/member.js +7 -0
- package/dist/schemas/organization/organization.d.ts +177 -7
- package/dist/schemas/organization/organization.js +14 -17
- package/dist/schemas/organization/subscription.js +17 -0
- package/dist/schemas/profile/index.d.ts +2551 -0
- package/dist/schemas/proxy/index.js +3 -17
- package/dist/schemas/proxy/proxy-available-replacements.js +3 -0
- package/dist/schemas/proxy/proxy-country.js +249 -0
- package/dist/schemas/proxy/proxy.js +25 -19
- package/dist/schemas/saved-search/index.js +8 -11
- package/dist/schemas/scraper/exceptions.d.ts +3 -3
- package/dist/schemas/scraper/index.js +2 -18
- package/dist/schemas/scraper/scrape-payload.d.ts +5 -0
- package/dist/schemas/scraper/scrape-payload.js +19 -14
- package/dist/schemas/scraper/scrape-result.js +21 -21
- package/dist/schemas/shared.d.ts +1 -1
- package/dist/schemas/shared.js +12 -9
- package/dist/schemas/talent/index.d.ts +1314 -0
- package/dist/schemas/tier/index.d.ts +119 -0
- package/dist/schemas/time-filter/index.js +5 -8
- package/dist/schemas/transaction/index.js +17 -0
- package/dist/schemas/usage/index.js +18 -0
- package/dist/schemas/user/index.d.ts +2 -2
- package/dist/schemas/user/index.js +38 -41
- package/dist/types/account/account-status.js +1 -2
- package/dist/types/account/bidder-account.js +1 -2
- package/dist/types/account/index.js +3 -19
- package/dist/types/account/scraper-account.js +1 -2
- package/dist/types/ai/ai-config.js +1 -2
- package/dist/types/ai/index.js +3 -19
- package/dist/types/ai/proposal.js +1 -2
- package/dist/types/ai/suitability.js +1 -2
- package/dist/types/bid/bid-result.js +1 -2
- package/dist/types/bid/bid.js +1 -2
- package/dist/types/bid/index.js +2 -18
- package/dist/types/campaign/campaign-analytics.js +1 -2
- package/dist/types/campaign/campaign-expenses.js +1 -2
- package/dist/types/campaign/campaign-insights.js +1 -2
- package/dist/types/campaign/campaign-integrations.js +1 -2
- package/dist/types/campaign/campaign-job-count.js +1 -2
- package/dist/types/campaign/campaign.js +1 -2
- package/dist/types/campaign/index.js +6 -22
- package/dist/types/chat-message/chat-message.js +1 -2
- package/dist/types/chat-message/index.js +1 -17
- package/dist/types/config/agency-config.js +1 -2
- package/dist/types/config/index.js +1 -17
- package/dist/types/index.js +15 -29
- package/dist/types/job/index.js +3 -19
- package/dist/types/job/job-note.js +1 -2
- package/dist/types/job/job-status.js +1 -4
- package/dist/types/job/nuxt.js +1 -0
- package/dist/types/job-filters/index.js +1 -17
- package/dist/types/job-filters/job-filters.js +1 -2
- package/dist/types/logger/index.js +1 -17
- package/dist/types/logger/log-event.js +1 -2
- package/dist/types/saved-search/index.js +1 -2
- package/dist/types/scraper/index.js +2 -18
- package/dist/types/scraper/scrape-payload.js +1 -2
- package/dist/types/scraper/scrape-result.js +1 -2
- package/dist/types/shared.js +1 -0
- package/dist/types/time-filter/index.js +1 -2
- package/dist/types/transaction/index.js +1 -0
- package/dist/types/usage/index.js +1 -0
- package/dist/types/user/index.js +1 -2
- package/dist/utils/index.js +1 -17
- package/dist/utils/try-catch.js +8 -23
- package/package.json +1 -1
- package/dist/constants/account-status.d.ts +0 -3
- package/dist/constants/account-status.js +0 -17
- package/dist/constants/proxies.d.ts +0 -4
- package/dist/constants/upwork-filters.d.ts +0 -5
- package/dist/constants/upwork-filters.js +0 -75
- package/dist/schemas/account/exceptions/no-bidder-accounts-available.d.ts +0 -5
- package/dist/schemas/account/manager-account.d.ts +0 -116
- package/dist/schemas/account/manager-account.js +0 -38
- package/dist/schemas/ai-config/ai-config.d.ts +0 -39
- package/dist/schemas/ai-config/ai-config.js +0 -12
- package/dist/schemas/ai-config/index.d.ts +0 -1
- package/dist/schemas/ai-config/index.js +0 -17
- package/dist/schemas/bid/bid-status.d.ts +0 -30
- package/dist/schemas/bid/bid-status.js +0 -15
- package/dist/schemas/bid/exceptions/base-exception.d.ts +0 -4
- package/dist/schemas/bid/exceptions/evalute-element.exception.d.ts +0 -5
- package/dist/schemas/bid/exceptions/wait-for-function-timeout.d.ts +0 -5
- package/dist/schemas/bidding/index.d.ts +0 -1
- package/dist/schemas/bidding/index.js +0 -17
- package/dist/schemas/bidding/proposal-bidding-status.d.ts +0 -26
- package/dist/schemas/bidding/proposal-bidding-status.js +0 -18
- package/dist/schemas/bidding/proposal-dto.d.ts +0 -26
- package/dist/schemas/bidding/proposal-dto.js +0 -18
- package/dist/schemas/job/feed-job.d.ts +0 -866
- package/dist/schemas/job/index.js +0 -19
- package/dist/schemas/job/job-details.js +0 -29
- package/dist/schemas/job/job-note.d.ts +0 -83
- package/dist/schemas/job/job-note.js +0 -30
- package/dist/schemas/job/job-pipeline.d.ts +0 -74
- package/dist/schemas/job/job-pipeline.js +0 -29
- package/dist/schemas/job/job-status.d.ts +0 -3
- package/dist/schemas/job/job-status.js +0 -27
- package/dist/schemas/job/job-suitability.d.ts +0 -12
- package/dist/schemas/job/job-suitability.js +0 -13
- package/dist/schemas/job/job.d.ts +0 -1160
- package/dist/schemas/job/job.js +0 -90
- package/dist/schemas/job/pipeline-job.d.ts +0 -608
- package/dist/schemas/job/pipeline-job.js +0 -43
- package/dist/schemas/job/upwork-job.d.ts +0 -334
- package/dist/schemas/job/upwork-job.js +0 -60
- package/dist/schemas/knowledge-object/index.d.ts +0 -1
- package/dist/schemas/knowledge-object/index.js +0 -17
- package/dist/schemas/knowledge-object/knowledge-object.d.ts +0 -128
- package/dist/schemas/knowledge-object/knowledge-object.js +0 -47
- package/dist/schemas/lead/lead.d.ts +0 -1897
- package/dist/schemas/lead/lead.js +0 -143
- package/dist/schemas/scraper/scrape-response.d.ts +0 -345
- package/dist/schemas/scraper/scrape-response.js +0 -9
- package/dist/schemas/upwork-account/index.d.ts +0 -3
- package/dist/schemas/upwork-account/index.js +0 -19
- package/dist/schemas/upwork-account/upwork-account-status.d.ts +0 -2
- package/dist/schemas/upwork-account/upwork-account-status.js +0 -11
- package/dist/schemas/upwork-account/upwork-business-manager-account.d.ts +0 -95
- package/dist/schemas/upwork-account/upwork-business-manager-account.js +0 -35
- package/dist/schemas/upwork-account/upwork-scraper-account.d.ts +0 -92
- package/dist/schemas/upwork-account/upwork-scraper-account.js +0 -31
- package/dist/schemas/upwork-account/upwork-scraping-account.d.ts +0 -90
- package/dist/schemas/upwork-account/upwork-scraping-account.js +0 -30
- package/dist/types/account/manager-account.d.ts +0 -7
- package/dist/types/account/manager-account.js +0 -2
- package/dist/types/ai-config/ai-config.d.ts +0 -6
- package/dist/types/ai-config/ai-config.js +0 -2
- package/dist/types/ai-config/index.d.ts +0 -1
- package/dist/types/ai-config/index.js +0 -17
- package/dist/types/bid/bid-status.d.ts +0 -5
- package/dist/types/bid/bid-status.js +0 -2
- package/dist/types/bidding/index.d.ts +0 -1
- package/dist/types/bidding/index.js +0 -17
- package/dist/types/bidding/proposal-bidding-status.d.ts +0 -3
- package/dist/types/bidding/proposal-bidding-status.js +0 -2
- package/dist/types/bidding/proposal-dto.d.ts +0 -3
- package/dist/types/bidding/proposal-dto.js +0 -2
- package/dist/types/job/job-details.d.ts +0 -36
- package/dist/types/job/job-details.js +0 -2
- package/dist/types/job/job-pipeline.d.ts +0 -4
- package/dist/types/job/job-pipeline.js +0 -2
- package/dist/types/job/job-suitability.d.ts +0 -3
- package/dist/types/job/job-suitability.js +0 -2
- package/dist/types/job/job.d.ts +0 -36
- package/dist/types/job/job.js +0 -2
- package/dist/types/knowledge-object/index.d.ts +0 -1
- package/dist/types/knowledge-object/index.js +0 -17
- package/dist/types/knowledge-object/knowledge-object.d.ts +0 -4
- package/dist/types/knowledge-object/knowledge-object.js +0 -2
- package/dist/types/scraper/scrape-response.d.ts +0 -4
- package/dist/types/scraper/scrape-response.js +0 -2
- package/dist/types/upwork-account/index.d.ts +0 -3
- package/dist/types/upwork-account/index.js +0 -19
- package/dist/types/upwork-account/upwork-account-status.d.ts +0 -3
- package/dist/types/upwork-account/upwork-account-status.js +0 -2
- package/dist/types/upwork-account/upwork-business-manager-account.d.ts +0 -7
- package/dist/types/upwork-account/upwork-business-manager-account.js +0 -2
- package/dist/types/upwork-account/upwork-scraping-account.d.ts +0 -5
- package/dist/types/upwork-account/upwork-scraping-account.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export declare const scrapeFeedStartedEventMetadata: z.ZodObject<{
|
|
3
3
|
region: z.ZodUnion<[z.ZodLiteral<"USOnly">, z.ZodLiteral<"UKOnly">, z.ZodLiteral<"Worldwide">]>;
|
|
4
4
|
accountId: z.ZodString;
|
|
@@ -53,7 +53,7 @@ export declare const scrapeFeedFailedEventMetadata: z.ZodObject<{
|
|
|
53
53
|
errorCode: string;
|
|
54
54
|
errorStack: string;
|
|
55
55
|
}>;
|
|
56
|
-
export declare const
|
|
56
|
+
export declare const feedJobEnrichStartedEventMetadata: z.ZodObject<{
|
|
57
57
|
listing: z.ZodObject<{
|
|
58
58
|
uid: z.ZodString;
|
|
59
59
|
ciphertext: z.ZodString;
|
|
@@ -1128,7 +1128,7 @@ export declare const jobScrapedEventMetadata: z.ZodObject<{
|
|
|
1128
1128
|
} | null | undefined;
|
|
1129
1129
|
};
|
|
1130
1130
|
}>;
|
|
1131
|
-
export declare const
|
|
1131
|
+
export declare const feedJobEnrichFailedEventMetadata: z.ZodObject<{
|
|
1132
1132
|
listing: z.ZodObject<{
|
|
1133
1133
|
uid: z.ZodString;
|
|
1134
1134
|
ciphertext: z.ZodString;
|
|
@@ -1458,7 +1458,7 @@ export declare const scrapeJobDetailsFailedEventMetadata: z.ZodObject<{
|
|
|
1458
1458
|
clientRelation?: any;
|
|
1459
1459
|
};
|
|
1460
1460
|
}>;
|
|
1461
|
-
export declare const
|
|
1461
|
+
export declare const feedJobChunkEnrichStartedEventMetadata: z.ZodObject<{
|
|
1462
1462
|
region: z.ZodUnion<[z.ZodLiteral<"USOnly">, z.ZodLiteral<"UKOnly">, z.ZodLiteral<"Worldwide">]>;
|
|
1463
1463
|
accountIds: z.ZodArray<z.ZodString, "many">;
|
|
1464
1464
|
accountEmails: z.ZodArray<z.ZodString, "many">;
|
|
@@ -1474,32 +1474,32 @@ export declare const scrapeJobsDetailsStartedEventMetadata: z.ZodObject<{
|
|
|
1474
1474
|
accountEmails: string[];
|
|
1475
1475
|
jobListingsCount: number;
|
|
1476
1476
|
}>;
|
|
1477
|
-
export declare const
|
|
1477
|
+
export declare const feedJobChunkEnrichCompletedEventMetadata: z.ZodObject<{
|
|
1478
1478
|
region: z.ZodUnion<[z.ZodLiteral<"USOnly">, z.ZodLiteral<"UKOnly">, z.ZodLiteral<"Worldwide">]>;
|
|
1479
1479
|
feedScraperAccountId: z.ZodString;
|
|
1480
1480
|
feedScraperAccountEmail: z.ZodString;
|
|
1481
1481
|
uniqueJobsFound: z.ZodNumber;
|
|
1482
1482
|
duration: z.ZodString;
|
|
1483
|
-
|
|
1484
|
-
|
|
1483
|
+
enrichFeedJobSuccessCount: z.ZodNumber;
|
|
1484
|
+
enrichFeedJobFailCount: z.ZodNumber;
|
|
1485
1485
|
}, "strip", z.ZodTypeAny, {
|
|
1486
1486
|
region: "USOnly" | "UKOnly" | "Worldwide";
|
|
1487
1487
|
duration: string;
|
|
1488
1488
|
feedScraperAccountId: string;
|
|
1489
1489
|
feedScraperAccountEmail: string;
|
|
1490
1490
|
uniqueJobsFound: number;
|
|
1491
|
-
|
|
1492
|
-
|
|
1491
|
+
enrichFeedJobSuccessCount: number;
|
|
1492
|
+
enrichFeedJobFailCount: number;
|
|
1493
1493
|
}, {
|
|
1494
1494
|
region: "USOnly" | "UKOnly" | "Worldwide";
|
|
1495
1495
|
duration: string;
|
|
1496
1496
|
feedScraperAccountId: string;
|
|
1497
1497
|
feedScraperAccountEmail: string;
|
|
1498
1498
|
uniqueJobsFound: number;
|
|
1499
|
-
|
|
1500
|
-
|
|
1499
|
+
enrichFeedJobSuccessCount: number;
|
|
1500
|
+
enrichFeedJobFailCount: number;
|
|
1501
1501
|
}>;
|
|
1502
|
-
export declare const
|
|
1502
|
+
export declare const feedJobChunkEnrichFailedEventMetadata: z.ZodObject<{
|
|
1503
1503
|
region: z.ZodUnion<[z.ZodLiteral<"USOnly">, z.ZodLiteral<"UKOnly">, z.ZodLiteral<"Worldwide">]>;
|
|
1504
1504
|
accountId: z.ZodString;
|
|
1505
1505
|
accountEmail: z.ZodString;
|
|
@@ -1965,17 +1965,17 @@ export interface ScrapeFeedCompletedEventMetadata extends z.infer<typeof scrapeF
|
|
|
1965
1965
|
}
|
|
1966
1966
|
export interface ScrapeFeedFailedEventMetadata extends z.infer<typeof scrapeFeedFailedEventMetadata> {
|
|
1967
1967
|
}
|
|
1968
|
-
export interface
|
|
1968
|
+
export interface FeedJobEnrichStartedEventMetadata extends z.infer<typeof feedJobEnrichStartedEventMetadata> {
|
|
1969
1969
|
}
|
|
1970
1970
|
export interface JobScrapedEventMetadata extends z.infer<typeof jobScrapedEventMetadata> {
|
|
1971
1971
|
}
|
|
1972
|
-
export interface
|
|
1972
|
+
export interface FeedJobEnrichFailedEventMetadata extends z.infer<typeof feedJobEnrichFailedEventMetadata> {
|
|
1973
1973
|
}
|
|
1974
|
-
export interface
|
|
1974
|
+
export interface FeedJobChunkEnrichStartedEventMetadata extends z.infer<typeof feedJobChunkEnrichStartedEventMetadata> {
|
|
1975
1975
|
}
|
|
1976
|
-
export interface
|
|
1976
|
+
export interface FeedJobChunkEnrichCompletedEventMetadata extends z.infer<typeof feedJobChunkEnrichCompletedEventMetadata> {
|
|
1977
1977
|
}
|
|
1978
|
-
export interface
|
|
1978
|
+
export interface FeedJobChunkEnrichFailedEventMetadata extends z.infer<typeof feedJobChunkEnrichFailedEventMetadata> {
|
|
1979
1979
|
}
|
|
1980
1980
|
export interface ScrapeJobsCompletedEventMetadata extends z.infer<typeof scrapeJobsCompletedEventMetadata> {
|
|
1981
1981
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const usageEventSchema: import("zod").ZodObject<{
|
|
2
|
+
organizationId: import("zod").ZodString;
|
|
3
|
+
eventId: any;
|
|
4
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
organizationId?: unknown;
|
|
7
|
+
eventId?: unknown;
|
|
8
|
+
}, {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
organizationId?: unknown;
|
|
11
|
+
eventId?: unknown;
|
|
12
|
+
}>;
|
|
@@ -1,17 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { boolean, number, object, string, z } from "zod";
|
|
2
|
+
import { LogEventTypeEnum } from "../logger";
|
|
3
|
+
import { organizationSubscriptionSchema } from "./subscription";
|
|
4
|
+
export const bidConfigSchema = object({
|
|
5
|
+
agencyName: string().nullable(),
|
|
6
|
+
bidderId: string().nullable(),
|
|
7
|
+
contractorName: string().nullable(),
|
|
8
|
+
specialisedProfile: string().nullable(),
|
|
9
|
+
});
|
|
10
|
+
export const organizationTypeSchema = z.enum(["agency", "freelancer"]);
|
|
11
|
+
export const organizationTierEnum = z.enum(["free", "premium"]);
|
|
12
|
+
export const organizationLimitsSchema = object({
|
|
13
|
+
monthlyCredits: number(),
|
|
14
|
+
usedCredits: number(),
|
|
15
|
+
extraCredits: number(),
|
|
16
|
+
});
|
|
17
|
+
export const organizationBillingSchema = object({
|
|
18
|
+
stripeCustomerId: string(),
|
|
19
|
+
savedCard: boolean(),
|
|
20
|
+
creditsRemaining: number(),
|
|
21
|
+
});
|
|
22
|
+
export const organizationSchema = object({
|
|
23
|
+
id: string(),
|
|
24
|
+
name: string(),
|
|
25
|
+
type: organizationTypeSchema,
|
|
26
|
+
tierId: organizationTierEnum,
|
|
27
|
+
subscription: organizationSubscriptionSchema.nullable(),
|
|
28
|
+
bidConfig: bidConfigSchema,
|
|
29
|
+
active: boolean(),
|
|
30
|
+
limits: organizationLimitsSchema,
|
|
31
|
+
billing: organizationBillingSchema.nullable(),
|
|
32
|
+
createdAt: number(),
|
|
33
|
+
updatedAt: number(),
|
|
34
|
+
});
|
|
35
|
+
export const creditDeductionEventTypeEnum = LogEventTypeEnum.extract([
|
|
36
|
+
"suitabilityComplete",
|
|
37
|
+
"proposalComplete",
|
|
38
|
+
]);
|
|
39
|
+
export const creditDeductionPayloadSchema = object({
|
|
40
|
+
event: creditDeductionEventTypeEnum,
|
|
41
|
+
campaignId: string().nullish(),
|
|
42
|
+
});
|
|
43
|
+
export const aiConfigOldSchema = object({
|
|
44
|
+
id: string(),
|
|
45
|
+
suitabilityPrompt: string().nullable(),
|
|
46
|
+
proposalPrompt: string().nullable(),
|
|
47
|
+
questionProposalPrompt: string().nullable(),
|
|
48
|
+
knowledgeBase: string().nullable(),
|
|
49
|
+
});
|
|
50
|
+
export const aiConfigSchema = object({
|
|
51
|
+
suitabilityRules: string().nullable(),
|
|
52
|
+
coverLetterRules: string().nullable(),
|
|
53
|
+
questionRules: string().nullable(),
|
|
54
|
+
});
|
|
55
|
+
export const knowledgeBaseSchema = object({
|
|
56
|
+
about: string(),
|
|
57
|
+
caseStudies: string(),
|
|
58
|
+
});
|
|
59
|
+
export const notificationConfigSchema = object({
|
|
60
|
+
emailEnabled: boolean(),
|
|
61
|
+
discordWebhookUrl: string().nullable(),
|
|
62
|
+
slackWebhookUrl: string().nullable(),
|
|
63
|
+
});
|
|
64
|
+
export const organizationSettingsSchema = object({
|
|
65
|
+
aiConfig: aiConfigSchema,
|
|
66
|
+
knowledgeBase: knowledgeBaseSchema,
|
|
67
|
+
notifications: notificationConfigSchema,
|
|
68
|
+
});
|
|
69
|
+
export * from "./member";
|
|
70
|
+
export * from "./subscription";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
export declare const bidConfigSchema: z.ZodObject<{
|
|
3
3
|
agencyName: z.ZodNullable<z.ZodString>;
|
|
4
4
|
bidderId: z.ZodNullable<z.ZodString>;
|
|
@@ -36,8 +36,61 @@ export declare const organizationSchema: z.ZodObject<{
|
|
|
36
36
|
contractorName: string | null;
|
|
37
37
|
specialisedProfile: string | null;
|
|
38
38
|
}>;
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
tierId: z.ZodEnum<["free", "premium"]>;
|
|
40
|
+
active: z.ZodBoolean;
|
|
41
|
+
limits: z.ZodNullable<z.ZodObject<{
|
|
42
|
+
monthlyCredits: z.ZodNumber;
|
|
43
|
+
usedCredits: z.ZodNumber;
|
|
44
|
+
extraCredits: z.ZodNumber;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
monthlyCredits: number;
|
|
47
|
+
usedCredits: number;
|
|
48
|
+
extraCredits: number;
|
|
49
|
+
}, {
|
|
50
|
+
monthlyCredits: number;
|
|
51
|
+
usedCredits: number;
|
|
52
|
+
extraCredits: number;
|
|
53
|
+
}>>;
|
|
54
|
+
billing: z.ZodNullable<z.ZodObject<{
|
|
55
|
+
stripeCustomerId: z.ZodString;
|
|
56
|
+
savedCard: z.ZodBoolean;
|
|
57
|
+
creditsRemaining: z.ZodNumber;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
stripeCustomerId: string;
|
|
60
|
+
savedCard: boolean;
|
|
61
|
+
creditsRemaining: number;
|
|
62
|
+
}, {
|
|
63
|
+
stripeCustomerId: string;
|
|
64
|
+
savedCard: boolean;
|
|
65
|
+
creditsRemaining: number;
|
|
66
|
+
}>>;
|
|
67
|
+
subscription: z.ZodNullable<z.ZodObject<{
|
|
68
|
+
tierId: z.ZodString;
|
|
69
|
+
status: z.ZodEnum<["active", "trialing", "cancelled", "paused"]>;
|
|
70
|
+
creditsRemaining: z.ZodNumber;
|
|
71
|
+
startedAt: z.ZodNumber;
|
|
72
|
+
currentPeriodEnd: z.ZodNumber;
|
|
73
|
+
stripeSubscriptionId: z.ZodString;
|
|
74
|
+
source: z.ZodEnum<["stripe", "manual"]>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
status: "active" | "trialing" | "cancelled" | "paused";
|
|
77
|
+
creditsRemaining: number;
|
|
78
|
+
tierId: string;
|
|
79
|
+
startedAt: number;
|
|
80
|
+
currentPeriodEnd: number;
|
|
81
|
+
stripeSubscriptionId: string;
|
|
82
|
+
source: "stripe" | "manual";
|
|
83
|
+
}, {
|
|
84
|
+
status: "active" | "trialing" | "cancelled" | "paused";
|
|
85
|
+
creditsRemaining: number;
|
|
86
|
+
tierId: string;
|
|
87
|
+
startedAt: number;
|
|
88
|
+
currentPeriodEnd: number;
|
|
89
|
+
stripeSubscriptionId: string;
|
|
90
|
+
source: "stripe" | "manual";
|
|
91
|
+
}>>;
|
|
92
|
+
createdAt: z.ZodNumber;
|
|
93
|
+
updatedAt: z.ZodNumber;
|
|
41
94
|
}, "strip", z.ZodTypeAny, {
|
|
42
95
|
type: "agency" | "freelancer";
|
|
43
96
|
id: string;
|
|
@@ -48,8 +101,29 @@ export declare const organizationSchema: z.ZodObject<{
|
|
|
48
101
|
contractorName: string | null;
|
|
49
102
|
specialisedProfile: string | null;
|
|
50
103
|
};
|
|
51
|
-
|
|
52
|
-
|
|
104
|
+
tierId: "free" | "premium";
|
|
105
|
+
active: boolean;
|
|
106
|
+
limits: {
|
|
107
|
+
monthlyCredits: number;
|
|
108
|
+
usedCredits: number;
|
|
109
|
+
extraCredits: number;
|
|
110
|
+
} | null;
|
|
111
|
+
billing: {
|
|
112
|
+
stripeCustomerId: string;
|
|
113
|
+
savedCard: boolean;
|
|
114
|
+
creditsRemaining: number;
|
|
115
|
+
} | null;
|
|
116
|
+
subscription: {
|
|
117
|
+
status: "active" | "trialing" | "cancelled" | "paused";
|
|
118
|
+
creditsRemaining: number;
|
|
119
|
+
tierId: string;
|
|
120
|
+
startedAt: number;
|
|
121
|
+
currentPeriodEnd: number;
|
|
122
|
+
stripeSubscriptionId: string;
|
|
123
|
+
source: "stripe" | "manual";
|
|
124
|
+
} | null;
|
|
125
|
+
createdAt: number;
|
|
126
|
+
updatedAt: number;
|
|
53
127
|
}, {
|
|
54
128
|
type: "agency" | "freelancer";
|
|
55
129
|
id: string;
|
|
@@ -60,11 +134,107 @@ export declare const organizationSchema: z.ZodObject<{
|
|
|
60
134
|
contractorName: string | null;
|
|
61
135
|
specialisedProfile: string | null;
|
|
62
136
|
};
|
|
63
|
-
|
|
64
|
-
|
|
137
|
+
tierId: "free" | "premium";
|
|
138
|
+
active: boolean;
|
|
139
|
+
limits: {
|
|
140
|
+
monthlyCredits: number;
|
|
141
|
+
usedCredits: number;
|
|
142
|
+
extraCredits: number;
|
|
143
|
+
} | null;
|
|
144
|
+
billing: {
|
|
145
|
+
stripeCustomerId: string;
|
|
146
|
+
savedCard: boolean;
|
|
147
|
+
creditsRemaining: number;
|
|
148
|
+
} | null;
|
|
149
|
+
subscription: {
|
|
150
|
+
status: "active" | "trialing" | "cancelled" | "paused";
|
|
151
|
+
creditsRemaining: number;
|
|
152
|
+
tierId: string;
|
|
153
|
+
startedAt: number;
|
|
154
|
+
currentPeriodEnd: number;
|
|
155
|
+
stripeSubscriptionId: string;
|
|
156
|
+
source: "stripe" | "manual";
|
|
157
|
+
} | null;
|
|
158
|
+
createdAt: number;
|
|
159
|
+
updatedAt: number;
|
|
160
|
+
}>;
|
|
161
|
+
export declare const aiConfigSchema: z.ZodObject<{
|
|
162
|
+
suitabilityRules: z.ZodNullable<z.ZodString>;
|
|
163
|
+
proposalRules: z.ZodNullable<z.ZodString>;
|
|
164
|
+
questionRules: z.ZodNullable<z.ZodString>;
|
|
165
|
+
}, "strip", z.ZodTypeAny, {
|
|
166
|
+
suitabilityRules: string | null;
|
|
167
|
+
proposalRules: string | null;
|
|
168
|
+
questionRules: string | null;
|
|
169
|
+
}, {
|
|
170
|
+
suitabilityRules: string | null;
|
|
171
|
+
proposalRules: string | null;
|
|
172
|
+
questionRules: string | null;
|
|
173
|
+
}>;
|
|
174
|
+
export declare const knowledgeBaseSchema: z.ZodObject<{
|
|
175
|
+
about: z.ZodString;
|
|
176
|
+
caseStudies: z.ZodString;
|
|
177
|
+
}, "strip", z.ZodTypeAny, {
|
|
178
|
+
about: string;
|
|
179
|
+
caseStudies: string;
|
|
180
|
+
}, {
|
|
181
|
+
about: string;
|
|
182
|
+
caseStudies: string;
|
|
183
|
+
}>;
|
|
184
|
+
export declare const organizationSettingsSchema: z.ZodObject<{
|
|
185
|
+
aiConfig: z.ZodObject<{
|
|
186
|
+
suitabilityRules: z.ZodNullable<z.ZodString>;
|
|
187
|
+
proposalRules: z.ZodNullable<z.ZodString>;
|
|
188
|
+
questionRules: z.ZodNullable<z.ZodString>;
|
|
189
|
+
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
suitabilityRules: string | null;
|
|
191
|
+
proposalRules: string | null;
|
|
192
|
+
questionRules: string | null;
|
|
193
|
+
}, {
|
|
194
|
+
suitabilityRules: string | null;
|
|
195
|
+
proposalRules: string | null;
|
|
196
|
+
questionRules: string | null;
|
|
197
|
+
}>;
|
|
198
|
+
knowledgeBase: z.ZodObject<{
|
|
199
|
+
about: z.ZodString;
|
|
200
|
+
caseStudies: z.ZodString;
|
|
201
|
+
}, "strip", z.ZodTypeAny, {
|
|
202
|
+
about: string;
|
|
203
|
+
caseStudies: string;
|
|
204
|
+
}, {
|
|
205
|
+
about: string;
|
|
206
|
+
caseStudies: string;
|
|
207
|
+
}>;
|
|
208
|
+
}, "strip", z.ZodTypeAny, {
|
|
209
|
+
aiConfig: {
|
|
210
|
+
suitabilityRules: string | null;
|
|
211
|
+
proposalRules: string | null;
|
|
212
|
+
questionRules: string | null;
|
|
213
|
+
};
|
|
214
|
+
knowledgeBase: {
|
|
215
|
+
about: string;
|
|
216
|
+
caseStudies: string;
|
|
217
|
+
};
|
|
218
|
+
}, {
|
|
219
|
+
aiConfig: {
|
|
220
|
+
suitabilityRules: string | null;
|
|
221
|
+
proposalRules: string | null;
|
|
222
|
+
questionRules: string | null;
|
|
223
|
+
};
|
|
224
|
+
knowledgeBase: {
|
|
225
|
+
about: string;
|
|
226
|
+
caseStudies: string;
|
|
227
|
+
};
|
|
65
228
|
}>;
|
|
66
229
|
export interface Organization extends z.infer<typeof organizationSchema> {
|
|
67
230
|
}
|
|
231
|
+
export interface AiConfig extends z.infer<typeof aiConfigSchema> {
|
|
232
|
+
}
|
|
233
|
+
export interface KnowledgeBase extends z.infer<typeof knowledgeBaseSchema> {
|
|
234
|
+
}
|
|
235
|
+
export interface OrganizationSettings extends z.infer<typeof organizationSettingsSchema> {
|
|
236
|
+
}
|
|
68
237
|
export interface BidConfig extends z.infer<typeof bidConfigSchema> {
|
|
69
238
|
}
|
|
70
239
|
export type OrganizationType = z.infer<typeof organizationTypeSchema>;
|
|
240
|
+
export * from "./subscription";
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
bidderId: zod_1.z.string().nullable(),
|
|
8
|
-
contractorName: zod_1.z.string().nullable(),
|
|
9
|
-
specialisedProfile: zod_1.z.string().nullable(),
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const bidConfigSchema = z.object({
|
|
3
|
+
agencyName: z.string().nullable(),
|
|
4
|
+
bidderId: z.string().nullable(),
|
|
5
|
+
contractorName: z.string().nullable(),
|
|
6
|
+
specialisedProfile: z.string().nullable(),
|
|
10
7
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
id:
|
|
14
|
-
name:
|
|
15
|
-
type:
|
|
16
|
-
bidConfig:
|
|
17
|
-
createdAt:
|
|
18
|
-
updatedAt:
|
|
8
|
+
export const organizationTypeSchema = z.enum(['agency', 'freelancer']);
|
|
9
|
+
export const organizationSchema = z.object({
|
|
10
|
+
id: z.string(),
|
|
11
|
+
name: z.string(),
|
|
12
|
+
type: organizationTypeSchema,
|
|
13
|
+
bidConfig: bidConfigSchema,
|
|
14
|
+
createdAt: z.date(),
|
|
15
|
+
updatedAt: z.date(),
|
|
19
16
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { number, object, string, z } from "zod";
|
|
2
|
+
export const subscriptionStatusEnum = z.enum([
|
|
3
|
+
"active",
|
|
4
|
+
"trialing",
|
|
5
|
+
"cancelled",
|
|
6
|
+
"paused",
|
|
7
|
+
]);
|
|
8
|
+
export const subscriptionSourceEnum = z.enum(["stripe", "manual"]);
|
|
9
|
+
export const organizationSubscriptionSchema = object({
|
|
10
|
+
tierId: string(),
|
|
11
|
+
status: subscriptionStatusEnum,
|
|
12
|
+
creditsRemaining: number(),
|
|
13
|
+
startedAt: number(),
|
|
14
|
+
currentPeriodEnd: number(),
|
|
15
|
+
stripeSubscriptionId: string(),
|
|
16
|
+
source: subscriptionSourceEnum,
|
|
17
|
+
});
|