lancer-shared 1.2.19 → 1.2.20
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 +22 -8
- package/dist/constants/collections.js +14 -0
- package/dist/constants/common-questions.js +57 -0
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +18 -0
- package/dist/constants/invoice.d.ts +2 -0
- package/dist/constants/job-filter-options.js +265 -0
- package/dist/constants/job-status.js +21 -0
- package/dist/constants/mappings/countryMapping.js +120 -0
- package/dist/constants/mappings/regionMapping.js +240 -0
- package/dist/constants/routes.js +116 -0
- package/dist/constants/upwork-accounts.js +18 -0
- package/dist/index.js +4 -0
- package/dist/schemas/account/account-status.js +8 -0
- package/dist/schemas/account/bidder-account.js +35 -0
- package/dist/schemas/account/index.js +3 -0
- package/dist/schemas/account/scraper-account.js +34 -0
- package/dist/schemas/ai/ai-config.d.ts +36 -0
- package/dist/schemas/ai/ai-config.js +9 -0
- package/dist/schemas/ai/index.d.ts +3 -0
- package/dist/schemas/ai/index.js +3 -0
- package/dist/schemas/ai/proposal.d.ts +82 -0
- package/dist/schemas/ai/proposal.js +13 -0
- package/dist/schemas/ai/suitability.d.ts +37 -0
- package/dist/schemas/ai/suitability.js +14 -0
- package/dist/schemas/bid/bid-result.js +11 -0
- package/dist/schemas/bid/bid.js +35 -0
- package/dist/schemas/bid/index.js +2 -0
- package/dist/schemas/campaign/campaign-ai-metrics.js +6 -0
- package/dist/schemas/campaign/campaign-analytics.js +42 -0
- package/dist/schemas/campaign/campaign-expenses.js +6 -0
- package/dist/schemas/campaign/campaign-insights.js +31 -0
- package/dist/schemas/campaign/campaign-integrations.js +13 -0
- package/dist/schemas/campaign/campaign-job-count.js +3 -0
- package/dist/schemas/campaign/campaign.js +41 -0
- package/dist/schemas/campaign/index.js +7 -0
- package/dist/schemas/chat-message/chat-message.js +10 -0
- package/dist/schemas/chat-message/index.js +1 -0
- package/dist/schemas/config/agency-config.js +7 -0
- package/dist/schemas/config/index.js +1 -0
- package/dist/schemas/event/index.d.ts +58 -0
- package/dist/schemas/index.js +17 -0
- package/dist/schemas/invoice/index.d.ts +8 -0
- package/dist/schemas/job-filters/index.js +1 -0
- package/dist/schemas/job-filters/job-filters.js +84 -0
- package/dist/schemas/lead/index.js +173 -0
- package/dist/schemas/lead/lead-note.js +27 -0
- package/dist/schemas/lead/lead-status.js +23 -0
- package/dist/schemas/lead/nuxt.js +287 -0
- package/dist/schemas/logger/index.js +1 -0
- package/dist/schemas/logger/log-event.js +117 -0
- package/dist/schemas/organization/index.d.ts +68 -1
- package/dist/schemas/organization/index.js +70 -0
- package/dist/schemas/organization/member.js +7 -0
- package/dist/schemas/organization/organization.d.ts +118 -22
- package/dist/schemas/organization/organization.js +16 -0
- package/dist/schemas/organization/subscription.d.ts +47 -0
- package/dist/schemas/organization/subscription.js +17 -0
- package/dist/schemas/plan/index.d.ts +36 -3
- package/dist/schemas/proxy/index.js +3 -0
- 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 +29 -0
- package/dist/schemas/saved-search/index.js +9 -0
- package/dist/schemas/scraper/index.js +2 -0
- package/dist/schemas/scraper/scrape-payload.d.ts +49 -0
- package/dist/schemas/scraper/scrape-payload.js +21 -0
- package/dist/schemas/scraper/scrape-result.js +23 -0
- package/dist/schemas/shared.js +19 -0
- package/dist/schemas/tier/index.d.ts +119 -0
- package/dist/schemas/time-filter/index.js +6 -0
- package/dist/schemas/transaction/index.js +17 -0
- package/dist/schemas/usage/index.js +18 -0
- package/dist/schemas/user/index.js +52 -0
- package/dist/types/account/account-status.js +1 -0
- package/dist/types/account/bidder-account.js +1 -0
- package/dist/types/account/index.js +3 -0
- package/dist/types/account/scraper-account.js +1 -0
- package/dist/types/ai/ai-config.d.ts +6 -0
- package/dist/types/ai/ai-config.js +1 -0
- package/dist/types/ai/index.d.ts +3 -0
- package/dist/types/ai/index.js +3 -0
- package/dist/types/ai/proposal.d.ts +10 -0
- package/dist/types/ai/proposal.js +1 -0
- package/dist/types/ai/suitability.d.ts +6 -0
- package/dist/types/ai/suitability.js +1 -0
- package/dist/types/bid/bid-result.js +1 -0
- package/dist/types/bid/bid.js +1 -0
- package/dist/types/bid/index.js +2 -0
- package/dist/types/campaign/campaign-analytics.js +1 -0
- package/dist/types/campaign/campaign-expenses.js +1 -0
- package/dist/types/campaign/campaign-insights.js +1 -0
- package/dist/types/campaign/campaign-integrations.js +1 -0
- package/dist/types/campaign/campaign-job-count.js +1 -0
- package/dist/types/campaign/campaign.js +1 -0
- package/dist/types/campaign/index.js +6 -0
- package/dist/types/chat-message/chat-message.js +1 -0
- package/dist/types/chat-message/index.js +1 -0
- package/dist/types/config/agency-config.js +1 -0
- package/dist/types/config/index.js +1 -0
- package/dist/types/index.js +15 -0
- package/dist/types/job/index.js +3 -0
- package/dist/types/job/job-note.js +1 -0
- package/dist/types/job/job-status.js +9 -0
- package/dist/types/job/nuxt.js +1 -0
- package/dist/types/job-filters/index.js +1 -0
- package/dist/types/job-filters/job-filters.js +1 -0
- package/dist/types/logger/index.js +1 -0
- package/dist/types/logger/log-event.js +1 -0
- package/dist/types/saved-search/index.js +1 -0
- package/dist/types/scraper/index.js +2 -0
- package/dist/types/scraper/scrape-payload.js +1 -0
- package/dist/types/scraper/scrape-result.js +1 -0
- package/dist/types/shared.js +1 -0
- package/dist/types/time-filter/index.js +1 -0
- package/dist/types/transaction/index.js +1 -0
- package/dist/types/usage/index.js +1 -0
- package/dist/types/user/index.js +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/try-catch.js +10 -0
- package/package.json +1 -1
|
@@ -6,13 +6,13 @@ export declare const bidConfigSchema: z.ZodObject<{
|
|
|
6
6
|
specialisedProfile: z.ZodNullable<z.ZodString>;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
8
|
agencyName: string | null;
|
|
9
|
-
contractorName: string | null;
|
|
10
9
|
bidderId: string | null;
|
|
10
|
+
contractorName: string | null;
|
|
11
11
|
specialisedProfile: string | null;
|
|
12
12
|
}, {
|
|
13
13
|
agencyName: string | null;
|
|
14
|
-
contractorName: string | null;
|
|
15
14
|
bidderId: string | null;
|
|
15
|
+
contractorName: string | null;
|
|
16
16
|
specialisedProfile: string | null;
|
|
17
17
|
}>;
|
|
18
18
|
export declare const organizationTypeSchema: z.ZodEnum<["agency", "freelancer"]>;
|
|
@@ -27,54 +27,149 @@ export declare const organizationSchema: z.ZodObject<{
|
|
|
27
27
|
specialisedProfile: z.ZodNullable<z.ZodString>;
|
|
28
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
29
|
agencyName: string | null;
|
|
30
|
-
contractorName: string | null;
|
|
31
30
|
bidderId: string | null;
|
|
31
|
+
contractorName: string | null;
|
|
32
32
|
specialisedProfile: string | null;
|
|
33
33
|
}, {
|
|
34
34
|
agencyName: string | null;
|
|
35
|
-
contractorName: string | null;
|
|
36
35
|
bidderId: string | null;
|
|
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
|
-
id: string;
|
|
43
95
|
type: "agency" | "freelancer";
|
|
44
|
-
|
|
45
|
-
updatedAt: Date;
|
|
96
|
+
id: string;
|
|
46
97
|
name: string;
|
|
47
98
|
bidConfig: {
|
|
48
99
|
agencyName: string | null;
|
|
49
|
-
contractorName: string | null;
|
|
50
100
|
bidderId: string | null;
|
|
101
|
+
contractorName: string | null;
|
|
51
102
|
specialisedProfile: string | null;
|
|
52
103
|
};
|
|
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
|
-
id: string;
|
|
55
128
|
type: "agency" | "freelancer";
|
|
56
|
-
|
|
57
|
-
updatedAt: Date;
|
|
129
|
+
id: string;
|
|
58
130
|
name: string;
|
|
59
131
|
bidConfig: {
|
|
60
132
|
agencyName: string | null;
|
|
61
|
-
contractorName: string | null;
|
|
62
133
|
bidderId: string | null;
|
|
134
|
+
contractorName: string | null;
|
|
63
135
|
specialisedProfile: string | null;
|
|
64
136
|
};
|
|
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;
|
|
65
160
|
}>;
|
|
66
161
|
export declare const aiConfigSchema: z.ZodObject<{
|
|
67
162
|
suitabilityRules: z.ZodNullable<z.ZodString>;
|
|
68
|
-
|
|
163
|
+
proposalRules: z.ZodNullable<z.ZodString>;
|
|
69
164
|
questionRules: z.ZodNullable<z.ZodString>;
|
|
70
165
|
}, "strip", z.ZodTypeAny, {
|
|
71
166
|
suitabilityRules: string | null;
|
|
167
|
+
proposalRules: string | null;
|
|
72
168
|
questionRules: string | null;
|
|
73
|
-
coverLetterRules: string | null;
|
|
74
169
|
}, {
|
|
75
170
|
suitabilityRules: string | null;
|
|
171
|
+
proposalRules: string | null;
|
|
76
172
|
questionRules: string | null;
|
|
77
|
-
coverLetterRules: string | null;
|
|
78
173
|
}>;
|
|
79
174
|
export declare const knowledgeBaseSchema: z.ZodObject<{
|
|
80
175
|
about: z.ZodString;
|
|
@@ -89,16 +184,16 @@ export declare const knowledgeBaseSchema: z.ZodObject<{
|
|
|
89
184
|
export declare const organizationSettingsSchema: z.ZodObject<{
|
|
90
185
|
aiConfig: z.ZodObject<{
|
|
91
186
|
suitabilityRules: z.ZodNullable<z.ZodString>;
|
|
92
|
-
|
|
187
|
+
proposalRules: z.ZodNullable<z.ZodString>;
|
|
93
188
|
questionRules: z.ZodNullable<z.ZodString>;
|
|
94
189
|
}, "strip", z.ZodTypeAny, {
|
|
95
190
|
suitabilityRules: string | null;
|
|
191
|
+
proposalRules: string | null;
|
|
96
192
|
questionRules: string | null;
|
|
97
|
-
coverLetterRules: string | null;
|
|
98
193
|
}, {
|
|
99
194
|
suitabilityRules: string | null;
|
|
195
|
+
proposalRules: string | null;
|
|
100
196
|
questionRules: string | null;
|
|
101
|
-
coverLetterRules: string | null;
|
|
102
197
|
}>;
|
|
103
198
|
knowledgeBase: z.ZodObject<{
|
|
104
199
|
about: z.ZodString;
|
|
@@ -113,8 +208,8 @@ export declare const organizationSettingsSchema: z.ZodObject<{
|
|
|
113
208
|
}, "strip", z.ZodTypeAny, {
|
|
114
209
|
aiConfig: {
|
|
115
210
|
suitabilityRules: string | null;
|
|
211
|
+
proposalRules: string | null;
|
|
116
212
|
questionRules: string | null;
|
|
117
|
-
coverLetterRules: string | null;
|
|
118
213
|
};
|
|
119
214
|
knowledgeBase: {
|
|
120
215
|
about: string;
|
|
@@ -123,8 +218,8 @@ export declare const organizationSettingsSchema: z.ZodObject<{
|
|
|
123
218
|
}, {
|
|
124
219
|
aiConfig: {
|
|
125
220
|
suitabilityRules: string | null;
|
|
221
|
+
proposalRules: string | null;
|
|
126
222
|
questionRules: string | null;
|
|
127
|
-
coverLetterRules: string | null;
|
|
128
223
|
};
|
|
129
224
|
knowledgeBase: {
|
|
130
225
|
about: string;
|
|
@@ -142,3 +237,4 @@ export interface OrganizationSettings extends z.infer<typeof organizationSetting
|
|
|
142
237
|
export interface BidConfig extends z.infer<typeof bidConfigSchema> {
|
|
143
238
|
}
|
|
144
239
|
export type OrganizationType = z.infer<typeof organizationTypeSchema>;
|
|
240
|
+
export * from "./subscription";
|
|
@@ -0,0 +1,16 @@
|
|
|
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(),
|
|
7
|
+
});
|
|
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(),
|
|
16
|
+
});
|
|
@@ -43,6 +43,16 @@ export declare const subscriptionStripeMetadataSchema: z.ZodObject<{
|
|
|
43
43
|
id: string;
|
|
44
44
|
};
|
|
45
45
|
}>, "many">;
|
|
46
|
+
invoice: z.ZodObject<{
|
|
47
|
+
id: z.ZodString;
|
|
48
|
+
hosted_invoice_url: z.ZodNullable<z.ZodString>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
id: string;
|
|
51
|
+
hosted_invoice_url: string | null;
|
|
52
|
+
}, {
|
|
53
|
+
id: string;
|
|
54
|
+
hosted_invoice_url: string | null;
|
|
55
|
+
}>;
|
|
46
56
|
}, "strip", z.ZodTypeAny, {
|
|
47
57
|
id: string;
|
|
48
58
|
items: {
|
|
@@ -51,6 +61,10 @@ export declare const subscriptionStripeMetadataSchema: z.ZodObject<{
|
|
|
51
61
|
id: string;
|
|
52
62
|
};
|
|
53
63
|
}[];
|
|
64
|
+
invoice: {
|
|
65
|
+
id: string;
|
|
66
|
+
hosted_invoice_url: string | null;
|
|
67
|
+
};
|
|
54
68
|
}, {
|
|
55
69
|
id: string;
|
|
56
70
|
items: {
|
|
@@ -59,9 +73,14 @@ export declare const subscriptionStripeMetadataSchema: z.ZodObject<{
|
|
|
59
73
|
id: string;
|
|
60
74
|
};
|
|
61
75
|
}[];
|
|
76
|
+
invoice: {
|
|
77
|
+
id: string;
|
|
78
|
+
hosted_invoice_url: string | null;
|
|
79
|
+
};
|
|
62
80
|
}>;
|
|
63
81
|
export declare const subscriptionSchema: z.ZodObject<{
|
|
64
82
|
planId: z.ZodString;
|
|
83
|
+
pendingPlanId: z.ZodNullable<z.ZodString>;
|
|
65
84
|
status: z.ZodEnum<["active", "trialing", "cancelled", "paused", "payment_pending", "payment_failed"]>;
|
|
66
85
|
startedAt: z.ZodNumber;
|
|
67
86
|
currentPeriodEnd: z.ZodNumber;
|
|
@@ -87,6 +106,16 @@ export declare const subscriptionSchema: z.ZodObject<{
|
|
|
87
106
|
id: string;
|
|
88
107
|
};
|
|
89
108
|
}>, "many">;
|
|
109
|
+
invoice: z.ZodObject<{
|
|
110
|
+
id: z.ZodString;
|
|
111
|
+
hosted_invoice_url: z.ZodNullable<z.ZodString>;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
id: string;
|
|
114
|
+
hosted_invoice_url: string | null;
|
|
115
|
+
}, {
|
|
116
|
+
id: string;
|
|
117
|
+
hosted_invoice_url: string | null;
|
|
118
|
+
}>;
|
|
90
119
|
}, "strip", z.ZodTypeAny, {
|
|
91
120
|
id: string;
|
|
92
121
|
items: {
|
|
@@ -95,6 +124,10 @@ export declare const subscriptionSchema: z.ZodObject<{
|
|
|
95
124
|
id: string;
|
|
96
125
|
};
|
|
97
126
|
}[];
|
|
127
|
+
invoice: {
|
|
128
|
+
id: string;
|
|
129
|
+
hosted_invoice_url: string | null;
|
|
130
|
+
};
|
|
98
131
|
}, {
|
|
99
132
|
id: string;
|
|
100
133
|
items: {
|
|
@@ -103,6 +136,10 @@ export declare const subscriptionSchema: z.ZodObject<{
|
|
|
103
136
|
id: string;
|
|
104
137
|
};
|
|
105
138
|
}[];
|
|
139
|
+
invoice: {
|
|
140
|
+
id: string;
|
|
141
|
+
hosted_invoice_url: string | null;
|
|
142
|
+
};
|
|
106
143
|
}>;
|
|
107
144
|
source: z.ZodEnum<["stripe", "manual"]>;
|
|
108
145
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -114,9 +151,14 @@ export declare const subscriptionSchema: z.ZodObject<{
|
|
|
114
151
|
id: string;
|
|
115
152
|
};
|
|
116
153
|
}[];
|
|
154
|
+
invoice: {
|
|
155
|
+
id: string;
|
|
156
|
+
hosted_invoice_url: string | null;
|
|
157
|
+
};
|
|
117
158
|
};
|
|
118
159
|
status: "active" | "trialing" | "cancelled" | "paused" | "payment_pending" | "payment_failed";
|
|
119
160
|
planId: string;
|
|
161
|
+
pendingPlanId: string | null;
|
|
120
162
|
startedAt: number;
|
|
121
163
|
currentPeriodEnd: number;
|
|
122
164
|
source: "stripe" | "manual";
|
|
@@ -129,9 +171,14 @@ export declare const subscriptionSchema: z.ZodObject<{
|
|
|
129
171
|
id: string;
|
|
130
172
|
};
|
|
131
173
|
}[];
|
|
174
|
+
invoice: {
|
|
175
|
+
id: string;
|
|
176
|
+
hosted_invoice_url: string | null;
|
|
177
|
+
};
|
|
132
178
|
};
|
|
133
179
|
status: "active" | "trialing" | "cancelled" | "paused" | "payment_pending" | "payment_failed";
|
|
134
180
|
planId: string;
|
|
181
|
+
pendingPlanId: string | null;
|
|
135
182
|
startedAt: number;
|
|
136
183
|
currentPeriodEnd: number;
|
|
137
184
|
source: "stripe" | "manual";
|
|
@@ -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
|
+
});
|
|
@@ -32,10 +32,22 @@ export declare const planStripeMetadataSchema: import("zod").ZodObject<{
|
|
|
32
32
|
lookup_key: string;
|
|
33
33
|
}[];
|
|
34
34
|
}>;
|
|
35
|
+
export declare const planFeatureSchema: import("zod").ZodObject<{
|
|
36
|
+
id: import("zod").ZodString;
|
|
37
|
+
description: import("zod").ZodString;
|
|
38
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
39
|
+
id: string;
|
|
40
|
+
description: string;
|
|
41
|
+
}, {
|
|
42
|
+
id: string;
|
|
43
|
+
description: string;
|
|
44
|
+
}>;
|
|
35
45
|
export declare const planSchema: import("zod").ZodObject<{
|
|
36
46
|
id: import("zod").ZodString;
|
|
37
47
|
name: import("zod").ZodString;
|
|
38
48
|
slug: import("zod").ZodString;
|
|
49
|
+
description: import("zod").ZodString;
|
|
50
|
+
price: import("zod").ZodNumber;
|
|
39
51
|
stripe: import("zod").ZodObject<{
|
|
40
52
|
id: import("zod").ZodString;
|
|
41
53
|
name: import("zod").ZodString;
|
|
@@ -70,7 +82,16 @@ export declare const planSchema: import("zod").ZodObject<{
|
|
|
70
82
|
}[];
|
|
71
83
|
}>;
|
|
72
84
|
version: import("zod").ZodNumber;
|
|
73
|
-
features: import("zod").ZodArray<import("zod").
|
|
85
|
+
features: import("zod").ZodArray<import("zod").ZodObject<{
|
|
86
|
+
id: import("zod").ZodString;
|
|
87
|
+
description: import("zod").ZodString;
|
|
88
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
89
|
+
id: string;
|
|
90
|
+
description: string;
|
|
91
|
+
}, {
|
|
92
|
+
id: string;
|
|
93
|
+
description: string;
|
|
94
|
+
}>, "many">;
|
|
74
95
|
sortOrder: import("zod").ZodNumber;
|
|
75
96
|
isActive: import("zod").ZodBoolean;
|
|
76
97
|
createdAt: import("zod").ZodNumber;
|
|
@@ -78,7 +99,9 @@ export declare const planSchema: import("zod").ZodObject<{
|
|
|
78
99
|
}, "strip", import("zod").ZodTypeAny, {
|
|
79
100
|
id: string;
|
|
80
101
|
name: string;
|
|
102
|
+
description: string;
|
|
81
103
|
slug: string;
|
|
104
|
+
price: number;
|
|
82
105
|
stripe: {
|
|
83
106
|
id: string;
|
|
84
107
|
name: string;
|
|
@@ -89,7 +112,10 @@ export declare const planSchema: import("zod").ZodObject<{
|
|
|
89
112
|
}[];
|
|
90
113
|
};
|
|
91
114
|
version: number;
|
|
92
|
-
features:
|
|
115
|
+
features: {
|
|
116
|
+
id: string;
|
|
117
|
+
description: string;
|
|
118
|
+
}[];
|
|
93
119
|
sortOrder: number;
|
|
94
120
|
isActive: boolean;
|
|
95
121
|
createdAt: number;
|
|
@@ -97,7 +123,9 @@ export declare const planSchema: import("zod").ZodObject<{
|
|
|
97
123
|
}, {
|
|
98
124
|
id: string;
|
|
99
125
|
name: string;
|
|
126
|
+
description: string;
|
|
100
127
|
slug: string;
|
|
128
|
+
price: number;
|
|
101
129
|
stripe: {
|
|
102
130
|
id: string;
|
|
103
131
|
name: string;
|
|
@@ -108,7 +136,10 @@ export declare const planSchema: import("zod").ZodObject<{
|
|
|
108
136
|
}[];
|
|
109
137
|
};
|
|
110
138
|
version: number;
|
|
111
|
-
features:
|
|
139
|
+
features: {
|
|
140
|
+
id: string;
|
|
141
|
+
description: string;
|
|
142
|
+
}[];
|
|
112
143
|
sortOrder: number;
|
|
113
144
|
isActive: boolean;
|
|
114
145
|
createdAt: number;
|
|
@@ -116,5 +147,7 @@ export declare const planSchema: import("zod").ZodObject<{
|
|
|
116
147
|
}>;
|
|
117
148
|
export interface PlanStripeMetadata extends infer<typeof planStripeMetadataSchema> {
|
|
118
149
|
}
|
|
150
|
+
export interface PlanFeature extends infer<typeof planFeatureSchema> {
|
|
151
|
+
}
|
|
119
152
|
export interface Plan extends infer<typeof planSchema> {
|
|
120
153
|
}
|