@deepintel-ltd/farmpro-contracts 1.0.1 → 1.0.3
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 +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +81 -0
- package/dist/routes/analytics.routes.d.ts +754 -0
- package/dist/routes/analytics.routes.d.ts.map +1 -0
- package/dist/routes/analytics.routes.js +24 -0
- package/dist/routes/auth.routes.d.ts +3836 -0
- package/dist/routes/auth.routes.d.ts.map +1 -0
- package/dist/routes/auth.routes.js +158 -0
- package/dist/routes/documents.routes.d.ts +2476 -0
- package/dist/routes/documents.routes.d.ts.map +1 -0
- package/dist/routes/documents.routes.js +100 -0
- package/dist/routes/equipment.routes.d.ts +3617 -0
- package/dist/routes/equipment.routes.d.ts.map +1 -0
- package/dist/routes/equipment.routes.js +118 -0
- package/dist/routes/farms.routes.d.ts +2202 -0
- package/dist/routes/farms.routes.d.ts.map +1 -0
- package/dist/routes/farms.routes.js +111 -0
- package/dist/routes/fields.routes.d.ts +3389 -0
- package/dist/routes/fields.routes.d.ts.map +1 -0
- package/dist/routes/fields.routes.js +95 -0
- package/dist/routes/finance.routes.d.ts +6855 -0
- package/dist/routes/finance.routes.d.ts.map +1 -0
- package/dist/routes/finance.routes.js +259 -0
- package/dist/routes/harvest.routes.d.ts +2337 -0
- package/dist/routes/harvest.routes.d.ts.map +1 -0
- package/dist/routes/harvest.routes.js +99 -0
- package/dist/routes/index.d.ts +68 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +43 -0
- package/dist/routes/inventory.routes.d.ts +2853 -0
- package/dist/routes/inventory.routes.d.ts.map +1 -0
- package/dist/routes/inventory.routes.js +121 -0
- package/dist/routes/soil-tests.routes.d.ts +3005 -0
- package/dist/routes/soil-tests.routes.d.ts.map +1 -0
- package/dist/routes/soil-tests.routes.js +98 -0
- package/dist/routes/suppliers.routes.d.ts +4190 -0
- package/dist/routes/suppliers.routes.d.ts.map +1 -0
- package/dist/routes/suppliers.routes.js +146 -0
- package/dist/routes/tasks.routes.d.ts +4192 -0
- package/dist/routes/tasks.routes.d.ts.map +1 -0
- package/dist/routes/tasks.routes.js +138 -0
- package/dist/routes/team.routes.d.ts +2210 -0
- package/dist/routes/team.routes.d.ts.map +1 -0
- package/dist/routes/team.routes.js +98 -0
- package/dist/routes/users.routes.d.ts +721 -0
- package/dist/routes/users.routes.d.ts.map +1 -0
- package/dist/routes/users.routes.js +35 -0
- package/dist/routes/weather.routes.d.ts +500 -0
- package/dist/routes/weather.routes.d.ts.map +1 -0
- package/dist/routes/weather.routes.js +23 -0
- package/dist/schemas/analytics.schemas.d.ts +1344 -0
- package/dist/schemas/analytics.schemas.d.ts.map +1 -0
- package/dist/schemas/analytics.schemas.js +73 -0
- package/dist/schemas/auth.schemas.d.ts +1093 -0
- package/dist/schemas/auth.schemas.d.ts.map +1 -0
- package/dist/schemas/auth.schemas.js +159 -0
- package/dist/schemas/common.schemas.d.ts +562 -0
- package/dist/schemas/common.schemas.d.ts.map +1 -0
- package/dist/schemas/common.schemas.js +122 -0
- package/dist/schemas/documents.schemas.d.ts +850 -0
- package/dist/schemas/documents.schemas.d.ts.map +1 -0
- package/dist/schemas/documents.schemas.js +75 -0
- package/dist/schemas/equipment.schemas.d.ts +1618 -0
- package/dist/schemas/equipment.schemas.d.ts.map +1 -0
- package/dist/schemas/equipment.schemas.js +125 -0
- package/dist/schemas/farms.schemas.d.ts +1171 -0
- package/dist/schemas/farms.schemas.d.ts.map +1 -0
- package/dist/schemas/farms.schemas.js +62 -0
- package/dist/schemas/fields.schemas.d.ts +2508 -0
- package/dist/schemas/fields.schemas.d.ts.map +1 -0
- package/dist/schemas/fields.schemas.js +125 -0
- package/dist/schemas/finance.schemas.d.ts +2869 -0
- package/dist/schemas/finance.schemas.d.ts.map +1 -0
- package/dist/schemas/finance.schemas.js +196 -0
- package/dist/schemas/harvest.schemas.d.ts +1051 -0
- package/dist/schemas/harvest.schemas.d.ts.map +1 -0
- package/dist/schemas/harvest.schemas.js +71 -0
- package/dist/schemas/inventory.schemas.d.ts +1138 -0
- package/dist/schemas/inventory.schemas.d.ts.map +1 -0
- package/dist/schemas/inventory.schemas.js +89 -0
- package/dist/schemas/soil-tests.schemas.d.ts +1885 -0
- package/dist/schemas/soil-tests.schemas.d.ts.map +1 -0
- package/dist/schemas/soil-tests.schemas.js +102 -0
- package/dist/schemas/suppliers.schemas.d.ts +1774 -0
- package/dist/schemas/suppliers.schemas.d.ts.map +1 -0
- package/dist/schemas/suppliers.schemas.js +121 -0
- package/dist/schemas/tasks.schemas.d.ts +1761 -0
- package/dist/schemas/tasks.schemas.d.ts.map +1 -0
- package/dist/schemas/tasks.schemas.js +121 -0
- package/dist/schemas/team.schemas.d.ts +583 -0
- package/dist/schemas/team.schemas.d.ts.map +1 -0
- package/dist/schemas/team.schemas.js +60 -0
- package/dist/schemas/users.schemas.d.ts +288 -0
- package/dist/schemas/users.schemas.d.ts.map +1 -0
- package/dist/schemas/users.schemas.js +32 -0
- package/dist/schemas/weather.schemas.d.ts +682 -0
- package/dist/schemas/weather.schemas.d.ts.map +1 -0
- package/dist/schemas/weather.schemas.js +49 -0
- package/package.json +1 -1
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* User profile schemas - JSON:API compliant
|
|
4
|
+
*/
|
|
5
|
+
export declare const userAttributesSchema: z.ZodObject<{
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
email: z.ZodString;
|
|
8
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
9
|
+
emailVerified: z.ZodBoolean;
|
|
10
|
+
avatar: z.ZodNullable<z.ZodString>;
|
|
11
|
+
} & {
|
|
12
|
+
createdAt: z.ZodString;
|
|
13
|
+
updatedAt: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
email: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
name: string;
|
|
19
|
+
phone: string | null;
|
|
20
|
+
emailVerified: boolean;
|
|
21
|
+
avatar: string | null;
|
|
22
|
+
}, {
|
|
23
|
+
email: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
name: string;
|
|
27
|
+
phone: string | null;
|
|
28
|
+
emailVerified: boolean;
|
|
29
|
+
avatar: string | null;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const updateUserAttributesSchema: z.ZodObject<{
|
|
32
|
+
name: z.ZodOptional<z.ZodString>;
|
|
33
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
34
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
name?: string | undefined;
|
|
37
|
+
phone?: string | undefined;
|
|
38
|
+
avatar?: string | null | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
name?: string | undefined;
|
|
41
|
+
phone?: string | undefined;
|
|
42
|
+
avatar?: string | null | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const updateProfileSchema: z.ZodObject<{
|
|
45
|
+
type: z.ZodLiteral<"users">;
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
attributes: z.ZodObject<{
|
|
48
|
+
name: z.ZodOptional<z.ZodString>;
|
|
49
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
50
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
name?: string | undefined;
|
|
53
|
+
phone?: string | undefined;
|
|
54
|
+
avatar?: string | null | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
name?: string | undefined;
|
|
57
|
+
phone?: string | undefined;
|
|
58
|
+
avatar?: string | null | undefined;
|
|
59
|
+
}>;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
type: "users";
|
|
62
|
+
id: string;
|
|
63
|
+
attributes: {
|
|
64
|
+
name?: string | undefined;
|
|
65
|
+
phone?: string | undefined;
|
|
66
|
+
avatar?: string | null | undefined;
|
|
67
|
+
};
|
|
68
|
+
}, {
|
|
69
|
+
type: "users";
|
|
70
|
+
id: string;
|
|
71
|
+
attributes: {
|
|
72
|
+
name?: string | undefined;
|
|
73
|
+
phone?: string | undefined;
|
|
74
|
+
avatar?: string | null | undefined;
|
|
75
|
+
};
|
|
76
|
+
}>;
|
|
77
|
+
export declare const userResourceSchema: z.ZodObject<{
|
|
78
|
+
type: z.ZodLiteral<string>;
|
|
79
|
+
id: z.ZodString;
|
|
80
|
+
attributes: z.ZodObject<{
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
email: z.ZodString;
|
|
83
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
84
|
+
emailVerified: z.ZodBoolean;
|
|
85
|
+
avatar: z.ZodNullable<z.ZodString>;
|
|
86
|
+
} & {
|
|
87
|
+
createdAt: z.ZodString;
|
|
88
|
+
updatedAt: z.ZodString;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
email: string;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
updatedAt: string;
|
|
93
|
+
name: string;
|
|
94
|
+
phone: string | null;
|
|
95
|
+
emailVerified: boolean;
|
|
96
|
+
avatar: string | null;
|
|
97
|
+
}, {
|
|
98
|
+
email: string;
|
|
99
|
+
createdAt: string;
|
|
100
|
+
updatedAt: string;
|
|
101
|
+
name: string;
|
|
102
|
+
phone: string | null;
|
|
103
|
+
emailVerified: boolean;
|
|
104
|
+
avatar: string | null;
|
|
105
|
+
}>;
|
|
106
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
107
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
108
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
type: string;
|
|
111
|
+
id: string;
|
|
112
|
+
attributes: {
|
|
113
|
+
email: string;
|
|
114
|
+
createdAt: string;
|
|
115
|
+
updatedAt: string;
|
|
116
|
+
name: string;
|
|
117
|
+
phone: string | null;
|
|
118
|
+
emailVerified: boolean;
|
|
119
|
+
avatar: string | null;
|
|
120
|
+
};
|
|
121
|
+
relationships?: Record<string, unknown> | undefined;
|
|
122
|
+
links?: Record<string, string> | undefined;
|
|
123
|
+
meta?: Record<string, unknown> | undefined;
|
|
124
|
+
}, {
|
|
125
|
+
type: string;
|
|
126
|
+
id: string;
|
|
127
|
+
attributes: {
|
|
128
|
+
email: string;
|
|
129
|
+
createdAt: string;
|
|
130
|
+
updatedAt: string;
|
|
131
|
+
name: string;
|
|
132
|
+
phone: string | null;
|
|
133
|
+
emailVerified: boolean;
|
|
134
|
+
avatar: string | null;
|
|
135
|
+
};
|
|
136
|
+
relationships?: Record<string, unknown> | undefined;
|
|
137
|
+
links?: Record<string, string> | undefined;
|
|
138
|
+
meta?: Record<string, unknown> | undefined;
|
|
139
|
+
}>;
|
|
140
|
+
export declare const userResponseSchema: z.ZodObject<{
|
|
141
|
+
data: z.ZodObject<{
|
|
142
|
+
type: z.ZodLiteral<string>;
|
|
143
|
+
id: z.ZodString;
|
|
144
|
+
attributes: z.ZodObject<{
|
|
145
|
+
name: z.ZodString;
|
|
146
|
+
email: z.ZodString;
|
|
147
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
148
|
+
emailVerified: z.ZodBoolean;
|
|
149
|
+
avatar: z.ZodNullable<z.ZodString>;
|
|
150
|
+
} & {
|
|
151
|
+
createdAt: z.ZodString;
|
|
152
|
+
updatedAt: z.ZodString;
|
|
153
|
+
}, "strip", z.ZodTypeAny, {
|
|
154
|
+
email: string;
|
|
155
|
+
createdAt: string;
|
|
156
|
+
updatedAt: string;
|
|
157
|
+
name: string;
|
|
158
|
+
phone: string | null;
|
|
159
|
+
emailVerified: boolean;
|
|
160
|
+
avatar: string | null;
|
|
161
|
+
}, {
|
|
162
|
+
email: string;
|
|
163
|
+
createdAt: string;
|
|
164
|
+
updatedAt: string;
|
|
165
|
+
name: string;
|
|
166
|
+
phone: string | null;
|
|
167
|
+
emailVerified: boolean;
|
|
168
|
+
avatar: string | null;
|
|
169
|
+
}>;
|
|
170
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
171
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
172
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
type: string;
|
|
175
|
+
id: string;
|
|
176
|
+
attributes: {
|
|
177
|
+
email: string;
|
|
178
|
+
createdAt: string;
|
|
179
|
+
updatedAt: string;
|
|
180
|
+
name: string;
|
|
181
|
+
phone: string | null;
|
|
182
|
+
emailVerified: boolean;
|
|
183
|
+
avatar: string | null;
|
|
184
|
+
};
|
|
185
|
+
relationships?: Record<string, unknown> | undefined;
|
|
186
|
+
links?: Record<string, string> | undefined;
|
|
187
|
+
meta?: Record<string, unknown> | undefined;
|
|
188
|
+
}, {
|
|
189
|
+
type: string;
|
|
190
|
+
id: string;
|
|
191
|
+
attributes: {
|
|
192
|
+
email: string;
|
|
193
|
+
createdAt: string;
|
|
194
|
+
updatedAt: string;
|
|
195
|
+
name: string;
|
|
196
|
+
phone: string | null;
|
|
197
|
+
emailVerified: boolean;
|
|
198
|
+
avatar: string | null;
|
|
199
|
+
};
|
|
200
|
+
relationships?: Record<string, unknown> | undefined;
|
|
201
|
+
links?: Record<string, string> | undefined;
|
|
202
|
+
meta?: Record<string, unknown> | undefined;
|
|
203
|
+
}>;
|
|
204
|
+
included: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
205
|
+
type: z.ZodString;
|
|
206
|
+
id: z.ZodString;
|
|
207
|
+
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
208
|
+
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
209
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
210
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
211
|
+
}, "strip", z.ZodTypeAny, {
|
|
212
|
+
type: string;
|
|
213
|
+
id: string;
|
|
214
|
+
attributes?: Record<string, unknown> | undefined;
|
|
215
|
+
relationships?: Record<string, unknown> | undefined;
|
|
216
|
+
links?: Record<string, string> | undefined;
|
|
217
|
+
meta?: Record<string, unknown> | undefined;
|
|
218
|
+
}, {
|
|
219
|
+
type: string;
|
|
220
|
+
id: string;
|
|
221
|
+
attributes?: Record<string, unknown> | undefined;
|
|
222
|
+
relationships?: Record<string, unknown> | undefined;
|
|
223
|
+
links?: Record<string, string> | undefined;
|
|
224
|
+
meta?: Record<string, unknown> | undefined;
|
|
225
|
+
}>, "many">>;
|
|
226
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
227
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
228
|
+
}, "strip", z.ZodTypeAny, {
|
|
229
|
+
data: {
|
|
230
|
+
type: string;
|
|
231
|
+
id: string;
|
|
232
|
+
attributes: {
|
|
233
|
+
email: string;
|
|
234
|
+
createdAt: string;
|
|
235
|
+
updatedAt: string;
|
|
236
|
+
name: string;
|
|
237
|
+
phone: string | null;
|
|
238
|
+
emailVerified: boolean;
|
|
239
|
+
avatar: string | null;
|
|
240
|
+
};
|
|
241
|
+
relationships?: Record<string, unknown> | undefined;
|
|
242
|
+
links?: Record<string, string> | undefined;
|
|
243
|
+
meta?: Record<string, unknown> | undefined;
|
|
244
|
+
};
|
|
245
|
+
links?: Record<string, string> | undefined;
|
|
246
|
+
meta?: Record<string, unknown> | undefined;
|
|
247
|
+
included?: {
|
|
248
|
+
type: string;
|
|
249
|
+
id: string;
|
|
250
|
+
attributes?: Record<string, unknown> | undefined;
|
|
251
|
+
relationships?: Record<string, unknown> | undefined;
|
|
252
|
+
links?: Record<string, string> | undefined;
|
|
253
|
+
meta?: Record<string, unknown> | undefined;
|
|
254
|
+
}[] | undefined;
|
|
255
|
+
}, {
|
|
256
|
+
data: {
|
|
257
|
+
type: string;
|
|
258
|
+
id: string;
|
|
259
|
+
attributes: {
|
|
260
|
+
email: string;
|
|
261
|
+
createdAt: string;
|
|
262
|
+
updatedAt: string;
|
|
263
|
+
name: string;
|
|
264
|
+
phone: string | null;
|
|
265
|
+
emailVerified: boolean;
|
|
266
|
+
avatar: string | null;
|
|
267
|
+
};
|
|
268
|
+
relationships?: Record<string, unknown> | undefined;
|
|
269
|
+
links?: Record<string, string> | undefined;
|
|
270
|
+
meta?: Record<string, unknown> | undefined;
|
|
271
|
+
};
|
|
272
|
+
links?: Record<string, string> | undefined;
|
|
273
|
+
meta?: Record<string, unknown> | undefined;
|
|
274
|
+
included?: {
|
|
275
|
+
type: string;
|
|
276
|
+
id: string;
|
|
277
|
+
attributes?: Record<string, unknown> | undefined;
|
|
278
|
+
relationships?: Record<string, unknown> | undefined;
|
|
279
|
+
links?: Record<string, string> | undefined;
|
|
280
|
+
meta?: Record<string, unknown> | undefined;
|
|
281
|
+
}[] | undefined;
|
|
282
|
+
}>;
|
|
283
|
+
export type UserAttributes = z.infer<typeof userAttributesSchema>;
|
|
284
|
+
export type UpdateUserAttributes = z.infer<typeof updateUserAttributesSchema>;
|
|
285
|
+
export type UpdateProfileInput = z.infer<typeof updateProfileSchema>;
|
|
286
|
+
export type UserResource = z.infer<typeof userResourceSchema>;
|
|
287
|
+
export type UserResponse = z.infer<typeof userResponseSchema>;
|
|
288
|
+
//# sourceMappingURL=users.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/users.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;GAEG;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;EAMP,CAAC;AAG3B,eAAO,MAAM,0BAA0B;;;;;;;;;;;;EAIrC,CAAC;AAGH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI9B,CAAC;AAGH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA6D,CAAC;AAG7F,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAkD,CAAC;AAGlF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.userResponseSchema = exports.userResourceSchema = exports.updateProfileSchema = exports.updateUserAttributesSchema = exports.userAttributesSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_schemas_1 = require("./common.schemas");
|
|
6
|
+
/**
|
|
7
|
+
* User profile schemas - JSON:API compliant
|
|
8
|
+
*/
|
|
9
|
+
// User attributes schema
|
|
10
|
+
exports.userAttributesSchema = zod_1.z.object({
|
|
11
|
+
name: zod_1.z.string(),
|
|
12
|
+
email: zod_1.z.string().email(),
|
|
13
|
+
phone: zod_1.z.string().nullable(),
|
|
14
|
+
emailVerified: zod_1.z.boolean(),
|
|
15
|
+
avatar: zod_1.z.string().url().nullable(),
|
|
16
|
+
}).merge(common_schemas_1.timestampsSchema);
|
|
17
|
+
// Update user profile attributes
|
|
18
|
+
exports.updateUserAttributesSchema = zod_1.z.object({
|
|
19
|
+
name: zod_1.z.string().min(1).max(200).optional(),
|
|
20
|
+
phone: zod_1.z.string().optional(),
|
|
21
|
+
avatar: zod_1.z.string().url().nullable().optional(),
|
|
22
|
+
});
|
|
23
|
+
// Update user profile input (JSON:API format)
|
|
24
|
+
exports.updateProfileSchema = zod_1.z.object({
|
|
25
|
+
type: zod_1.z.literal('users'),
|
|
26
|
+
id: zod_1.z.string().uuid(),
|
|
27
|
+
attributes: exports.updateUserAttributesSchema,
|
|
28
|
+
});
|
|
29
|
+
// User resource (JSON:API)
|
|
30
|
+
exports.userResourceSchema = (0, common_schemas_1.createJsonApiResourceSchema)('users', exports.userAttributesSchema);
|
|
31
|
+
// User response (JSON:API format)
|
|
32
|
+
exports.userResponseSchema = (0, common_schemas_1.jsonApiSingleResponseSchema)(exports.userResourceSchema);
|