@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,160 @@
|
|
|
1
|
+
import type { Deactivatable } from '../core/types';
|
|
2
|
+
export interface EnterpriseAttributes extends Deactivatable {
|
|
3
|
+
name: string | null;
|
|
4
|
+
fantasy_name: string | null;
|
|
5
|
+
cnpj: string | null;
|
|
6
|
+
email: string | null;
|
|
7
|
+
phone1: string | null;
|
|
8
|
+
phone2: string | null;
|
|
9
|
+
assistance_emergency_tel: string | null;
|
|
10
|
+
theft_emergency_tel: string | null;
|
|
11
|
+
country: string | null;
|
|
12
|
+
timezone: string | null;
|
|
13
|
+
last_integration_source: string | null;
|
|
14
|
+
last_integration_time: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface Enterprise {
|
|
17
|
+
id: string;
|
|
18
|
+
attributes: EnterpriseAttributes;
|
|
19
|
+
relationships: {
|
|
20
|
+
country: {
|
|
21
|
+
attributes: {
|
|
22
|
+
name: string | null;
|
|
23
|
+
timezone: string | null;
|
|
24
|
+
};
|
|
25
|
+
} | null;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface EnterpriseAddress {
|
|
29
|
+
id: string;
|
|
30
|
+
attributes: {
|
|
31
|
+
formatted_address: string | null;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export type EnterpriseAddressType = 'BILLING' | 'DELIVERY' | 'OTHER';
|
|
35
|
+
export interface CreateEnterpriseAddressPayload {
|
|
36
|
+
data: {
|
|
37
|
+
attributes: {
|
|
38
|
+
type: EnterpriseAddressType;
|
|
39
|
+
coords?: [number, number];
|
|
40
|
+
formatted_address: string;
|
|
41
|
+
street: string;
|
|
42
|
+
street_number?: string;
|
|
43
|
+
complement?: string;
|
|
44
|
+
city: string;
|
|
45
|
+
region: string;
|
|
46
|
+
country: string;
|
|
47
|
+
country_code?: string;
|
|
48
|
+
zip_code?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface EnterpriseCustomization {
|
|
54
|
+
id: string;
|
|
55
|
+
attributes: {
|
|
56
|
+
domain: string | null;
|
|
57
|
+
color1: string | null;
|
|
58
|
+
color2: string | null;
|
|
59
|
+
apps: {
|
|
60
|
+
android: string | null;
|
|
61
|
+
} | null;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export interface EnterprisePublicResponse {
|
|
65
|
+
data: {
|
|
66
|
+
attributes: {
|
|
67
|
+
name: string;
|
|
68
|
+
};
|
|
69
|
+
relationships: {
|
|
70
|
+
customization: {
|
|
71
|
+
attributes: {
|
|
72
|
+
color1: string;
|
|
73
|
+
color2: string;
|
|
74
|
+
layout: 'LEFT' | 'RIGHT' | 'CENTER';
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
document: {
|
|
78
|
+
attributes: {
|
|
79
|
+
folder: string;
|
|
80
|
+
};
|
|
81
|
+
} | null;
|
|
82
|
+
};
|
|
83
|
+
} | null;
|
|
84
|
+
}
|
|
85
|
+
export interface BootstrapEnterpriseAttributes {
|
|
86
|
+
name: string | null;
|
|
87
|
+
phone1: string | null;
|
|
88
|
+
phone2: string | null;
|
|
89
|
+
email: string | null;
|
|
90
|
+
cnpj: string | null;
|
|
91
|
+
timezone: string;
|
|
92
|
+
main_client: boolean | null;
|
|
93
|
+
support: boolean | null;
|
|
94
|
+
}
|
|
95
|
+
export interface BootstrapEnterpriseData {
|
|
96
|
+
id: string;
|
|
97
|
+
attributes: BootstrapEnterpriseAttributes;
|
|
98
|
+
relationships: {
|
|
99
|
+
addresses: Array<Record<string, unknown>>;
|
|
100
|
+
country: Record<string, unknown> | null;
|
|
101
|
+
document: Record<string, unknown> | null;
|
|
102
|
+
regional_setting: Record<string, unknown> | null;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export interface Country {
|
|
106
|
+
id: string;
|
|
107
|
+
attributes: {
|
|
108
|
+
name: string | null;
|
|
109
|
+
timezones: string[];
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export interface EnterpriseOverviewSummary {
|
|
113
|
+
vehicles: {
|
|
114
|
+
total: number;
|
|
115
|
+
actives: number;
|
|
116
|
+
};
|
|
117
|
+
devices: {
|
|
118
|
+
total: number;
|
|
119
|
+
actives: number;
|
|
120
|
+
};
|
|
121
|
+
users: {
|
|
122
|
+
total: number;
|
|
123
|
+
actives: number;
|
|
124
|
+
};
|
|
125
|
+
chips: {
|
|
126
|
+
total: number;
|
|
127
|
+
};
|
|
128
|
+
enterprises: {
|
|
129
|
+
total: number;
|
|
130
|
+
};
|
|
131
|
+
protocols: {
|
|
132
|
+
total: number;
|
|
133
|
+
};
|
|
134
|
+
service_orders: {
|
|
135
|
+
total: number;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
export interface CreateEnterprisePayload {
|
|
139
|
+
attributes: {
|
|
140
|
+
name: string;
|
|
141
|
+
cnpj: string;
|
|
142
|
+
timezone: string;
|
|
143
|
+
fantasy_name?: string;
|
|
144
|
+
phone1?: string;
|
|
145
|
+
phone2?: string;
|
|
146
|
+
email?: string;
|
|
147
|
+
description?: string;
|
|
148
|
+
contact_name?: string;
|
|
149
|
+
state_registration_no?: string;
|
|
150
|
+
webpage?: string;
|
|
151
|
+
assistance_emergency_tel?: string;
|
|
152
|
+
theft_emergency_tel?: string;
|
|
153
|
+
};
|
|
154
|
+
relationships: {
|
|
155
|
+
country: {
|
|
156
|
+
type: 'country';
|
|
157
|
+
id: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ApiClientLike } from '../core/client';
|
|
2
|
+
import type { QueryParams } from '../core/query-builder';
|
|
3
|
+
import type { BoardEventsResponse, CreateEventPayload, Event, EventAttributes, EventDetail } from './types';
|
|
4
|
+
export declare function createEventsApi(client: ApiClientLike): {
|
|
5
|
+
listBoard: (params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<BoardEventsResponse>;
|
|
6
|
+
listByStatus: (params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<{
|
|
7
|
+
data: Event[];
|
|
8
|
+
}>;
|
|
9
|
+
get: (id: string, signal?: AbortSignal) => Promise<{
|
|
10
|
+
data: EventDetail;
|
|
11
|
+
}>;
|
|
12
|
+
create: (payload: CreateEventPayload) => Promise<{
|
|
13
|
+
data: Event;
|
|
14
|
+
}>;
|
|
15
|
+
update: (id: string, payload: Partial<Pick<EventAttributes, "status" | "title">>) => Promise<undefined>;
|
|
16
|
+
remove: (id: string) => Promise<undefined>;
|
|
17
|
+
removeAlert: (eventId: string, alertId: string) => Promise<undefined>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { withQuery } from '../core/query-builder.js';
|
|
2
|
+
export function createEventsApi(client) {
|
|
3
|
+
const endpoint = '/v4/events';
|
|
4
|
+
return {
|
|
5
|
+
listBoard: (params = {}, signal) => client.get(withQuery(endpoint, params), { signal }).then((r) => r.data.data),
|
|
6
|
+
listByStatus: (params = {}, signal) => client.get(withQuery(endpoint, params), { signal }).then((r) => r.data),
|
|
7
|
+
get: (id, signal) => client.get(`${endpoint}/${id}`, { signal }).then((r) => r.data),
|
|
8
|
+
create: (payload) => client.post(endpoint, { data: payload }).then((r) => r.data),
|
|
9
|
+
update: (id, payload) => client.patch(`${endpoint}/${id}`, { data: payload }).then(() => undefined),
|
|
10
|
+
remove: (id) => client.delete(`${endpoint}/${id}`).then(() => undefined),
|
|
11
|
+
removeAlert: (eventId, alertId) => client.delete(`${endpoint}/${eventId}/alerts`, { data: { data: { alertIds: [alertId] } } }).then(() => undefined),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const EventStatusSchema: z.ZodEnum<{
|
|
3
|
+
done: "done";
|
|
4
|
+
todo: "todo";
|
|
5
|
+
doing: "doing";
|
|
6
|
+
}>;
|
|
7
|
+
export declare const EventAttributesSchema: z.ZodObject<{
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
+
tags: z.ZodArray<z.ZodString>;
|
|
11
|
+
vals: z.ZodArray<z.ZodString>;
|
|
12
|
+
alertsCount: z.ZodNumber;
|
|
13
|
+
commentsCount: z.ZodNumber;
|
|
14
|
+
status: z.ZodEnum<{
|
|
15
|
+
done: "done";
|
|
16
|
+
todo: "todo";
|
|
17
|
+
doing: "doing";
|
|
18
|
+
}>;
|
|
19
|
+
createdAt: z.ZodString;
|
|
20
|
+
updatedAt: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const EventVehicleSchema: z.ZodObject<{
|
|
23
|
+
id: z.ZodNumber;
|
|
24
|
+
uuid: z.ZodString;
|
|
25
|
+
type: z.ZodString;
|
|
26
|
+
attributes: z.ZodObject<{
|
|
27
|
+
plate: z.ZodNullable<z.ZodString>;
|
|
28
|
+
vin: z.ZodNullable<z.ZodString>;
|
|
29
|
+
color: z.ZodNullable<z.ZodString>;
|
|
30
|
+
type: z.ZodNullable<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
relationships: z.ZodObject<{
|
|
33
|
+
responsibles: z.ZodArray<z.ZodObject<{
|
|
34
|
+
id: z.ZodNumber;
|
|
35
|
+
attributes: z.ZodObject<{
|
|
36
|
+
name: z.ZodNullable<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
export declare const EventSchema: z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
attributes: z.ZodObject<{
|
|
44
|
+
title: z.ZodString;
|
|
45
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
|
+
tags: z.ZodArray<z.ZodString>;
|
|
47
|
+
vals: z.ZodArray<z.ZodString>;
|
|
48
|
+
alertsCount: z.ZodNumber;
|
|
49
|
+
commentsCount: z.ZodNumber;
|
|
50
|
+
status: z.ZodEnum<{
|
|
51
|
+
done: "done";
|
|
52
|
+
todo: "todo";
|
|
53
|
+
doing: "doing";
|
|
54
|
+
}>;
|
|
55
|
+
createdAt: z.ZodString;
|
|
56
|
+
updatedAt: z.ZodString;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
relationships: z.ZodObject<{
|
|
59
|
+
vehicle: z.ZodNullable<z.ZodObject<{
|
|
60
|
+
id: z.ZodNumber;
|
|
61
|
+
uuid: z.ZodString;
|
|
62
|
+
type: z.ZodString;
|
|
63
|
+
attributes: z.ZodObject<{
|
|
64
|
+
plate: z.ZodNullable<z.ZodString>;
|
|
65
|
+
vin: z.ZodNullable<z.ZodString>;
|
|
66
|
+
color: z.ZodNullable<z.ZodString>;
|
|
67
|
+
type: z.ZodNullable<z.ZodString>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
relationships: z.ZodObject<{
|
|
70
|
+
responsibles: z.ZodArray<z.ZodObject<{
|
|
71
|
+
id: z.ZodNumber;
|
|
72
|
+
attributes: z.ZodObject<{
|
|
73
|
+
name: z.ZodNullable<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
}, z.core.$strip>>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export declare const BoardColumnSchema: z.ZodObject<{
|
|
81
|
+
count: z.ZodNumber;
|
|
82
|
+
events: z.ZodArray<z.ZodObject<{
|
|
83
|
+
id: z.ZodString;
|
|
84
|
+
attributes: z.ZodObject<{
|
|
85
|
+
title: z.ZodString;
|
|
86
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
87
|
+
tags: z.ZodArray<z.ZodString>;
|
|
88
|
+
vals: z.ZodArray<z.ZodString>;
|
|
89
|
+
alertsCount: z.ZodNumber;
|
|
90
|
+
commentsCount: z.ZodNumber;
|
|
91
|
+
status: z.ZodEnum<{
|
|
92
|
+
done: "done";
|
|
93
|
+
todo: "todo";
|
|
94
|
+
doing: "doing";
|
|
95
|
+
}>;
|
|
96
|
+
createdAt: z.ZodString;
|
|
97
|
+
updatedAt: z.ZodString;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
relationships: z.ZodObject<{
|
|
100
|
+
vehicle: z.ZodNullable<z.ZodObject<{
|
|
101
|
+
id: z.ZodNumber;
|
|
102
|
+
uuid: z.ZodString;
|
|
103
|
+
type: z.ZodString;
|
|
104
|
+
attributes: z.ZodObject<{
|
|
105
|
+
plate: z.ZodNullable<z.ZodString>;
|
|
106
|
+
vin: z.ZodNullable<z.ZodString>;
|
|
107
|
+
color: z.ZodNullable<z.ZodString>;
|
|
108
|
+
type: z.ZodNullable<z.ZodString>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
relationships: z.ZodObject<{
|
|
111
|
+
responsibles: z.ZodArray<z.ZodObject<{
|
|
112
|
+
id: z.ZodNumber;
|
|
113
|
+
attributes: z.ZodObject<{
|
|
114
|
+
name: z.ZodNullable<z.ZodString>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
}, z.core.$strip>>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
export declare const BoardEventsResponseSchema: z.ZodObject<{
|
|
123
|
+
todo: z.ZodObject<{
|
|
124
|
+
count: z.ZodNumber;
|
|
125
|
+
events: z.ZodArray<z.ZodObject<{
|
|
126
|
+
id: z.ZodString;
|
|
127
|
+
attributes: z.ZodObject<{
|
|
128
|
+
title: z.ZodString;
|
|
129
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
130
|
+
tags: z.ZodArray<z.ZodString>;
|
|
131
|
+
vals: z.ZodArray<z.ZodString>;
|
|
132
|
+
alertsCount: z.ZodNumber;
|
|
133
|
+
commentsCount: z.ZodNumber;
|
|
134
|
+
status: z.ZodEnum<{
|
|
135
|
+
done: "done";
|
|
136
|
+
todo: "todo";
|
|
137
|
+
doing: "doing";
|
|
138
|
+
}>;
|
|
139
|
+
createdAt: z.ZodString;
|
|
140
|
+
updatedAt: z.ZodString;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
relationships: z.ZodObject<{
|
|
143
|
+
vehicle: z.ZodNullable<z.ZodObject<{
|
|
144
|
+
id: z.ZodNumber;
|
|
145
|
+
uuid: z.ZodString;
|
|
146
|
+
type: z.ZodString;
|
|
147
|
+
attributes: z.ZodObject<{
|
|
148
|
+
plate: z.ZodNullable<z.ZodString>;
|
|
149
|
+
vin: z.ZodNullable<z.ZodString>;
|
|
150
|
+
color: z.ZodNullable<z.ZodString>;
|
|
151
|
+
type: z.ZodNullable<z.ZodString>;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
relationships: z.ZodObject<{
|
|
154
|
+
responsibles: z.ZodArray<z.ZodObject<{
|
|
155
|
+
id: z.ZodNumber;
|
|
156
|
+
attributes: z.ZodObject<{
|
|
157
|
+
name: z.ZodNullable<z.ZodString>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
|
+
}, z.core.$strip>;
|
|
161
|
+
}, z.core.$strip>>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
doing: z.ZodObject<{
|
|
166
|
+
count: z.ZodNumber;
|
|
167
|
+
events: z.ZodArray<z.ZodObject<{
|
|
168
|
+
id: z.ZodString;
|
|
169
|
+
attributes: z.ZodObject<{
|
|
170
|
+
title: z.ZodString;
|
|
171
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
172
|
+
tags: z.ZodArray<z.ZodString>;
|
|
173
|
+
vals: z.ZodArray<z.ZodString>;
|
|
174
|
+
alertsCount: z.ZodNumber;
|
|
175
|
+
commentsCount: z.ZodNumber;
|
|
176
|
+
status: z.ZodEnum<{
|
|
177
|
+
done: "done";
|
|
178
|
+
todo: "todo";
|
|
179
|
+
doing: "doing";
|
|
180
|
+
}>;
|
|
181
|
+
createdAt: z.ZodString;
|
|
182
|
+
updatedAt: z.ZodString;
|
|
183
|
+
}, z.core.$strip>;
|
|
184
|
+
relationships: z.ZodObject<{
|
|
185
|
+
vehicle: z.ZodNullable<z.ZodObject<{
|
|
186
|
+
id: z.ZodNumber;
|
|
187
|
+
uuid: z.ZodString;
|
|
188
|
+
type: z.ZodString;
|
|
189
|
+
attributes: z.ZodObject<{
|
|
190
|
+
plate: z.ZodNullable<z.ZodString>;
|
|
191
|
+
vin: z.ZodNullable<z.ZodString>;
|
|
192
|
+
color: z.ZodNullable<z.ZodString>;
|
|
193
|
+
type: z.ZodNullable<z.ZodString>;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
relationships: z.ZodObject<{
|
|
196
|
+
responsibles: z.ZodArray<z.ZodObject<{
|
|
197
|
+
id: z.ZodNumber;
|
|
198
|
+
attributes: z.ZodObject<{
|
|
199
|
+
name: z.ZodNullable<z.ZodString>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
}, z.core.$strip>>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
}, z.core.$strip>>;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
}, z.core.$strip>>;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
done: z.ZodObject<{
|
|
208
|
+
count: z.ZodNumber;
|
|
209
|
+
events: z.ZodArray<z.ZodObject<{
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
attributes: z.ZodObject<{
|
|
212
|
+
title: z.ZodString;
|
|
213
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
214
|
+
tags: z.ZodArray<z.ZodString>;
|
|
215
|
+
vals: z.ZodArray<z.ZodString>;
|
|
216
|
+
alertsCount: z.ZodNumber;
|
|
217
|
+
commentsCount: z.ZodNumber;
|
|
218
|
+
status: z.ZodEnum<{
|
|
219
|
+
done: "done";
|
|
220
|
+
todo: "todo";
|
|
221
|
+
doing: "doing";
|
|
222
|
+
}>;
|
|
223
|
+
createdAt: z.ZodString;
|
|
224
|
+
updatedAt: z.ZodString;
|
|
225
|
+
}, z.core.$strip>;
|
|
226
|
+
relationships: z.ZodObject<{
|
|
227
|
+
vehicle: z.ZodNullable<z.ZodObject<{
|
|
228
|
+
id: z.ZodNumber;
|
|
229
|
+
uuid: z.ZodString;
|
|
230
|
+
type: z.ZodString;
|
|
231
|
+
attributes: z.ZodObject<{
|
|
232
|
+
plate: z.ZodNullable<z.ZodString>;
|
|
233
|
+
vin: z.ZodNullable<z.ZodString>;
|
|
234
|
+
color: z.ZodNullable<z.ZodString>;
|
|
235
|
+
type: z.ZodNullable<z.ZodString>;
|
|
236
|
+
}, z.core.$strip>;
|
|
237
|
+
relationships: z.ZodObject<{
|
|
238
|
+
responsibles: z.ZodArray<z.ZodObject<{
|
|
239
|
+
id: z.ZodNumber;
|
|
240
|
+
attributes: z.ZodObject<{
|
|
241
|
+
name: z.ZodNullable<z.ZodString>;
|
|
242
|
+
}, z.core.$strip>;
|
|
243
|
+
}, z.core.$strip>>;
|
|
244
|
+
}, z.core.$strip>;
|
|
245
|
+
}, z.core.$strip>>;
|
|
246
|
+
}, z.core.$strip>;
|
|
247
|
+
}, z.core.$strip>>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
}, z.core.$strip>;
|
|
250
|
+
export declare const CreateEventPayloadSchema: z.ZodObject<{
|
|
251
|
+
title: z.ZodString;
|
|
252
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
253
|
+
alerts: z.ZodArray<z.ZodObject<{
|
|
254
|
+
tag: z.ZodString;
|
|
255
|
+
val: z.ZodString;
|
|
256
|
+
act: z.ZodNumber;
|
|
257
|
+
flood: z.ZodBoolean;
|
|
258
|
+
lat: z.ZodNullable<z.ZodNumber>;
|
|
259
|
+
lng: z.ZodNullable<z.ZodNumber>;
|
|
260
|
+
did: z.ZodString;
|
|
261
|
+
}, z.core.$strip>>;
|
|
262
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const EventStatusSchema = z.enum(['todo', 'doing', 'done']);
|
|
3
|
+
export const EventAttributesSchema = z.object({
|
|
4
|
+
title: z.string(),
|
|
5
|
+
description: z.string().nullable().optional(),
|
|
6
|
+
tags: z.array(z.string()),
|
|
7
|
+
vals: z.array(z.string()),
|
|
8
|
+
alertsCount: z.number(),
|
|
9
|
+
commentsCount: z.number(),
|
|
10
|
+
status: EventStatusSchema,
|
|
11
|
+
createdAt: z.string(),
|
|
12
|
+
updatedAt: z.string(),
|
|
13
|
+
});
|
|
14
|
+
export const EventVehicleSchema = z.object({
|
|
15
|
+
id: z.number(),
|
|
16
|
+
uuid: z.string(),
|
|
17
|
+
type: z.string(),
|
|
18
|
+
attributes: z.object({
|
|
19
|
+
plate: z.string().nullable(),
|
|
20
|
+
vin: z.string().nullable(),
|
|
21
|
+
color: z.string().nullable(),
|
|
22
|
+
type: z.string().nullable(),
|
|
23
|
+
}),
|
|
24
|
+
relationships: z.object({
|
|
25
|
+
responsibles: z.array(z.object({ id: z.number(), attributes: z.object({ name: z.string().nullable() }) })),
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
export const EventSchema = z.object({
|
|
29
|
+
id: z.string(),
|
|
30
|
+
attributes: EventAttributesSchema,
|
|
31
|
+
relationships: z.object({ vehicle: EventVehicleSchema.nullable() }),
|
|
32
|
+
});
|
|
33
|
+
export const BoardColumnSchema = z.object({
|
|
34
|
+
count: z.number(),
|
|
35
|
+
events: z.array(EventSchema),
|
|
36
|
+
});
|
|
37
|
+
export const BoardEventsResponseSchema = z.object({
|
|
38
|
+
todo: BoardColumnSchema,
|
|
39
|
+
doing: BoardColumnSchema,
|
|
40
|
+
done: BoardColumnSchema,
|
|
41
|
+
});
|
|
42
|
+
export const CreateEventPayloadSchema = z.object({
|
|
43
|
+
title: z.string().min(1),
|
|
44
|
+
description: z.string().nullable().optional(),
|
|
45
|
+
alerts: z.array(z.object({
|
|
46
|
+
tag: z.string(),
|
|
47
|
+
val: z.string(),
|
|
48
|
+
act: z.number(),
|
|
49
|
+
flood: z.boolean(),
|
|
50
|
+
lat: z.number().nullable(),
|
|
51
|
+
lng: z.number().nullable(),
|
|
52
|
+
did: z.string(),
|
|
53
|
+
})),
|
|
54
|
+
});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { AlertAttributes } from '../alerts/types';
|
|
2
|
+
export type EventStatus = 'todo' | 'doing' | 'done';
|
|
3
|
+
export interface EventAttributes {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string | null;
|
|
6
|
+
tags: string[];
|
|
7
|
+
vals: string[];
|
|
8
|
+
alertsCount: number;
|
|
9
|
+
commentsCount: number;
|
|
10
|
+
status: EventStatus;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface EventVehicle {
|
|
15
|
+
id: number;
|
|
16
|
+
uuid: string;
|
|
17
|
+
type: string;
|
|
18
|
+
attributes: {
|
|
19
|
+
plate: string | null;
|
|
20
|
+
vin: string | null;
|
|
21
|
+
color: string | null;
|
|
22
|
+
type: string | null;
|
|
23
|
+
};
|
|
24
|
+
relationships: {
|
|
25
|
+
responsibles: Array<{
|
|
26
|
+
id: number;
|
|
27
|
+
attributes: {
|
|
28
|
+
name: string | null;
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface Event {
|
|
34
|
+
id: string;
|
|
35
|
+
attributes: EventAttributes;
|
|
36
|
+
relationships: {
|
|
37
|
+
vehicle: EventVehicle | null;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface EventDetail {
|
|
41
|
+
id: string;
|
|
42
|
+
attributes: EventAttributes;
|
|
43
|
+
relationships: {
|
|
44
|
+
vehicle: EventVehicle | null;
|
|
45
|
+
enterprise: {
|
|
46
|
+
id: number;
|
|
47
|
+
attributes: {
|
|
48
|
+
name: string;
|
|
49
|
+
cnpj: string | null;
|
|
50
|
+
email: string | null;
|
|
51
|
+
};
|
|
52
|
+
} | null;
|
|
53
|
+
user: {
|
|
54
|
+
id: number;
|
|
55
|
+
attributes: {
|
|
56
|
+
name: string | null;
|
|
57
|
+
username?: string;
|
|
58
|
+
email?: string | null;
|
|
59
|
+
};
|
|
60
|
+
} | null;
|
|
61
|
+
devices: Array<{
|
|
62
|
+
id: number;
|
|
63
|
+
attributes: {
|
|
64
|
+
name: string;
|
|
65
|
+
imei: string;
|
|
66
|
+
};
|
|
67
|
+
relationships: {
|
|
68
|
+
device_type: {
|
|
69
|
+
attributes: {
|
|
70
|
+
alias: string;
|
|
71
|
+
brand_alias: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
}>;
|
|
76
|
+
alerts: Array<{
|
|
77
|
+
id: string;
|
|
78
|
+
attributes: {
|
|
79
|
+
tag: string;
|
|
80
|
+
val: string;
|
|
81
|
+
msg: string | null;
|
|
82
|
+
lat: number | null;
|
|
83
|
+
lng: number | null;
|
|
84
|
+
pla: string | null;
|
|
85
|
+
actiso: string;
|
|
86
|
+
};
|
|
87
|
+
}>;
|
|
88
|
+
comments: Array<{
|
|
89
|
+
id: string;
|
|
90
|
+
attributes: {
|
|
91
|
+
body: string;
|
|
92
|
+
createdAt: string;
|
|
93
|
+
};
|
|
94
|
+
relationships: {
|
|
95
|
+
user: {
|
|
96
|
+
attributes: {
|
|
97
|
+
name: string | null;
|
|
98
|
+
};
|
|
99
|
+
} | null;
|
|
100
|
+
};
|
|
101
|
+
}>;
|
|
102
|
+
statusHistory: Array<{
|
|
103
|
+
attributes: {
|
|
104
|
+
status: EventStatus;
|
|
105
|
+
updatedAt: string;
|
|
106
|
+
};
|
|
107
|
+
relationships: {
|
|
108
|
+
user: {
|
|
109
|
+
attributes: {
|
|
110
|
+
name: string | null;
|
|
111
|
+
};
|
|
112
|
+
} | null;
|
|
113
|
+
};
|
|
114
|
+
}>;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export interface BoardColumn {
|
|
118
|
+
count: number;
|
|
119
|
+
events: Event[];
|
|
120
|
+
}
|
|
121
|
+
export interface BoardEventsResponse {
|
|
122
|
+
todo: BoardColumn;
|
|
123
|
+
doing: BoardColumn;
|
|
124
|
+
done: BoardColumn;
|
|
125
|
+
}
|
|
126
|
+
export interface CreateEventPayload {
|
|
127
|
+
title: string;
|
|
128
|
+
description?: string | null;
|
|
129
|
+
alerts: AlertAttributes[];
|
|
130
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ApiClientLike } from '../core/client';
|
|
2
|
+
import type { QueryParams } from '../core/query-builder';
|
|
3
|
+
import type { CreateExportPayload, ExportFile, ExportFilePanelRow } from './types';
|
|
4
|
+
export declare function createExportsApi(client: ApiClientLike): {
|
|
5
|
+
requestExport: (payload: CreateExportPayload) => Promise<undefined>;
|
|
6
|
+
panel: (params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<{
|
|
7
|
+
data: ExportFilePanelRow[];
|
|
8
|
+
}>;
|
|
9
|
+
endpoint: string;
|
|
10
|
+
list: <R = ExportFile>(params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<import("..").ListResponse<R>>;
|
|
11
|
+
get: <R = ExportFile>(id: string, params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<{
|
|
12
|
+
data: R;
|
|
13
|
+
}>;
|
|
14
|
+
create: (payload: unknown) => Promise<undefined>;
|
|
15
|
+
update: (id: string, payload: unknown) => Promise<undefined>;
|
|
16
|
+
remove: (id: string) => Promise<undefined>;
|
|
17
|
+
removeMany: (payload: unknown, signal?: AbortSignal) => Promise<undefined>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createResourceApi } from '../core/client.js';
|
|
2
|
+
import { withQuery } from '../core/query-builder.js';
|
|
3
|
+
export function createExportsApi(client) {
|
|
4
|
+
return {
|
|
5
|
+
...createResourceApi(client, '/v5/exports'),
|
|
6
|
+
requestExport: (payload) => client.post('/v5/exports', { data: payload }).then(() => undefined),
|
|
7
|
+
panel: (params = {}, signal) => client.get(withQuery('/v5/exports', params), { signal }).then(r => r.data),
|
|
8
|
+
};
|
|
9
|
+
}
|