@softruck/api-contracts 0.1.1-beta.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/README.md +0 -0
- package/dist/alerts/api.d.ts +9 -0
- package/dist/alerts/api.js +8 -0
- package/dist/alerts/index.d.ts +3 -0
- package/dist/alerts/index.js +3 -0
- package/dist/alerts/schemas.d.ts +65 -0
- package/dist/alerts/schemas.js +29 -0
- package/dist/alerts/types.d.ts +36 -0
- package/dist/alerts/types.js +1 -0
- package/dist/auth/api.d.ts +26 -0
- package/dist/auth/api.js +39 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.js +3 -0
- package/dist/auth/schemas/access-codes.d.ts +16 -0
- package/dist/auth/schemas/access-codes.js +13 -0
- package/dist/auth/schemas/login.d.ts +13 -0
- package/dist/auth/schemas/login.js +9 -0
- package/dist/auth/schemas/passwords.d.ts +81 -0
- package/dist/auth/schemas/passwords.js +28 -0
- package/dist/auth/schemas/sessions.d.ts +3 -0
- package/dist/auth/schemas/sessions.js +2 -0
- package/dist/auth/schemas/tokens.d.ts +11 -0
- package/dist/auth/schemas/tokens.js +9 -0
- package/dist/auth/schemas.d.ts +5 -0
- package/dist/auth/schemas.js +5 -0
- package/dist/auth/types.d.ts +1 -0
- package/dist/auth/types.js +1 -0
- package/dist/checklist/api.d.ts +30 -0
- package/dist/checklist/api.js +15 -0
- package/dist/checklist/index.d.ts +3 -0
- package/dist/checklist/index.js +3 -0
- package/dist/checklist/schemas.d.ts +62 -0
- package/dist/checklist/schemas.js +46 -0
- package/dist/checklist/types.d.ts +76 -0
- package/dist/checklist/types.js +1 -0
- package/dist/chips/api.d.ts +17 -0
- package/dist/chips/api.js +8 -0
- package/dist/chips/connections/api.d.ts +13 -0
- package/dist/chips/connections/api.js +4 -0
- package/dist/chips/connections/index.d.ts +3 -0
- package/dist/chips/connections/index.js +3 -0
- package/dist/chips/connections/schemas.d.ts +31 -0
- package/dist/chips/connections/schemas.js +31 -0
- package/dist/chips/connections/types.d.ts +26 -0
- package/dist/chips/connections/types.js +1 -0
- package/dist/chips/index.d.ts +5 -0
- package/dist/chips/index.js +5 -0
- package/dist/chips/requirements/api.d.ts +13 -0
- package/dist/chips/requirements/api.js +4 -0
- package/dist/chips/requirements/index.d.ts +3 -0
- package/dist/chips/requirements/index.js +3 -0
- package/dist/chips/requirements/schemas.d.ts +21 -0
- package/dist/chips/requirements/schemas.js +21 -0
- package/dist/chips/requirements/types.d.ts +16 -0
- package/dist/chips/requirements/types.js +1 -0
- package/dist/chips/schemas.d.ts +78 -0
- package/dist/chips/schemas.js +72 -0
- package/dist/chips/types.d.ts +76 -0
- package/dist/chips/types.js +1 -0
- package/dist/core/client.d.ts +45 -0
- package/dist/core/client.js +42 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +4 -0
- package/dist/core/query-builder.d.ts +34 -0
- package/dist/core/query-builder.js +86 -0
- package/dist/core/schemas.d.ts +80 -0
- package/dist/core/schemas.js +31 -0
- package/dist/core/types.d.ts +119 -0
- package/dist/core/types.js +2 -0
- package/dist/devices/activations/api.d.ts +20 -0
- package/dist/devices/activations/api.js +9 -0
- package/dist/devices/activations/index.d.ts +3 -0
- package/dist/devices/activations/index.js +3 -0
- package/dist/devices/activations/schemas.d.ts +42 -0
- package/dist/devices/activations/schemas.js +42 -0
- package/dist/devices/activations/types.d.ts +75 -0
- package/dist/devices/activations/types.js +1 -0
- package/dist/devices/api.d.ts +28 -0
- package/dist/devices/api.js +11 -0
- package/dist/devices/commands/api.d.ts +17 -0
- package/dist/devices/commands/api.js +8 -0
- package/dist/devices/commands/index.d.ts +3 -0
- package/dist/devices/commands/index.js +3 -0
- package/dist/devices/commands/schemas.d.ts +39 -0
- package/dist/devices/commands/schemas.js +33 -0
- package/dist/devices/commands/types.d.ts +58 -0
- package/dist/devices/commands/types.js +1 -0
- package/dist/devices/index.d.ts +5 -0
- package/dist/devices/index.js +5 -0
- package/dist/devices/schemas.d.ts +115 -0
- package/dist/devices/schemas.js +96 -0
- package/dist/devices/types.d.ts +142 -0
- package/dist/devices/types.js +1 -0
- package/dist/enterprises/api.d.ts +27 -0
- package/dist/enterprises/api.js +15 -0
- package/dist/enterprises/index.d.ts +3 -0
- package/dist/enterprises/index.js +3 -0
- package/dist/enterprises/schemas.d.ts +59 -0
- package/dist/enterprises/schemas.js +53 -0
- package/dist/enterprises/types.d.ts +160 -0
- package/dist/enterprises/types.js +1 -0
- package/dist/events/api.d.ts +18 -0
- package/dist/events/api.js +13 -0
- package/dist/events/index.d.ts +3 -0
- package/dist/events/index.js +3 -0
- package/dist/events/schemas.d.ts +262 -0
- package/dist/events/schemas.js +54 -0
- package/dist/events/types.d.ts +130 -0
- package/dist/events/types.js +1 -0
- package/dist/exports/api.d.ts +18 -0
- package/dist/exports/api.js +9 -0
- package/dist/exports/index.d.ts +3 -0
- package/dist/exports/index.js +3 -0
- package/dist/exports/schemas.d.ts +27 -0
- package/dist/exports/schemas.js +22 -0
- package/dist/exports/types.d.ts +47 -0
- package/dist/exports/types.js +1 -0
- package/dist/fuelings/api.d.ts +22 -0
- package/dist/fuelings/api.js +9 -0
- package/dist/fuelings/index.d.ts +3 -0
- package/dist/fuelings/index.js +3 -0
- package/dist/fuelings/schemas.d.ts +84 -0
- package/dist/fuelings/schemas.js +52 -0
- package/dist/fuelings/types.d.ts +80 -0
- package/dist/fuelings/types.js +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +22 -0
- package/dist/maintenances/api.d.ts +31 -0
- package/dist/maintenances/api.js +12 -0
- package/dist/maintenances/index.d.ts +3 -0
- package/dist/maintenances/index.js +3 -0
- package/dist/maintenances/schemas.d.ts +74 -0
- package/dist/maintenances/schemas.js +44 -0
- package/dist/maintenances/types.d.ts +69 -0
- package/dist/maintenances/types.js +1 -0
- package/dist/operation-logs/api.d.ts +13 -0
- package/dist/operation-logs/api.js +10 -0
- package/dist/operation-logs/index.d.ts +3 -0
- package/dist/operation-logs/index.js +3 -0
- package/dist/operation-logs/schemas.d.ts +34 -0
- package/dist/operation-logs/schemas.js +22 -0
- package/dist/operation-logs/types.d.ts +32 -0
- package/dist/operation-logs/types.js +1 -0
- package/dist/protocols/api.d.ts +34 -0
- package/dist/protocols/api.js +13 -0
- package/dist/protocols/index.d.ts +3 -0
- package/dist/protocols/index.js +3 -0
- package/dist/protocols/schemas.d.ts +66 -0
- package/dist/protocols/schemas.js +36 -0
- package/dist/protocols/types.d.ts +99 -0
- package/dist/protocols/types.js +1 -0
- package/dist/service-orders/api.d.ts +38 -0
- package/dist/service-orders/api.js +14 -0
- package/dist/service-orders/index.d.ts +3 -0
- package/dist/service-orders/index.js +3 -0
- package/dist/service-orders/schemas.d.ts +82 -0
- package/dist/service-orders/schemas.js +47 -0
- package/dist/service-orders/types.d.ts +84 -0
- package/dist/service-orders/types.js +1 -0
- package/dist/sharings/api.d.ts +17 -0
- package/dist/sharings/api.js +8 -0
- package/dist/sharings/index.d.ts +3 -0
- package/dist/sharings/index.js +3 -0
- package/dist/sharings/schemas.d.ts +47 -0
- package/dist/sharings/schemas.js +36 -0
- package/dist/sharings/types.d.ts +54 -0
- package/dist/sharings/types.js +1 -0
- package/dist/surveys/api.d.ts +2 -0
- package/dist/surveys/api.js +3 -0
- package/dist/surveys/index.d.ts +3 -0
- package/dist/surveys/index.js +3 -0
- package/dist/surveys/schemas.d.ts +33 -0
- package/dist/surveys/schemas.js +23 -0
- package/dist/surveys/types.d.ts +27 -0
- package/dist/surveys/types.js +1 -0
- package/dist/tags/api.d.ts +24 -0
- package/dist/tags/api.js +28 -0
- package/dist/tags/index.d.ts +3 -0
- package/dist/tags/index.js +3 -0
- package/dist/tags/schemas.d.ts +26 -0
- package/dist/tags/schemas.js +19 -0
- package/dist/tags/types.d.ts +16 -0
- package/dist/tags/types.js +1 -0
- package/dist/tracking/api.d.ts +2 -0
- package/dist/tracking/api.js +3 -0
- package/dist/tracking/index.d.ts +3 -0
- package/dist/tracking/index.js +3 -0
- package/dist/tracking/schemas.d.ts +12 -0
- package/dist/tracking/schemas.js +12 -0
- package/dist/tracking/types.d.ts +11 -0
- package/dist/tracking/types.js +1 -0
- package/dist/trajectories/api.d.ts +27 -0
- package/dist/trajectories/api.js +13 -0
- package/dist/trajectories/index.d.ts +3 -0
- package/dist/trajectories/index.js +3 -0
- package/dist/trajectories/schemas.d.ts +39 -0
- package/dist/trajectories/schemas.js +30 -0
- package/dist/trajectories/types.d.ts +58 -0
- package/dist/trajectories/types.js +1 -0
- package/dist/trips/api.d.ts +30 -0
- package/dist/trips/api.js +12 -0
- package/dist/trips/index.d.ts +3 -0
- package/dist/trips/index.js +3 -0
- package/dist/trips/schemas.d.ts +62 -0
- package/dist/trips/schemas.js +36 -0
- package/dist/trips/types.d.ts +65 -0
- package/dist/trips/types.js +1 -0
- package/dist/users/api.d.ts +533 -0
- package/dist/users/api.js +102 -0
- package/dist/users/configuration/api.d.ts +21 -0
- package/dist/users/configuration/api.js +16 -0
- package/dist/users/configuration/index.d.ts +3 -0
- package/dist/users/configuration/index.js +3 -0
- package/dist/users/configuration/schemas.d.ts +91 -0
- package/dist/users/configuration/schemas.js +42 -0
- package/dist/users/configuration/types.d.ts +36 -0
- package/dist/users/configuration/types.js +1 -0
- package/dist/users/index.d.ts +4 -0
- package/dist/users/index.js +4 -0
- package/dist/users/schemas/addresses.d.ts +136 -0
- package/dist/users/schemas/addresses.js +94 -0
- package/dist/users/schemas/authenticated-user.d.ts +30 -0
- package/dist/users/schemas/authenticated-user.js +21 -0
- package/dist/users/schemas/common.d.ts +28 -0
- package/dist/users/schemas/common.js +26 -0
- package/dist/users/schemas/documents.d.ts +40 -0
- package/dist/users/schemas/documents.js +53 -0
- package/dist/users/schemas/passwords.d.ts +10 -0
- package/dist/users/schemas/passwords.js +15 -0
- package/dist/users/schemas/roles.d.ts +60 -0
- package/dist/users/schemas/roles.js +9 -0
- package/dist/users/schemas/sessions.d.ts +84 -0
- package/dist/users/schemas/sessions.js +55 -0
- package/dist/users/schemas/usernames.d.ts +14 -0
- package/dist/users/schemas/usernames.js +12 -0
- package/dist/users/schemas/users.d.ts +648 -0
- package/dist/users/schemas/users.js +243 -0
- package/dist/users/schemas.d.ts +8 -0
- package/dist/users/schemas.js +8 -0
- package/dist/users/types.d.ts +1 -0
- package/dist/users/types.js +1 -0
- package/dist/vehicles/api.d.ts +28 -0
- package/dist/vehicles/api.js +13 -0
- package/dist/vehicles/index.d.ts +3 -0
- package/dist/vehicles/index.js +3 -0
- package/dist/vehicles/schemas.d.ts +88 -0
- package/dist/vehicles/schemas.js +71 -0
- package/dist/vehicles/types.d.ts +142 -0
- package/dist/vehicles/types.js +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AlertTypeSchema: z.ZodEnum<{
|
|
3
|
+
BATTERY_DISCONNECTED: "BATTERY_DISCONNECTED";
|
|
4
|
+
SPEED_OVER: "SPEED_OVER";
|
|
5
|
+
PANIC_BUTTON: "PANIC_BUTTON";
|
|
6
|
+
JAMMING_DETECTED: "JAMMING_DETECTED";
|
|
7
|
+
GEOFENCE_ENTER: "GEOFENCE_ENTER";
|
|
8
|
+
GEOFENCE_EXIT: "GEOFENCE_EXIT";
|
|
9
|
+
TOW_TRIGGER: "TOW_TRIGGER";
|
|
10
|
+
PARK_WATCHER: "PARK_WATCHER";
|
|
11
|
+
}>;
|
|
12
|
+
export declare const AlertRecipientSchema: z.ZodEnum<{
|
|
13
|
+
responsibles: "responsibles";
|
|
14
|
+
admin: "admin";
|
|
15
|
+
}>;
|
|
16
|
+
export declare const SubscriptionPlatformSchema: z.ZodEnum<{
|
|
17
|
+
FCM: "FCM";
|
|
18
|
+
APNS: "APNS";
|
|
19
|
+
WEBHOOK: "WEBHOOK";
|
|
20
|
+
}>;
|
|
21
|
+
export declare const VehicleAlertTypeSchema: z.ZodEnum<{
|
|
22
|
+
IGN: "IGN";
|
|
23
|
+
MOV: "MOV";
|
|
24
|
+
GEO: "GEO";
|
|
25
|
+
RISK: "RISK";
|
|
26
|
+
}>;
|
|
27
|
+
export declare const AlertConfigItemSchema: z.ZodObject<{
|
|
28
|
+
type: z.ZodEnum<{
|
|
29
|
+
BATTERY_DISCONNECTED: "BATTERY_DISCONNECTED";
|
|
30
|
+
SPEED_OVER: "SPEED_OVER";
|
|
31
|
+
PANIC_BUTTON: "PANIC_BUTTON";
|
|
32
|
+
JAMMING_DETECTED: "JAMMING_DETECTED";
|
|
33
|
+
GEOFENCE_ENTER: "GEOFENCE_ENTER";
|
|
34
|
+
GEOFENCE_EXIT: "GEOFENCE_EXIT";
|
|
35
|
+
TOW_TRIGGER: "TOW_TRIGGER";
|
|
36
|
+
PARK_WATCHER: "PARK_WATCHER";
|
|
37
|
+
}>;
|
|
38
|
+
enabled: z.ZodBoolean;
|
|
39
|
+
recipients: z.ZodArray<z.ZodEnum<{
|
|
40
|
+
responsibles: "responsibles";
|
|
41
|
+
admin: "admin";
|
|
42
|
+
}>>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export declare const AlertConfigDataSchema: z.ZodObject<{
|
|
45
|
+
data: z.ZodArray<z.ZodObject<{
|
|
46
|
+
type: z.ZodEnum<{
|
|
47
|
+
BATTERY_DISCONNECTED: "BATTERY_DISCONNECTED";
|
|
48
|
+
SPEED_OVER: "SPEED_OVER";
|
|
49
|
+
PANIC_BUTTON: "PANIC_BUTTON";
|
|
50
|
+
JAMMING_DETECTED: "JAMMING_DETECTED";
|
|
51
|
+
GEOFENCE_ENTER: "GEOFENCE_ENTER";
|
|
52
|
+
GEOFENCE_EXIT: "GEOFENCE_EXIT";
|
|
53
|
+
TOW_TRIGGER: "TOW_TRIGGER";
|
|
54
|
+
PARK_WATCHER: "PARK_WATCHER";
|
|
55
|
+
}>;
|
|
56
|
+
enabled: z.ZodBoolean;
|
|
57
|
+
recipients: z.ZodArray<z.ZodEnum<{
|
|
58
|
+
responsibles: "responsibles";
|
|
59
|
+
admin: "admin";
|
|
60
|
+
}>>;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export declare const CreateSubscriptionPayloadSchema: z.ZodObject<{
|
|
64
|
+
token: z.ZodString;
|
|
65
|
+
name: z.ZodString;
|
|
66
|
+
locale: z.ZodString;
|
|
67
|
+
timezone: z.ZodString;
|
|
68
|
+
platform: z.ZodEnum<{
|
|
69
|
+
FCM: "FCM";
|
|
70
|
+
APNS: "APNS";
|
|
71
|
+
WEBHOOK: "WEBHOOK";
|
|
72
|
+
}>;
|
|
73
|
+
shortname: z.ZodString;
|
|
74
|
+
url: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export declare const ConfigureAlertsPayloadSchema: z.ZodObject<{
|
|
77
|
+
dtk: z.ZodString;
|
|
78
|
+
config: z.ZodArray<z.ZodObject<{
|
|
79
|
+
type: z.ZodString;
|
|
80
|
+
enabled: z.ZodBoolean;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
export declare const CreateVehicleSubscriptionPayloadSchema: z.ZodObject<{
|
|
84
|
+
alert: z.ZodEnum<{
|
|
85
|
+
IGN: "IGN";
|
|
86
|
+
MOV: "MOV";
|
|
87
|
+
GEO: "GEO";
|
|
88
|
+
RISK: "RISK";
|
|
89
|
+
}>;
|
|
90
|
+
geofence_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
91
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const AlertTypeSchema = z.enum([
|
|
3
|
+
'BATTERY_DISCONNECTED',
|
|
4
|
+
'SPEED_OVER',
|
|
5
|
+
'PANIC_BUTTON',
|
|
6
|
+
'JAMMING_DETECTED',
|
|
7
|
+
'GEOFENCE_ENTER',
|
|
8
|
+
'GEOFENCE_EXIT',
|
|
9
|
+
'TOW_TRIGGER',
|
|
10
|
+
'PARK_WATCHER',
|
|
11
|
+
]);
|
|
12
|
+
export const AlertRecipientSchema = z.enum(['responsibles', 'admin']);
|
|
13
|
+
export const SubscriptionPlatformSchema = z.enum(['FCM', 'APNS', 'WEBHOOK']);
|
|
14
|
+
export const VehicleAlertTypeSchema = z.enum(['IGN', 'MOV', 'GEO', 'RISK']);
|
|
15
|
+
export const AlertConfigItemSchema = z.object({
|
|
16
|
+
type: AlertTypeSchema,
|
|
17
|
+
enabled: z.boolean(),
|
|
18
|
+
recipients: z.array(AlertRecipientSchema),
|
|
19
|
+
});
|
|
20
|
+
export const AlertConfigDataSchema = z.object({
|
|
21
|
+
data: z.array(AlertConfigItemSchema),
|
|
22
|
+
});
|
|
23
|
+
export const CreateSubscriptionPayloadSchema = z.object({
|
|
24
|
+
token: z.string().min(1),
|
|
25
|
+
name: z.string().min(1),
|
|
26
|
+
locale: z.string().min(1),
|
|
27
|
+
timezone: z.string().min(1),
|
|
28
|
+
platform: SubscriptionPlatformSchema,
|
|
29
|
+
shortname: z.string().min(1),
|
|
30
|
+
url: z.string().url().optional(),
|
|
31
|
+
});
|
|
32
|
+
export const ConfigureAlertsPayloadSchema = z.object({
|
|
33
|
+
dtk: z.string().min(1),
|
|
34
|
+
config: z.array(z.object({
|
|
35
|
+
type: z.string(),
|
|
36
|
+
enabled: z.boolean(),
|
|
37
|
+
})),
|
|
38
|
+
});
|
|
39
|
+
export const CreateVehicleSubscriptionPayloadSchema = z.object({
|
|
40
|
+
alert: VehicleAlertTypeSchema,
|
|
41
|
+
geofence_ids: z.array(z.string()).optional(),
|
|
42
|
+
}).refine((data) => data.alert !== 'GEO' || (data.geofence_ids && data.geofence_ids.length > 0), { message: 'geofence_ids required for GEO alert type', path: ['geofence_ids'] });
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type AlertType = 'BATTERY_DISCONNECTED' | 'SPEED_OVER' | 'PANIC_BUTTON' | 'JAMMING_DETECTED' | 'GEOFENCE_ENTER' | 'GEOFENCE_EXIT' | 'TOW_TRIGGER' | 'PARK_WATCHER';
|
|
2
|
+
export type AlertRecipient = 'responsibles' | 'admin';
|
|
3
|
+
export type SubscriptionPlatform = 'FCM' | 'APNS' | 'WEBHOOK';
|
|
4
|
+
export type VehicleAlertType = 'IGN' | 'MOV' | 'GEO' | 'RISK';
|
|
5
|
+
export interface AlertConfigItem {
|
|
6
|
+
type: AlertType;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
recipients: AlertRecipient[];
|
|
9
|
+
}
|
|
10
|
+
export interface AlertConfigData {
|
|
11
|
+
data: AlertConfigItem[];
|
|
12
|
+
}
|
|
13
|
+
export interface CreateSubscriptionPayload {
|
|
14
|
+
token: string;
|
|
15
|
+
name: string;
|
|
16
|
+
locale: string;
|
|
17
|
+
timezone: string;
|
|
18
|
+
platform: SubscriptionPlatform;
|
|
19
|
+
shortname: string;
|
|
20
|
+
url?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface RegisterConfigurationSubscriptionPayload {
|
|
23
|
+
token: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SubscriptionAlertConfig {
|
|
26
|
+
type: string;
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface ConfigureAlertsPayload {
|
|
30
|
+
dtk: string;
|
|
31
|
+
config: SubscriptionAlertConfig[];
|
|
32
|
+
}
|
|
33
|
+
export interface CreateVehicleSubscriptionPayload {
|
|
34
|
+
alert: VehicleAlertType;
|
|
35
|
+
geofence_ids?: string[];
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CreateAddressPayloadSchema: z.ZodObject<{
|
|
3
|
+
data: z.ZodObject<{
|
|
4
|
+
attributes: z.ZodObject<{
|
|
5
|
+
type: z.ZodEnum<{
|
|
6
|
+
HOME: "HOME";
|
|
7
|
+
WORK: "WORK";
|
|
8
|
+
OTHER: "OTHER";
|
|
9
|
+
}>;
|
|
10
|
+
coords: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
11
|
+
formatted_address: z.ZodString;
|
|
12
|
+
street: z.ZodOptional<z.ZodString>;
|
|
13
|
+
city: z.ZodOptional<z.ZodString>;
|
|
14
|
+
region: z.ZodOptional<z.ZodString>;
|
|
15
|
+
country: z.ZodOptional<z.ZodString>;
|
|
16
|
+
zip_code: z.ZodOptional<z.ZodString>;
|
|
17
|
+
street_number: z.ZodOptional<z.ZodString>;
|
|
18
|
+
complement: z.ZodOptional<z.ZodString>;
|
|
19
|
+
region_short: z.ZodOptional<z.ZodString>;
|
|
20
|
+
country_code: z.ZodOptional<z.ZodString>;
|
|
21
|
+
continent_code: z.ZodOptional<z.ZodString>;
|
|
22
|
+
description: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
export type CreateAddressPayload = z.infer<typeof CreateAddressPayloadSchema>;
|
|
27
|
+
export declare const UpdateAddressPayloadSchema: z.ZodObject<{
|
|
28
|
+
data: z.ZodObject<{
|
|
29
|
+
attributes: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
31
|
+
HOME: "HOME";
|
|
32
|
+
WORK: "WORK";
|
|
33
|
+
OTHER: "OTHER";
|
|
34
|
+
}>>;
|
|
35
|
+
coords: z.ZodOptional<z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>>;
|
|
36
|
+
formatted_address: z.ZodString;
|
|
37
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
38
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
39
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
40
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
41
|
+
zip_code: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
42
|
+
street_number: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
43
|
+
complement: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
44
|
+
region_short: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
45
|
+
country_code: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
46
|
+
continent_code: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
47
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
48
|
+
}, z.core.$strict>>;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
export type UpdateAddressPayload = z.infer<typeof UpdateAddressPayloadSchema>;
|
|
52
|
+
export declare const UserAddressSchema: z.ZodObject<{
|
|
53
|
+
type: z.ZodOptional<z.ZodLiteral<"addresses">>;
|
|
54
|
+
id: z.ZodString;
|
|
55
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
56
|
+
attributes: z.ZodObject<{
|
|
57
|
+
type: z.ZodEnum<{
|
|
58
|
+
HOME: "HOME";
|
|
59
|
+
WORK: "WORK";
|
|
60
|
+
OTHER: "OTHER";
|
|
61
|
+
}>;
|
|
62
|
+
coords: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
|
|
63
|
+
type: z.ZodOptional<z.ZodLiteral<"Point">>;
|
|
64
|
+
coordinates: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
65
|
+
}, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>>>;
|
|
66
|
+
formatted_address: z.ZodNullable<z.ZodString>;
|
|
67
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
68
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
69
|
+
region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
71
|
+
zip_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
street_number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
complement: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
|
+
region_short: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
+
country_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
76
|
+
continent_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
77
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
78
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
79
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
81
|
+
deleted_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
export type UserAddress = z.infer<typeof UserAddressSchema>;
|
|
85
|
+
export declare const AddressQueryParamsSchema: z.ZodObject<{
|
|
86
|
+
count: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"only">]>>;
|
|
87
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
search: z.ZodOptional<z.ZodString>;
|
|
90
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodType<"region" | "formatted_address" | "city" | "zip_code", unknown, z.core.$ZodTypeInternals<"region" | "formatted_address" | "city" | "zip_code", unknown>>, z.ZodLiteral<"*">]>>>;
|
|
91
|
+
filters: z.ZodOptional<z.ZodRecord<z.ZodType<"region" | "formatted_address" | "city" | "zip_code", unknown, z.core.$ZodTypeInternals<"region" | "formatted_address" | "city" | "zip_code", unknown>> & z.core.$partial, z.ZodUnion<readonly [z.ZodObject<{
|
|
92
|
+
operator: z.ZodEnum<{
|
|
93
|
+
in: "in";
|
|
94
|
+
eq: "eq";
|
|
95
|
+
neq: "neq";
|
|
96
|
+
gt: "gt";
|
|
97
|
+
gte: "gte";
|
|
98
|
+
lt: "lt";
|
|
99
|
+
lte: "lte";
|
|
100
|
+
btw: "btw";
|
|
101
|
+
nbtw: "nbtw";
|
|
102
|
+
ilk: "ilk";
|
|
103
|
+
ew: "ew";
|
|
104
|
+
sw: "sw";
|
|
105
|
+
nin: "nin";
|
|
106
|
+
is: "is";
|
|
107
|
+
}>;
|
|
108
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
109
|
+
}, z.core.$strict>, z.ZodArray<z.ZodObject<{
|
|
110
|
+
operator: z.ZodEnum<{
|
|
111
|
+
in: "in";
|
|
112
|
+
eq: "eq";
|
|
113
|
+
neq: "neq";
|
|
114
|
+
gt: "gt";
|
|
115
|
+
gte: "gte";
|
|
116
|
+
lt: "lt";
|
|
117
|
+
lte: "lte";
|
|
118
|
+
btw: "btw";
|
|
119
|
+
nbtw: "nbtw";
|
|
120
|
+
ilk: "ilk";
|
|
121
|
+
ew: "ew";
|
|
122
|
+
sw: "sw";
|
|
123
|
+
nin: "nin";
|
|
124
|
+
is: "is";
|
|
125
|
+
}>;
|
|
126
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
127
|
+
}, z.core.$strict>>]>>>;
|
|
128
|
+
sort: z.ZodOptional<z.ZodObject<{
|
|
129
|
+
prop: z.ZodType<"region" | "formatted_address" | "city" | "zip_code", unknown, z.core.$ZodTypeInternals<"region" | "formatted_address" | "city" | "zip_code", unknown>>;
|
|
130
|
+
order: z.ZodEnum<{
|
|
131
|
+
ASC: "ASC";
|
|
132
|
+
DESC: "DESC";
|
|
133
|
+
}>;
|
|
134
|
+
}, z.core.$strict>>;
|
|
135
|
+
}, z.core.$strict>;
|
|
136
|
+
export type AddressQueryParams = z.infer<typeof AddressQueryParamsSchema>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { makeQueryParamsSchema, nullableVarCharOptional, varCharOptional } from '../../core/schemas.js';
|
|
3
|
+
const AddressTypeSchema = z.enum(['HOME', 'WORK', 'OTHER']);
|
|
4
|
+
const AddressCoordsPayloadSchema = z.tuple([z.number().min(-90).max(90), z.number().min(-180).max(180)]);
|
|
5
|
+
const AddressListAttributeKeySchema = z.enum(['formatted_address', 'city', 'region', 'zip_code']);
|
|
6
|
+
const AddressCoordsResponseSchema = z.union([
|
|
7
|
+
AddressCoordsPayloadSchema,
|
|
8
|
+
z
|
|
9
|
+
.object({
|
|
10
|
+
type: z.literal('Point').optional(),
|
|
11
|
+
coordinates: AddressCoordsPayloadSchema.optional(),
|
|
12
|
+
})
|
|
13
|
+
.strict(),
|
|
14
|
+
z.object({}).strict(),
|
|
15
|
+
]);
|
|
16
|
+
export const CreateAddressPayloadSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
data: z
|
|
19
|
+
.object({
|
|
20
|
+
attributes: z
|
|
21
|
+
.object({
|
|
22
|
+
type: AddressTypeSchema,
|
|
23
|
+
coords: AddressCoordsPayloadSchema.optional(),
|
|
24
|
+
formatted_address: z.string(),
|
|
25
|
+
street: varCharOptional(),
|
|
26
|
+
city: varCharOptional(),
|
|
27
|
+
region: varCharOptional(),
|
|
28
|
+
country: varCharOptional(),
|
|
29
|
+
zip_code: varCharOptional(),
|
|
30
|
+
street_number: varCharOptional(),
|
|
31
|
+
complement: varCharOptional(),
|
|
32
|
+
region_short: varCharOptional(),
|
|
33
|
+
country_code: varCharOptional(),
|
|
34
|
+
continent_code: varCharOptional(),
|
|
35
|
+
description: varCharOptional(),
|
|
36
|
+
})
|
|
37
|
+
.strict(),
|
|
38
|
+
})
|
|
39
|
+
.strict(),
|
|
40
|
+
})
|
|
41
|
+
.strict();
|
|
42
|
+
export const UpdateAddressPayloadSchema = z
|
|
43
|
+
.object({
|
|
44
|
+
data: z
|
|
45
|
+
.object({
|
|
46
|
+
attributes: z
|
|
47
|
+
.object({
|
|
48
|
+
type: AddressTypeSchema.optional(),
|
|
49
|
+
coords: AddressCoordsPayloadSchema.nullable().optional(),
|
|
50
|
+
formatted_address: z.string(),
|
|
51
|
+
street: nullableVarCharOptional(),
|
|
52
|
+
city: nullableVarCharOptional(),
|
|
53
|
+
region: nullableVarCharOptional(),
|
|
54
|
+
country: nullableVarCharOptional(),
|
|
55
|
+
zip_code: nullableVarCharOptional(),
|
|
56
|
+
street_number: nullableVarCharOptional(),
|
|
57
|
+
complement: nullableVarCharOptional(),
|
|
58
|
+
region_short: nullableVarCharOptional(),
|
|
59
|
+
country_code: nullableVarCharOptional(),
|
|
60
|
+
continent_code: nullableVarCharOptional(),
|
|
61
|
+
description: nullableVarCharOptional(),
|
|
62
|
+
})
|
|
63
|
+
.strict()
|
|
64
|
+
.optional(),
|
|
65
|
+
})
|
|
66
|
+
.strict(),
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
export const UserAddressSchema = z.object({
|
|
70
|
+
type: z.literal('addresses').optional(),
|
|
71
|
+
id: z.string(),
|
|
72
|
+
uuid: z.string().optional(),
|
|
73
|
+
attributes: z.object({
|
|
74
|
+
type: AddressTypeSchema,
|
|
75
|
+
coords: AddressCoordsResponseSchema.nullable().optional(),
|
|
76
|
+
formatted_address: z.string().nullable(),
|
|
77
|
+
street: z.string().nullable().optional(),
|
|
78
|
+
city: z.string().nullable().optional(),
|
|
79
|
+
region: z.string().nullable().optional(),
|
|
80
|
+
country: z.string().nullable().optional(),
|
|
81
|
+
zip_code: z.string().nullable().optional(),
|
|
82
|
+
street_number: z.string().nullable().optional(),
|
|
83
|
+
complement: z.string().nullable().optional(),
|
|
84
|
+
region_short: z.string().nullable().optional(),
|
|
85
|
+
country_code: z.string().nullable().optional(),
|
|
86
|
+
continent_code: z.string().nullable().optional(),
|
|
87
|
+
description: z.string().nullable().optional(),
|
|
88
|
+
model: z.string().nullable().optional(),
|
|
89
|
+
created_at: z.string().nullable().optional(),
|
|
90
|
+
updated_at: z.string().nullable().optional(),
|
|
91
|
+
deleted_at: z.string().nullable().optional(),
|
|
92
|
+
}),
|
|
93
|
+
});
|
|
94
|
+
export const AddressQueryParamsSchema = makeQueryParamsSchema(AddressListAttributeKeySchema);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AuthenticatedUserDataSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
attributes: z.ZodObject<{
|
|
5
|
+
name: z.ZodNullable<z.ZodString>;
|
|
6
|
+
username: z.ZodNullable<z.ZodString>;
|
|
7
|
+
locale: z.ZodNullable<z.ZodString>;
|
|
8
|
+
email: z.ZodNullable<z.ZodString>;
|
|
9
|
+
otp: z.ZodBoolean;
|
|
10
|
+
phone1: z.ZodNullable<z.ZodString>;
|
|
11
|
+
phone2: z.ZodNullable<z.ZodString>;
|
|
12
|
+
emergency_contact: z.ZodNullable<z.ZodString>;
|
|
13
|
+
emergency_phone: z.ZodNullable<z.ZodString>;
|
|
14
|
+
cpf: z.ZodNullable<z.ZodString>;
|
|
15
|
+
document_number: z.ZodNullable<z.ZodString>;
|
|
16
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
17
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
relationships: z.ZodObject<{
|
|
20
|
+
addresses: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
21
|
+
roles: z.ZodArray<z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
attributes: z.ZodObject<{
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
document: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export type AuthenticatedUserData = z.infer<typeof AuthenticatedUserDataSchema>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { NullableTimestampsAttributesSchema, NullableUserContactAttributesSchema, NullableUserDocumentAttributesSchema, RoleAttributesSchema, } from './common.js';
|
|
3
|
+
export const AuthenticatedUserDataSchema = z.object({
|
|
4
|
+
id: z.string(),
|
|
5
|
+
attributes: z
|
|
6
|
+
.object({
|
|
7
|
+
name: z.string().nullable(),
|
|
8
|
+
username: z.string().nullable(),
|
|
9
|
+
locale: z.string().nullable(),
|
|
10
|
+
email: z.string().nullable(),
|
|
11
|
+
otp: z.boolean(),
|
|
12
|
+
})
|
|
13
|
+
.extend(NullableUserContactAttributesSchema.shape)
|
|
14
|
+
.extend(NullableUserDocumentAttributesSchema.shape)
|
|
15
|
+
.extend(NullableTimestampsAttributesSchema.shape),
|
|
16
|
+
relationships: z.object({
|
|
17
|
+
addresses: z.array(z.record(z.string(), z.unknown())),
|
|
18
|
+
roles: z.array(z.object({ id: z.string(), attributes: RoleAttributesSchema })),
|
|
19
|
+
document: z.record(z.string(), z.unknown()).nullable(),
|
|
20
|
+
}),
|
|
21
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const NullableUserContactAttributesSchema: z.ZodObject<{
|
|
3
|
+
phone1: z.ZodNullable<z.ZodString>;
|
|
4
|
+
phone2: z.ZodNullable<z.ZodString>;
|
|
5
|
+
emergency_contact: z.ZodNullable<z.ZodString>;
|
|
6
|
+
emergency_phone: z.ZodNullable<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const OptionalUserContactAttributesSchema: z.ZodObject<{
|
|
9
|
+
phone1: z.ZodOptional<z.ZodString>;
|
|
10
|
+
phone2: z.ZodOptional<z.ZodString>;
|
|
11
|
+
emergency_contact: z.ZodOptional<z.ZodString>;
|
|
12
|
+
emergency_phone: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const NullableUserDocumentAttributesSchema: z.ZodObject<{
|
|
15
|
+
cpf: z.ZodNullable<z.ZodString>;
|
|
16
|
+
document_number: z.ZodNullable<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export declare const OptionalUserDocumentAttributesSchema: z.ZodObject<{
|
|
19
|
+
cpf: z.ZodOptional<z.ZodString>;
|
|
20
|
+
document_number: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const NullableTimestampsAttributesSchema: z.ZodObject<{
|
|
23
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
24
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export declare const RoleAttributesSchema: z.ZodObject<{
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const NullableUserContactAttributesSchema = z.object({
|
|
3
|
+
phone1: z.string().nullable(),
|
|
4
|
+
phone2: z.string().nullable(),
|
|
5
|
+
emergency_contact: z.string().nullable(),
|
|
6
|
+
emergency_phone: z.string().nullable(),
|
|
7
|
+
});
|
|
8
|
+
export const OptionalUserContactAttributesSchema = z.object({
|
|
9
|
+
phone1: z.string().optional(),
|
|
10
|
+
phone2: z.string().optional(),
|
|
11
|
+
emergency_contact: z.string().optional(),
|
|
12
|
+
emergency_phone: z.string().optional(),
|
|
13
|
+
});
|
|
14
|
+
export const NullableUserDocumentAttributesSchema = z.object({
|
|
15
|
+
cpf: z.string().nullable(),
|
|
16
|
+
document_number: z.string().nullable(),
|
|
17
|
+
});
|
|
18
|
+
export const OptionalUserDocumentAttributesSchema = z.object({
|
|
19
|
+
cpf: z.string().optional(),
|
|
20
|
+
document_number: z.string().optional(),
|
|
21
|
+
});
|
|
22
|
+
export const NullableTimestampsAttributesSchema = z.object({
|
|
23
|
+
created_at: z.string().nullable(),
|
|
24
|
+
updated_at: z.string().nullable(),
|
|
25
|
+
});
|
|
26
|
+
export const RoleAttributesSchema = z.object({ name: z.string() });
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const UserDocumentSignedLinkPayloadSchema: z.ZodObject<{
|
|
3
|
+
data: z.ZodObject<{
|
|
4
|
+
attributes: z.ZodObject<{
|
|
5
|
+
file_name: z.ZodString;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
export type UserDocumentSignedLinkPayload = z.infer<typeof UserDocumentSignedLinkPayloadSchema>;
|
|
10
|
+
export declare const UserDocumentSignedLinkResponseSchema: z.ZodObject<{
|
|
11
|
+
data: z.ZodObject<{
|
|
12
|
+
signed_link: z.ZodString;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type UserDocumentSignedLinkResponse = z.infer<typeof UserDocumentSignedLinkResponseSchema>;
|
|
16
|
+
export declare const ConfirmUserDocumentUploadPayloadSchema: z.ZodObject<{
|
|
17
|
+
data: z.ZodObject<{
|
|
18
|
+
attributes: z.ZodObject<{
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
key_name: z.ZodString;
|
|
21
|
+
file_size: z.ZodNumber;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
export type ConfirmUserDocumentUploadPayload = z.infer<typeof ConfirmUserDocumentUploadPayloadSchema>;
|
|
26
|
+
export declare const UserDocumentSchema: z.ZodObject<{
|
|
27
|
+
type: z.ZodOptional<z.ZodLiteral<"documents">>;
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
attributes: z.ZodObject<{
|
|
30
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
key_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
file_size: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
33
|
+
mime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
folder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
deleted_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type UserDocument = z.infer<typeof UserDocumentSchema>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { varChar } from '../../core/schemas.js';
|
|
3
|
+
export const UserDocumentSignedLinkPayloadSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
data: z
|
|
6
|
+
.object({
|
|
7
|
+
attributes: z
|
|
8
|
+
.object({
|
|
9
|
+
file_name: z.string(),
|
|
10
|
+
})
|
|
11
|
+
.strict(),
|
|
12
|
+
})
|
|
13
|
+
.strict(),
|
|
14
|
+
})
|
|
15
|
+
.strict();
|
|
16
|
+
export const UserDocumentSignedLinkResponseSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
data: z
|
|
19
|
+
.object({
|
|
20
|
+
signed_link: z.string(),
|
|
21
|
+
})
|
|
22
|
+
.strict(),
|
|
23
|
+
})
|
|
24
|
+
.strict();
|
|
25
|
+
export const ConfirmUserDocumentUploadPayloadSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
data: z
|
|
28
|
+
.object({
|
|
29
|
+
attributes: z
|
|
30
|
+
.object({
|
|
31
|
+
name: varChar(),
|
|
32
|
+
key_name: varChar(),
|
|
33
|
+
file_size: z.number().int(),
|
|
34
|
+
})
|
|
35
|
+
.strict(),
|
|
36
|
+
})
|
|
37
|
+
.strict(),
|
|
38
|
+
})
|
|
39
|
+
.strict();
|
|
40
|
+
export const UserDocumentSchema = z.object({
|
|
41
|
+
type: z.literal('documents').optional(),
|
|
42
|
+
id: z.string(),
|
|
43
|
+
attributes: z.object({
|
|
44
|
+
name: z.string().nullable().optional(),
|
|
45
|
+
key_name: z.string().nullable().optional(),
|
|
46
|
+
file_size: z.number().nullable().optional(),
|
|
47
|
+
mime: z.string().nullable().optional(),
|
|
48
|
+
folder: z.string().nullable().optional(),
|
|
49
|
+
created_at: z.string().nullable().optional(),
|
|
50
|
+
updated_at: z.string().nullable().optional(),
|
|
51
|
+
deleted_at: z.string().nullable().optional(),
|
|
52
|
+
}),
|
|
53
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const UpdatePasswordPayloadSchema: z.ZodObject<{
|
|
3
|
+
data: z.ZodObject<{
|
|
4
|
+
attributes: z.ZodObject<{
|
|
5
|
+
old_password: z.ZodOptional<z.ZodString>;
|
|
6
|
+
new_password: z.ZodString;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export type UpdatePasswordPayload = z.infer<typeof UpdatePasswordPayloadSchema>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const UpdatePasswordPayloadSchema = z
|
|
3
|
+
.object({
|
|
4
|
+
data: z
|
|
5
|
+
.object({
|
|
6
|
+
attributes: z
|
|
7
|
+
.object({
|
|
8
|
+
old_password: z.string().max(32).optional(),
|
|
9
|
+
new_password: z.string().max(32),
|
|
10
|
+
})
|
|
11
|
+
.strict(),
|
|
12
|
+
})
|
|
13
|
+
.strict(),
|
|
14
|
+
})
|
|
15
|
+
.strict();
|