@deepintel-ltd/farmpro-contracts 1.5.14 → 1.5.16
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/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/routes/agents.routes.d.ts +3 -3
- package/dist/routes/agents.routes.js +1 -1
- package/dist/routes/auth.routes.d.ts +516 -0
- package/dist/routes/auth.routes.d.ts.map +1 -1
- package/dist/routes/auth.routes.js +26 -2
- package/dist/routes/index.d.ts +6 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +4 -0
- package/dist/routes/payments.routes.d.ts +1851 -0
- package/dist/routes/payments.routes.d.ts.map +1 -0
- package/dist/routes/payments.routes.js +91 -0
- package/dist/routes/subscriptions.routes.d.ts +3151 -0
- package/dist/routes/subscriptions.routes.d.ts.map +1 -0
- package/dist/routes/subscriptions.routes.js +155 -0
- package/dist/schemas/auth.schemas.d.ts +314 -0
- package/dist/schemas/auth.schemas.d.ts.map +1 -1
- package/dist/schemas/auth.schemas.js +27 -0
- package/dist/schemas/payments.schemas.d.ts +822 -0
- package/dist/schemas/payments.schemas.d.ts.map +1 -0
- package/dist/schemas/payments.schemas.js +105 -0
- package/dist/schemas/subscriptions.schemas.d.ts +1344 -0
- package/dist/schemas/subscriptions.schemas.d.ts.map +1 -0
- package/dist/schemas/subscriptions.schemas.js +150 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.routes.d.ts","sourceRoot":"","sources":["../../src/routes/subscriptions.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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@@
|
|
|
1
|
+
import { initContract } from '@ts-rest/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { subscriptionResponseSchema, subscriptionListResponseSchema, upgradeSubscriptionAttributesSchema, usageTrackingListResponseSchema, tierLimitsResponseSchema, currentUsageResponseSchema, availablePlansResponseSchema, } from '../schemas/subscriptions.schemas';
|
|
4
|
+
import { jsonApiErrorResponseSchema, jsonApiPaginationQuerySchema, } from '../schemas/common.schemas';
|
|
5
|
+
const c = initContract();
|
|
6
|
+
export const subscriptionsRouter = c.router({
|
|
7
|
+
// Get all available subscription plans (public endpoint for landing page)
|
|
8
|
+
getAvailablePlans: {
|
|
9
|
+
method: 'GET',
|
|
10
|
+
path: '/subscriptions/plans',
|
|
11
|
+
query: z.object({
|
|
12
|
+
'currency': z.enum(['NGN', 'USD']).optional(),
|
|
13
|
+
'country': z.string().optional(), // ISO 3166-1 alpha-2 country code (e.g., 'NG', 'US')
|
|
14
|
+
'farmId': z.string().uuid().optional(), // Optional: use farm location for detection
|
|
15
|
+
}),
|
|
16
|
+
responses: {
|
|
17
|
+
200: availablePlansResponseSchema,
|
|
18
|
+
},
|
|
19
|
+
summary: 'Get available subscription plans',
|
|
20
|
+
description: 'Get all available subscription tiers with pricing and features. Pricing is automatically detected based on location (farm, IP, or explicit hint).',
|
|
21
|
+
},
|
|
22
|
+
// Get current subscription for a farm
|
|
23
|
+
getCurrentSubscription: {
|
|
24
|
+
method: 'GET',
|
|
25
|
+
path: '/farms/:farmId/subscription',
|
|
26
|
+
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
27
|
+
responses: {
|
|
28
|
+
200: subscriptionResponseSchema,
|
|
29
|
+
404: jsonApiErrorResponseSchema,
|
|
30
|
+
401: jsonApiErrorResponseSchema,
|
|
31
|
+
},
|
|
32
|
+
summary: 'Get current subscription',
|
|
33
|
+
description: 'Get the current active subscription for a farm',
|
|
34
|
+
},
|
|
35
|
+
// Get subscription by ID
|
|
36
|
+
getSubscription: {
|
|
37
|
+
method: 'GET',
|
|
38
|
+
path: '/farms/:farmId/subscriptions/:id',
|
|
39
|
+
pathParams: z.object({
|
|
40
|
+
farmId: z.string().uuid(),
|
|
41
|
+
id: z.string().uuid(),
|
|
42
|
+
}),
|
|
43
|
+
responses: {
|
|
44
|
+
200: subscriptionResponseSchema,
|
|
45
|
+
404: jsonApiErrorResponseSchema,
|
|
46
|
+
401: jsonApiErrorResponseSchema,
|
|
47
|
+
},
|
|
48
|
+
summary: 'Get subscription by ID',
|
|
49
|
+
description: 'Get a specific subscription by ID',
|
|
50
|
+
},
|
|
51
|
+
// List all subscriptions for a farm
|
|
52
|
+
listSubscriptions: {
|
|
53
|
+
method: 'GET',
|
|
54
|
+
path: '/farms/:farmId/subscriptions',
|
|
55
|
+
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
56
|
+
query: jsonApiPaginationQuerySchema.merge(z.object({
|
|
57
|
+
'filter[status]': z.enum(['active', 'cancelled', 'expired', 'trial']).optional(),
|
|
58
|
+
'filter[tier]': z.enum(['FREE', 'STARTER_PACK', 'COOPERATIVE', 'ENTERPRISE', 'GOVERNMENT']).optional(),
|
|
59
|
+
})),
|
|
60
|
+
responses: {
|
|
61
|
+
200: subscriptionListResponseSchema,
|
|
62
|
+
404: jsonApiErrorResponseSchema,
|
|
63
|
+
401: jsonApiErrorResponseSchema,
|
|
64
|
+
},
|
|
65
|
+
summary: 'List subscriptions',
|
|
66
|
+
description: 'Get all subscriptions for a farm with optional filtering',
|
|
67
|
+
},
|
|
68
|
+
// Upgrade subscription
|
|
69
|
+
upgradeSubscription: {
|
|
70
|
+
method: 'POST',
|
|
71
|
+
path: '/farms/:farmId/subscriptions/upgrade',
|
|
72
|
+
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
73
|
+
body: z.object({
|
|
74
|
+
data: z.object({
|
|
75
|
+
type: z.literal('subscriptions'),
|
|
76
|
+
attributes: upgradeSubscriptionAttributesSchema,
|
|
77
|
+
}),
|
|
78
|
+
}),
|
|
79
|
+
responses: {
|
|
80
|
+
200: subscriptionResponseSchema,
|
|
81
|
+
400: jsonApiErrorResponseSchema,
|
|
82
|
+
404: jsonApiErrorResponseSchema,
|
|
83
|
+
401: jsonApiErrorResponseSchema,
|
|
84
|
+
},
|
|
85
|
+
summary: 'Upgrade subscription',
|
|
86
|
+
description: 'Upgrade a farm subscription to a new tier',
|
|
87
|
+
},
|
|
88
|
+
// Cancel subscription
|
|
89
|
+
cancelSubscription: {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
path: '/farms/:farmId/subscriptions/:id/cancel',
|
|
92
|
+
pathParams: z.object({
|
|
93
|
+
farmId: z.string().uuid(),
|
|
94
|
+
id: z.string().uuid(),
|
|
95
|
+
}),
|
|
96
|
+
body: z.object({}).optional(),
|
|
97
|
+
responses: {
|
|
98
|
+
200: subscriptionResponseSchema,
|
|
99
|
+
404: jsonApiErrorResponseSchema,
|
|
100
|
+
401: jsonApiErrorResponseSchema,
|
|
101
|
+
},
|
|
102
|
+
summary: 'Cancel subscription',
|
|
103
|
+
description: 'Cancel an active subscription',
|
|
104
|
+
},
|
|
105
|
+
// Get tier limits
|
|
106
|
+
getTierLimits: {
|
|
107
|
+
method: 'GET',
|
|
108
|
+
path: '/farms/:farmId/subscription/limits',
|
|
109
|
+
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
110
|
+
responses: {
|
|
111
|
+
200: z.object({
|
|
112
|
+
data: tierLimitsResponseSchema,
|
|
113
|
+
}),
|
|
114
|
+
404: jsonApiErrorResponseSchema,
|
|
115
|
+
401: jsonApiErrorResponseSchema,
|
|
116
|
+
},
|
|
117
|
+
summary: 'Get tier limits',
|
|
118
|
+
description: 'Get the limits for the current subscription tier',
|
|
119
|
+
},
|
|
120
|
+
// Get usage tracking
|
|
121
|
+
getUsageTracking: {
|
|
122
|
+
method: 'GET',
|
|
123
|
+
path: '/farms/:farmId/subscription/usage',
|
|
124
|
+
pathParams: z.object({ farmId: z.string().uuid() }),
|
|
125
|
+
query: z.object({
|
|
126
|
+
'filter[resourceType]': z.string().optional(), // 'ai_image', 'satellite_check', etc.
|
|
127
|
+
'filter[periodStart]': z.string().datetime().optional(),
|
|
128
|
+
}),
|
|
129
|
+
responses: {
|
|
130
|
+
200: usageTrackingListResponseSchema,
|
|
131
|
+
404: jsonApiErrorResponseSchema,
|
|
132
|
+
401: jsonApiErrorResponseSchema,
|
|
133
|
+
},
|
|
134
|
+
summary: 'Get usage tracking',
|
|
135
|
+
description: 'Get usage tracking data for the current subscription period',
|
|
136
|
+
},
|
|
137
|
+
// Get current usage for a specific resource
|
|
138
|
+
getCurrentUsage: {
|
|
139
|
+
method: 'GET',
|
|
140
|
+
path: '/farms/:farmId/subscription/usage/:resourceType',
|
|
141
|
+
pathParams: z.object({
|
|
142
|
+
farmId: z.string().uuid(),
|
|
143
|
+
resourceType: z.string(), // 'ai_image', 'satellite_check', etc.
|
|
144
|
+
}),
|
|
145
|
+
responses: {
|
|
146
|
+
200: z.object({
|
|
147
|
+
data: currentUsageResponseSchema,
|
|
148
|
+
}),
|
|
149
|
+
404: jsonApiErrorResponseSchema,
|
|
150
|
+
401: jsonApiErrorResponseSchema,
|
|
151
|
+
},
|
|
152
|
+
summary: 'Get current usage',
|
|
153
|
+
description: 'Get current usage for a specific resource type in the current period',
|
|
154
|
+
},
|
|
155
|
+
});
|
|
@@ -16,20 +16,26 @@ export declare const signupAttributesSchema: z.ZodObject<{
|
|
|
16
16
|
name: z.ZodString;
|
|
17
17
|
email: z.ZodString;
|
|
18
18
|
password: z.ZodString;
|
|
19
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
19
20
|
}, "strip", z.ZodTypeAny, {
|
|
20
21
|
email: string;
|
|
21
22
|
password: string;
|
|
22
23
|
name: string;
|
|
24
|
+
phone?: string | undefined;
|
|
23
25
|
}, {
|
|
24
26
|
email: string;
|
|
25
27
|
password: string;
|
|
26
28
|
name: string;
|
|
29
|
+
phone?: string | undefined;
|
|
27
30
|
}>;
|
|
28
31
|
export declare const googleAuthInitiateAttributesSchema: z.ZodObject<{
|
|
29
32
|
redirectUri: z.ZodOptional<z.ZodString>;
|
|
33
|
+
source: z.ZodOptional<z.ZodString>;
|
|
30
34
|
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
source?: string | undefined;
|
|
31
36
|
redirectUri?: string | undefined;
|
|
32
37
|
}, {
|
|
38
|
+
source?: string | undefined;
|
|
33
39
|
redirectUri?: string | undefined;
|
|
34
40
|
}>;
|
|
35
41
|
export declare const googleAuthCallbackAttributesSchema: z.ZodObject<{
|
|
@@ -97,6 +103,47 @@ export declare const logoutAttributesSchema: z.ZodObject<{
|
|
|
97
103
|
}, {
|
|
98
104
|
refreshToken?: string | undefined;
|
|
99
105
|
}>;
|
|
106
|
+
export declare const completeOnboardingAttributesSchema: z.ZodObject<{
|
|
107
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
108
|
+
skipOnboarding: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
skipOnboarding: boolean;
|
|
111
|
+
phone?: string | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
phone?: string | undefined;
|
|
114
|
+
skipOnboarding?: boolean | undefined;
|
|
115
|
+
}>;
|
|
116
|
+
export declare const onboardingStatusAttributesSchema: z.ZodObject<{
|
|
117
|
+
onboardingCompleted: z.ZodBoolean;
|
|
118
|
+
onboardingSkipped: z.ZodBoolean;
|
|
119
|
+
emailVerified: z.ZodBoolean;
|
|
120
|
+
hasPhone: z.ZodBoolean;
|
|
121
|
+
hasFarm: z.ZodBoolean;
|
|
122
|
+
hasActiveSubscription: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
currentSubscriptionTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
124
|
+
canUpgrade: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
recommendedTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
onboardingCompleted: boolean;
|
|
128
|
+
onboardingSkipped: boolean;
|
|
129
|
+
emailVerified: boolean;
|
|
130
|
+
hasPhone: boolean;
|
|
131
|
+
hasFarm: boolean;
|
|
132
|
+
hasActiveSubscription?: boolean | undefined;
|
|
133
|
+
currentSubscriptionTier?: string | null | undefined;
|
|
134
|
+
canUpgrade?: boolean | undefined;
|
|
135
|
+
recommendedTier?: string | null | undefined;
|
|
136
|
+
}, {
|
|
137
|
+
onboardingCompleted: boolean;
|
|
138
|
+
onboardingSkipped: boolean;
|
|
139
|
+
emailVerified: boolean;
|
|
140
|
+
hasPhone: boolean;
|
|
141
|
+
hasFarm: boolean;
|
|
142
|
+
hasActiveSubscription?: boolean | undefined;
|
|
143
|
+
currentSubscriptionTier?: string | null | undefined;
|
|
144
|
+
canUpgrade?: boolean | undefined;
|
|
145
|
+
recommendedTier?: string | null | undefined;
|
|
146
|
+
}>;
|
|
100
147
|
export declare const loginSchema: z.ZodObject<{
|
|
101
148
|
type: z.ZodLiteral<"auth">;
|
|
102
149
|
attributes: z.ZodObject<{
|
|
@@ -128,14 +175,17 @@ export declare const signupSchema: z.ZodObject<{
|
|
|
128
175
|
name: z.ZodString;
|
|
129
176
|
email: z.ZodString;
|
|
130
177
|
password: z.ZodString;
|
|
178
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
131
179
|
}, "strip", z.ZodTypeAny, {
|
|
132
180
|
email: string;
|
|
133
181
|
password: string;
|
|
134
182
|
name: string;
|
|
183
|
+
phone?: string | undefined;
|
|
135
184
|
}, {
|
|
136
185
|
email: string;
|
|
137
186
|
password: string;
|
|
138
187
|
name: string;
|
|
188
|
+
phone?: string | undefined;
|
|
139
189
|
}>;
|
|
140
190
|
}, "strip", z.ZodTypeAny, {
|
|
141
191
|
type: "users";
|
|
@@ -143,6 +193,7 @@ export declare const signupSchema: z.ZodObject<{
|
|
|
143
193
|
email: string;
|
|
144
194
|
password: string;
|
|
145
195
|
name: string;
|
|
196
|
+
phone?: string | undefined;
|
|
146
197
|
};
|
|
147
198
|
}, {
|
|
148
199
|
type: "users";
|
|
@@ -150,25 +201,31 @@ export declare const signupSchema: z.ZodObject<{
|
|
|
150
201
|
email: string;
|
|
151
202
|
password: string;
|
|
152
203
|
name: string;
|
|
204
|
+
phone?: string | undefined;
|
|
153
205
|
};
|
|
154
206
|
}>;
|
|
155
207
|
export declare const googleAuthInitiateSchema: z.ZodObject<{
|
|
156
208
|
type: z.ZodLiteral<"auth">;
|
|
157
209
|
attributes: z.ZodObject<{
|
|
158
210
|
redirectUri: z.ZodOptional<z.ZodString>;
|
|
211
|
+
source: z.ZodOptional<z.ZodString>;
|
|
159
212
|
}, "strip", z.ZodTypeAny, {
|
|
213
|
+
source?: string | undefined;
|
|
160
214
|
redirectUri?: string | undefined;
|
|
161
215
|
}, {
|
|
216
|
+
source?: string | undefined;
|
|
162
217
|
redirectUri?: string | undefined;
|
|
163
218
|
}>;
|
|
164
219
|
}, "strip", z.ZodTypeAny, {
|
|
165
220
|
type: "auth";
|
|
166
221
|
attributes: {
|
|
222
|
+
source?: string | undefined;
|
|
167
223
|
redirectUri?: string | undefined;
|
|
168
224
|
};
|
|
169
225
|
}, {
|
|
170
226
|
type: "auth";
|
|
171
227
|
attributes: {
|
|
228
|
+
source?: string | undefined;
|
|
172
229
|
redirectUri?: string | undefined;
|
|
173
230
|
};
|
|
174
231
|
}>;
|
|
@@ -347,6 +404,31 @@ export declare const logoutSchema: z.ZodObject<{
|
|
|
347
404
|
refreshToken?: string | undefined;
|
|
348
405
|
};
|
|
349
406
|
}>;
|
|
407
|
+
export declare const completeOnboardingSchema: z.ZodObject<{
|
|
408
|
+
type: z.ZodLiteral<"onboarding">;
|
|
409
|
+
attributes: z.ZodObject<{
|
|
410
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
411
|
+
skipOnboarding: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
412
|
+
}, "strip", z.ZodTypeAny, {
|
|
413
|
+
skipOnboarding: boolean;
|
|
414
|
+
phone?: string | undefined;
|
|
415
|
+
}, {
|
|
416
|
+
phone?: string | undefined;
|
|
417
|
+
skipOnboarding?: boolean | undefined;
|
|
418
|
+
}>;
|
|
419
|
+
}, "strip", z.ZodTypeAny, {
|
|
420
|
+
type: "onboarding";
|
|
421
|
+
attributes: {
|
|
422
|
+
skipOnboarding: boolean;
|
|
423
|
+
phone?: string | undefined;
|
|
424
|
+
};
|
|
425
|
+
}, {
|
|
426
|
+
type: "onboarding";
|
|
427
|
+
attributes: {
|
|
428
|
+
phone?: string | undefined;
|
|
429
|
+
skipOnboarding?: boolean | undefined;
|
|
430
|
+
};
|
|
431
|
+
}>;
|
|
350
432
|
export declare const authUserAttributesSchema: z.ZodObject<{
|
|
351
433
|
name: z.ZodString;
|
|
352
434
|
email: z.ZodString;
|
|
@@ -1070,6 +1152,234 @@ export declare const emailVerificationResponseSchema: z.ZodObject<{
|
|
|
1070
1152
|
message: string;
|
|
1071
1153
|
};
|
|
1072
1154
|
}>;
|
|
1155
|
+
export declare const onboardingStatusResourceSchema: z.ZodObject<{
|
|
1156
|
+
type: z.ZodLiteral<string>;
|
|
1157
|
+
id: z.ZodString;
|
|
1158
|
+
attributes: z.ZodObject<{
|
|
1159
|
+
onboardingCompleted: z.ZodBoolean;
|
|
1160
|
+
onboardingSkipped: z.ZodBoolean;
|
|
1161
|
+
emailVerified: z.ZodBoolean;
|
|
1162
|
+
hasPhone: z.ZodBoolean;
|
|
1163
|
+
hasFarm: z.ZodBoolean;
|
|
1164
|
+
hasActiveSubscription: z.ZodOptional<z.ZodBoolean>;
|
|
1165
|
+
currentSubscriptionTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1166
|
+
canUpgrade: z.ZodOptional<z.ZodBoolean>;
|
|
1167
|
+
recommendedTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1168
|
+
}, "strip", z.ZodTypeAny, {
|
|
1169
|
+
onboardingCompleted: boolean;
|
|
1170
|
+
onboardingSkipped: boolean;
|
|
1171
|
+
emailVerified: boolean;
|
|
1172
|
+
hasPhone: boolean;
|
|
1173
|
+
hasFarm: boolean;
|
|
1174
|
+
hasActiveSubscription?: boolean | undefined;
|
|
1175
|
+
currentSubscriptionTier?: string | null | undefined;
|
|
1176
|
+
canUpgrade?: boolean | undefined;
|
|
1177
|
+
recommendedTier?: string | null | undefined;
|
|
1178
|
+
}, {
|
|
1179
|
+
onboardingCompleted: boolean;
|
|
1180
|
+
onboardingSkipped: boolean;
|
|
1181
|
+
emailVerified: boolean;
|
|
1182
|
+
hasPhone: boolean;
|
|
1183
|
+
hasFarm: boolean;
|
|
1184
|
+
hasActiveSubscription?: boolean | undefined;
|
|
1185
|
+
currentSubscriptionTier?: string | null | undefined;
|
|
1186
|
+
canUpgrade?: boolean | undefined;
|
|
1187
|
+
recommendedTier?: string | null | undefined;
|
|
1188
|
+
}>;
|
|
1189
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1190
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1191
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1192
|
+
}, "strip", z.ZodTypeAny, {
|
|
1193
|
+
type: string;
|
|
1194
|
+
id: string;
|
|
1195
|
+
attributes: {
|
|
1196
|
+
onboardingCompleted: boolean;
|
|
1197
|
+
onboardingSkipped: boolean;
|
|
1198
|
+
emailVerified: boolean;
|
|
1199
|
+
hasPhone: boolean;
|
|
1200
|
+
hasFarm: boolean;
|
|
1201
|
+
hasActiveSubscription?: boolean | undefined;
|
|
1202
|
+
currentSubscriptionTier?: string | null | undefined;
|
|
1203
|
+
canUpgrade?: boolean | undefined;
|
|
1204
|
+
recommendedTier?: string | null | undefined;
|
|
1205
|
+
};
|
|
1206
|
+
relationships?: Record<string, unknown> | undefined;
|
|
1207
|
+
links?: Record<string, string> | undefined;
|
|
1208
|
+
meta?: Record<string, unknown> | undefined;
|
|
1209
|
+
}, {
|
|
1210
|
+
type: string;
|
|
1211
|
+
id: string;
|
|
1212
|
+
attributes: {
|
|
1213
|
+
onboardingCompleted: boolean;
|
|
1214
|
+
onboardingSkipped: boolean;
|
|
1215
|
+
emailVerified: boolean;
|
|
1216
|
+
hasPhone: boolean;
|
|
1217
|
+
hasFarm: boolean;
|
|
1218
|
+
hasActiveSubscription?: boolean | undefined;
|
|
1219
|
+
currentSubscriptionTier?: string | null | undefined;
|
|
1220
|
+
canUpgrade?: boolean | undefined;
|
|
1221
|
+
recommendedTier?: string | null | undefined;
|
|
1222
|
+
};
|
|
1223
|
+
relationships?: Record<string, unknown> | undefined;
|
|
1224
|
+
links?: Record<string, string> | undefined;
|
|
1225
|
+
meta?: Record<string, unknown> | undefined;
|
|
1226
|
+
}>;
|
|
1227
|
+
export declare const onboardingStatusResponseSchema: z.ZodObject<{
|
|
1228
|
+
data: z.ZodObject<{
|
|
1229
|
+
type: z.ZodLiteral<string>;
|
|
1230
|
+
id: z.ZodString;
|
|
1231
|
+
attributes: z.ZodObject<{
|
|
1232
|
+
onboardingCompleted: z.ZodBoolean;
|
|
1233
|
+
onboardingSkipped: z.ZodBoolean;
|
|
1234
|
+
emailVerified: z.ZodBoolean;
|
|
1235
|
+
hasPhone: z.ZodBoolean;
|
|
1236
|
+
hasFarm: z.ZodBoolean;
|
|
1237
|
+
hasActiveSubscription: z.ZodOptional<z.ZodBoolean>;
|
|
1238
|
+
currentSubscriptionTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1239
|
+
canUpgrade: z.ZodOptional<z.ZodBoolean>;
|
|
1240
|
+
recommendedTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1241
|
+
}, "strip", z.ZodTypeAny, {
|
|
1242
|
+
onboardingCompleted: boolean;
|
|
1243
|
+
onboardingSkipped: boolean;
|
|
1244
|
+
emailVerified: boolean;
|
|
1245
|
+
hasPhone: boolean;
|
|
1246
|
+
hasFarm: boolean;
|
|
1247
|
+
hasActiveSubscription?: boolean | undefined;
|
|
1248
|
+
currentSubscriptionTier?: string | null | undefined;
|
|
1249
|
+
canUpgrade?: boolean | undefined;
|
|
1250
|
+
recommendedTier?: string | null | undefined;
|
|
1251
|
+
}, {
|
|
1252
|
+
onboardingCompleted: boolean;
|
|
1253
|
+
onboardingSkipped: boolean;
|
|
1254
|
+
emailVerified: boolean;
|
|
1255
|
+
hasPhone: boolean;
|
|
1256
|
+
hasFarm: boolean;
|
|
1257
|
+
hasActiveSubscription?: boolean | undefined;
|
|
1258
|
+
currentSubscriptionTier?: string | null | undefined;
|
|
1259
|
+
canUpgrade?: boolean | undefined;
|
|
1260
|
+
recommendedTier?: string | null | undefined;
|
|
1261
|
+
}>;
|
|
1262
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1263
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1264
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1265
|
+
}, "strip", z.ZodTypeAny, {
|
|
1266
|
+
type: string;
|
|
1267
|
+
id: string;
|
|
1268
|
+
attributes: {
|
|
1269
|
+
onboardingCompleted: boolean;
|
|
1270
|
+
onboardingSkipped: boolean;
|
|
1271
|
+
emailVerified: boolean;
|
|
1272
|
+
hasPhone: boolean;
|
|
1273
|
+
hasFarm: boolean;
|
|
1274
|
+
hasActiveSubscription?: boolean | undefined;
|
|
1275
|
+
currentSubscriptionTier?: string | null | undefined;
|
|
1276
|
+
canUpgrade?: boolean | undefined;
|
|
1277
|
+
recommendedTier?: string | null | undefined;
|
|
1278
|
+
};
|
|
1279
|
+
relationships?: Record<string, unknown> | undefined;
|
|
1280
|
+
links?: Record<string, string> | undefined;
|
|
1281
|
+
meta?: Record<string, unknown> | undefined;
|
|
1282
|
+
}, {
|
|
1283
|
+
type: string;
|
|
1284
|
+
id: string;
|
|
1285
|
+
attributes: {
|
|
1286
|
+
onboardingCompleted: boolean;
|
|
1287
|
+
onboardingSkipped: boolean;
|
|
1288
|
+
emailVerified: boolean;
|
|
1289
|
+
hasPhone: boolean;
|
|
1290
|
+
hasFarm: boolean;
|
|
1291
|
+
hasActiveSubscription?: boolean | undefined;
|
|
1292
|
+
currentSubscriptionTier?: string | null | undefined;
|
|
1293
|
+
canUpgrade?: boolean | undefined;
|
|
1294
|
+
recommendedTier?: string | null | undefined;
|
|
1295
|
+
};
|
|
1296
|
+
relationships?: Record<string, unknown> | undefined;
|
|
1297
|
+
links?: Record<string, string> | undefined;
|
|
1298
|
+
meta?: Record<string, unknown> | undefined;
|
|
1299
|
+
}>;
|
|
1300
|
+
included: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1301
|
+
type: z.ZodString;
|
|
1302
|
+
id: z.ZodString;
|
|
1303
|
+
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1304
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1305
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1306
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1307
|
+
}, "strip", z.ZodTypeAny, {
|
|
1308
|
+
type: string;
|
|
1309
|
+
id: string;
|
|
1310
|
+
attributes?: Record<string, unknown> | undefined;
|
|
1311
|
+
relationships?: Record<string, unknown> | undefined;
|
|
1312
|
+
links?: Record<string, string> | undefined;
|
|
1313
|
+
meta?: Record<string, unknown> | undefined;
|
|
1314
|
+
}, {
|
|
1315
|
+
type: string;
|
|
1316
|
+
id: string;
|
|
1317
|
+
attributes?: Record<string, unknown> | undefined;
|
|
1318
|
+
relationships?: Record<string, unknown> | undefined;
|
|
1319
|
+
links?: Record<string, string> | undefined;
|
|
1320
|
+
meta?: Record<string, unknown> | undefined;
|
|
1321
|
+
}>, "many">>;
|
|
1322
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1323
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1324
|
+
}, "strip", z.ZodTypeAny, {
|
|
1325
|
+
data: {
|
|
1326
|
+
type: string;
|
|
1327
|
+
id: string;
|
|
1328
|
+
attributes: {
|
|
1329
|
+
onboardingCompleted: boolean;
|
|
1330
|
+
onboardingSkipped: boolean;
|
|
1331
|
+
emailVerified: boolean;
|
|
1332
|
+
hasPhone: boolean;
|
|
1333
|
+
hasFarm: boolean;
|
|
1334
|
+
hasActiveSubscription?: boolean | undefined;
|
|
1335
|
+
currentSubscriptionTier?: string | null | undefined;
|
|
1336
|
+
canUpgrade?: boolean | undefined;
|
|
1337
|
+
recommendedTier?: string | null | undefined;
|
|
1338
|
+
};
|
|
1339
|
+
relationships?: Record<string, unknown> | undefined;
|
|
1340
|
+
links?: Record<string, string> | undefined;
|
|
1341
|
+
meta?: Record<string, unknown> | undefined;
|
|
1342
|
+
};
|
|
1343
|
+
links?: Record<string, string> | undefined;
|
|
1344
|
+
meta?: Record<string, unknown> | undefined;
|
|
1345
|
+
included?: {
|
|
1346
|
+
type: string;
|
|
1347
|
+
id: string;
|
|
1348
|
+
attributes?: Record<string, unknown> | undefined;
|
|
1349
|
+
relationships?: Record<string, unknown> | undefined;
|
|
1350
|
+
links?: Record<string, string> | undefined;
|
|
1351
|
+
meta?: Record<string, unknown> | undefined;
|
|
1352
|
+
}[] | undefined;
|
|
1353
|
+
}, {
|
|
1354
|
+
data: {
|
|
1355
|
+
type: string;
|
|
1356
|
+
id: string;
|
|
1357
|
+
attributes: {
|
|
1358
|
+
onboardingCompleted: boolean;
|
|
1359
|
+
onboardingSkipped: boolean;
|
|
1360
|
+
emailVerified: boolean;
|
|
1361
|
+
hasPhone: boolean;
|
|
1362
|
+
hasFarm: boolean;
|
|
1363
|
+
hasActiveSubscription?: boolean | undefined;
|
|
1364
|
+
currentSubscriptionTier?: string | null | undefined;
|
|
1365
|
+
canUpgrade?: boolean | undefined;
|
|
1366
|
+
recommendedTier?: string | null | undefined;
|
|
1367
|
+
};
|
|
1368
|
+
relationships?: Record<string, unknown> | undefined;
|
|
1369
|
+
links?: Record<string, string> | undefined;
|
|
1370
|
+
meta?: Record<string, unknown> | undefined;
|
|
1371
|
+
};
|
|
1372
|
+
links?: Record<string, string> | undefined;
|
|
1373
|
+
meta?: Record<string, unknown> | undefined;
|
|
1374
|
+
included?: {
|
|
1375
|
+
type: string;
|
|
1376
|
+
id: string;
|
|
1377
|
+
attributes?: Record<string, unknown> | undefined;
|
|
1378
|
+
relationships?: Record<string, unknown> | undefined;
|
|
1379
|
+
links?: Record<string, string> | undefined;
|
|
1380
|
+
meta?: Record<string, unknown> | undefined;
|
|
1381
|
+
}[] | undefined;
|
|
1382
|
+
}>;
|
|
1073
1383
|
export type LoginAttributes = z.infer<typeof loginAttributesSchema>;
|
|
1074
1384
|
export type SignupAttributes = z.infer<typeof signupAttributesSchema>;
|
|
1075
1385
|
export type LoginInput = z.infer<typeof loginSchema>;
|
|
@@ -1083,6 +1393,9 @@ export type ChangePasswordInput = z.infer<typeof changePasswordSchema>;
|
|
|
1083
1393
|
export type VerifyEmailInput = z.infer<typeof verifyEmailSchema>;
|
|
1084
1394
|
export type ResendVerificationInput = z.infer<typeof resendVerificationSchema>;
|
|
1085
1395
|
export type LogoutInput = z.infer<typeof logoutSchema>;
|
|
1396
|
+
export type CompleteOnboardingInput = z.infer<typeof completeOnboardingSchema>;
|
|
1397
|
+
export type CompleteOnboardingAttributes = z.infer<typeof completeOnboardingAttributesSchema>;
|
|
1398
|
+
export type OnboardingStatusAttributes = z.infer<typeof onboardingStatusAttributesSchema>;
|
|
1086
1399
|
export type AuthUserAttributes = z.infer<typeof authUserAttributesSchema>;
|
|
1087
1400
|
export type AuthSessionAttributes = z.infer<typeof authSessionAttributesSchema>;
|
|
1088
1401
|
export type AuthUserResource = z.infer<typeof authUserResourceSchema>;
|
|
@@ -1090,4 +1403,5 @@ export type AuthSessionResource = z.infer<typeof authSessionResourceSchema>;
|
|
|
1090
1403
|
export type AuthResponse = z.infer<typeof authResponseSchema>;
|
|
1091
1404
|
export type GoogleAuthInitiateResponse = z.infer<typeof googleAuthInitiateResponseSchema>;
|
|
1092
1405
|
export type RefreshTokenResponse = z.infer<typeof refreshTokenResponseSchema>;
|
|
1406
|
+
export type OnboardingStatusResponse = z.infer<typeof onboardingStatusResponseSchema>;
|
|
1093
1407
|
//# sourceMappingURL=auth.schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/auth.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;GAEG;AAGH,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAGH,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"auth.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/auth.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;GAEG;AAGH,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAGH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;EAOjC,CAAC;AAGH,eAAO,MAAM,kCAAkC;;;;;;;;;EAG7C,CAAC;AAGH,eAAO,MAAM,kCAAkC;;;;;;;;;EAG7C,CAAC;AAGH,eAAO,MAAM,4BAA4B;;;;;;EAEvC,CAAC;AAGH,eAAO,MAAM,oCAAoC;;;;;;EAE/C,CAAC;AAGH,eAAO,MAAM,6BAA6B;;;;;;;;;EAKxC,CAAC;AAGH,eAAO,MAAM,8BAA8B;;;;;;;;;EAKzC,CAAC;AAGH,eAAO,MAAM,2BAA2B;;;;;;EAEtC,CAAC;AAGH,eAAO,MAAM,kCAAkC;;;;;;EAE7C,CAAC;AAGH,eA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MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACvD,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC/E,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -15,10 +15,12 @@ export const signupAttributesSchema = z.object({
|
|
|
15
15
|
password: z.string().min(8).regex(/[A-Z]/, 'Password must contain at least one uppercase letter')
|
|
16
16
|
.regex(/[a-z]/, 'Password must contain at least one lowercase letter')
|
|
17
17
|
.regex(/[0-9]/, 'Password must contain at least one number'),
|
|
18
|
+
phone: z.string().regex(/^\+?[1-9]\d{1,14}$/, 'Phone number must be in E.164 format').optional(),
|
|
18
19
|
});
|
|
19
20
|
// Google OAuth initiate attributes
|
|
20
21
|
export const googleAuthInitiateAttributesSchema = z.object({
|
|
21
22
|
redirectUri: z.string().url().optional(),
|
|
23
|
+
source: z.string().optional(),
|
|
22
24
|
});
|
|
23
25
|
// Google OAuth callback attributes
|
|
24
26
|
export const googleAuthCallbackAttributesSchema = z.object({
|
|
@@ -59,6 +61,23 @@ export const resendVerificationAttributesSchema = z.object({
|
|
|
59
61
|
export const logoutAttributesSchema = z.object({
|
|
60
62
|
refreshToken: z.string().optional(),
|
|
61
63
|
});
|
|
64
|
+
// Onboarding completion attributes
|
|
65
|
+
export const completeOnboardingAttributesSchema = z.object({
|
|
66
|
+
phone: z.string().regex(/^\+?[1-9]\d{1,14}$/, 'Phone number must be in E.164 format').optional(),
|
|
67
|
+
skipOnboarding: z.boolean().optional().default(false),
|
|
68
|
+
});
|
|
69
|
+
// Onboarding status attributes
|
|
70
|
+
export const onboardingStatusAttributesSchema = z.object({
|
|
71
|
+
onboardingCompleted: z.boolean(),
|
|
72
|
+
onboardingSkipped: z.boolean(),
|
|
73
|
+
emailVerified: z.boolean(),
|
|
74
|
+
hasPhone: z.boolean(),
|
|
75
|
+
hasFarm: z.boolean(),
|
|
76
|
+
hasActiveSubscription: z.boolean().optional(),
|
|
77
|
+
currentSubscriptionTier: z.string().nullable().optional(),
|
|
78
|
+
canUpgrade: z.boolean().optional(),
|
|
79
|
+
recommendedTier: z.string().nullable().optional(),
|
|
80
|
+
});
|
|
62
81
|
// JSON:API input schemas
|
|
63
82
|
export const loginSchema = z.object({
|
|
64
83
|
type: z.literal('auth'),
|
|
@@ -104,6 +123,10 @@ export const logoutSchema = z.object({
|
|
|
104
123
|
type: z.literal('auth'),
|
|
105
124
|
attributes: logoutAttributesSchema,
|
|
106
125
|
});
|
|
126
|
+
export const completeOnboardingSchema = z.object({
|
|
127
|
+
type: z.literal('onboarding'),
|
|
128
|
+
attributes: completeOnboardingAttributesSchema,
|
|
129
|
+
});
|
|
107
130
|
// User attributes schema (for auth responses)
|
|
108
131
|
export const authUserAttributesSchema = z.object({
|
|
109
132
|
name: z.string(),
|
|
@@ -154,3 +177,7 @@ export const refreshTokenResponseSchema = jsonApiSingleResponseSchema(refreshTok
|
|
|
154
177
|
export const passwordResetResponseSchema = jsonApiSuccessResponseSchema;
|
|
155
178
|
export const logoutResponseSchema = jsonApiSuccessResponseSchema;
|
|
156
179
|
export const emailVerificationResponseSchema = jsonApiSuccessResponseSchema;
|
|
180
|
+
// Onboarding status resource
|
|
181
|
+
export const onboardingStatusResourceSchema = createJsonApiResourceSchema('onboarding-status', onboardingStatusAttributesSchema);
|
|
182
|
+
// Onboarding status response
|
|
183
|
+
export const onboardingStatusResponseSchema = jsonApiSingleResponseSchema(onboardingStatusResourceSchema);
|