@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.
Files changed (250) hide show
  1. package/README.md +0 -0
  2. package/dist/alerts/api.d.ts +9 -0
  3. package/dist/alerts/api.js +8 -0
  4. package/dist/alerts/index.d.ts +3 -0
  5. package/dist/alerts/index.js +3 -0
  6. package/dist/alerts/schemas.d.ts +65 -0
  7. package/dist/alerts/schemas.js +29 -0
  8. package/dist/alerts/types.d.ts +36 -0
  9. package/dist/alerts/types.js +1 -0
  10. package/dist/auth/api.d.ts +26 -0
  11. package/dist/auth/api.js +39 -0
  12. package/dist/auth/index.d.ts +3 -0
  13. package/dist/auth/index.js +3 -0
  14. package/dist/auth/schemas/access-codes.d.ts +16 -0
  15. package/dist/auth/schemas/access-codes.js +13 -0
  16. package/dist/auth/schemas/login.d.ts +13 -0
  17. package/dist/auth/schemas/login.js +9 -0
  18. package/dist/auth/schemas/passwords.d.ts +81 -0
  19. package/dist/auth/schemas/passwords.js +28 -0
  20. package/dist/auth/schemas/sessions.d.ts +3 -0
  21. package/dist/auth/schemas/sessions.js +2 -0
  22. package/dist/auth/schemas/tokens.d.ts +11 -0
  23. package/dist/auth/schemas/tokens.js +9 -0
  24. package/dist/auth/schemas.d.ts +5 -0
  25. package/dist/auth/schemas.js +5 -0
  26. package/dist/auth/types.d.ts +1 -0
  27. package/dist/auth/types.js +1 -0
  28. package/dist/checklist/api.d.ts +30 -0
  29. package/dist/checklist/api.js +15 -0
  30. package/dist/checklist/index.d.ts +3 -0
  31. package/dist/checklist/index.js +3 -0
  32. package/dist/checklist/schemas.d.ts +62 -0
  33. package/dist/checklist/schemas.js +46 -0
  34. package/dist/checklist/types.d.ts +76 -0
  35. package/dist/checklist/types.js +1 -0
  36. package/dist/chips/api.d.ts +17 -0
  37. package/dist/chips/api.js +8 -0
  38. package/dist/chips/connections/api.d.ts +13 -0
  39. package/dist/chips/connections/api.js +4 -0
  40. package/dist/chips/connections/index.d.ts +3 -0
  41. package/dist/chips/connections/index.js +3 -0
  42. package/dist/chips/connections/schemas.d.ts +31 -0
  43. package/dist/chips/connections/schemas.js +31 -0
  44. package/dist/chips/connections/types.d.ts +26 -0
  45. package/dist/chips/connections/types.js +1 -0
  46. package/dist/chips/index.d.ts +5 -0
  47. package/dist/chips/index.js +5 -0
  48. package/dist/chips/requirements/api.d.ts +13 -0
  49. package/dist/chips/requirements/api.js +4 -0
  50. package/dist/chips/requirements/index.d.ts +3 -0
  51. package/dist/chips/requirements/index.js +3 -0
  52. package/dist/chips/requirements/schemas.d.ts +21 -0
  53. package/dist/chips/requirements/schemas.js +21 -0
  54. package/dist/chips/requirements/types.d.ts +16 -0
  55. package/dist/chips/requirements/types.js +1 -0
  56. package/dist/chips/schemas.d.ts +78 -0
  57. package/dist/chips/schemas.js +72 -0
  58. package/dist/chips/types.d.ts +76 -0
  59. package/dist/chips/types.js +1 -0
  60. package/dist/core/client.d.ts +45 -0
  61. package/dist/core/client.js +42 -0
  62. package/dist/core/index.d.ts +4 -0
  63. package/dist/core/index.js +4 -0
  64. package/dist/core/query-builder.d.ts +34 -0
  65. package/dist/core/query-builder.js +86 -0
  66. package/dist/core/schemas.d.ts +80 -0
  67. package/dist/core/schemas.js +31 -0
  68. package/dist/core/types.d.ts +119 -0
  69. package/dist/core/types.js +2 -0
  70. package/dist/devices/activations/api.d.ts +20 -0
  71. package/dist/devices/activations/api.js +9 -0
  72. package/dist/devices/activations/index.d.ts +3 -0
  73. package/dist/devices/activations/index.js +3 -0
  74. package/dist/devices/activations/schemas.d.ts +42 -0
  75. package/dist/devices/activations/schemas.js +42 -0
  76. package/dist/devices/activations/types.d.ts +75 -0
  77. package/dist/devices/activations/types.js +1 -0
  78. package/dist/devices/api.d.ts +28 -0
  79. package/dist/devices/api.js +11 -0
  80. package/dist/devices/commands/api.d.ts +17 -0
  81. package/dist/devices/commands/api.js +8 -0
  82. package/dist/devices/commands/index.d.ts +3 -0
  83. package/dist/devices/commands/index.js +3 -0
  84. package/dist/devices/commands/schemas.d.ts +39 -0
  85. package/dist/devices/commands/schemas.js +33 -0
  86. package/dist/devices/commands/types.d.ts +58 -0
  87. package/dist/devices/commands/types.js +1 -0
  88. package/dist/devices/index.d.ts +5 -0
  89. package/dist/devices/index.js +5 -0
  90. package/dist/devices/schemas.d.ts +115 -0
  91. package/dist/devices/schemas.js +96 -0
  92. package/dist/devices/types.d.ts +142 -0
  93. package/dist/devices/types.js +1 -0
  94. package/dist/enterprises/api.d.ts +27 -0
  95. package/dist/enterprises/api.js +15 -0
  96. package/dist/enterprises/index.d.ts +3 -0
  97. package/dist/enterprises/index.js +3 -0
  98. package/dist/enterprises/schemas.d.ts +59 -0
  99. package/dist/enterprises/schemas.js +53 -0
  100. package/dist/enterprises/types.d.ts +160 -0
  101. package/dist/enterprises/types.js +1 -0
  102. package/dist/events/api.d.ts +18 -0
  103. package/dist/events/api.js +13 -0
  104. package/dist/events/index.d.ts +3 -0
  105. package/dist/events/index.js +3 -0
  106. package/dist/events/schemas.d.ts +262 -0
  107. package/dist/events/schemas.js +54 -0
  108. package/dist/events/types.d.ts +130 -0
  109. package/dist/events/types.js +1 -0
  110. package/dist/exports/api.d.ts +18 -0
  111. package/dist/exports/api.js +9 -0
  112. package/dist/exports/index.d.ts +3 -0
  113. package/dist/exports/index.js +3 -0
  114. package/dist/exports/schemas.d.ts +27 -0
  115. package/dist/exports/schemas.js +22 -0
  116. package/dist/exports/types.d.ts +47 -0
  117. package/dist/exports/types.js +1 -0
  118. package/dist/fuelings/api.d.ts +22 -0
  119. package/dist/fuelings/api.js +9 -0
  120. package/dist/fuelings/index.d.ts +3 -0
  121. package/dist/fuelings/index.js +3 -0
  122. package/dist/fuelings/schemas.d.ts +84 -0
  123. package/dist/fuelings/schemas.js +52 -0
  124. package/dist/fuelings/types.d.ts +80 -0
  125. package/dist/fuelings/types.js +1 -0
  126. package/dist/index.d.ts +22 -0
  127. package/dist/index.js +22 -0
  128. package/dist/maintenances/api.d.ts +31 -0
  129. package/dist/maintenances/api.js +12 -0
  130. package/dist/maintenances/index.d.ts +3 -0
  131. package/dist/maintenances/index.js +3 -0
  132. package/dist/maintenances/schemas.d.ts +74 -0
  133. package/dist/maintenances/schemas.js +44 -0
  134. package/dist/maintenances/types.d.ts +69 -0
  135. package/dist/maintenances/types.js +1 -0
  136. package/dist/operation-logs/api.d.ts +13 -0
  137. package/dist/operation-logs/api.js +10 -0
  138. package/dist/operation-logs/index.d.ts +3 -0
  139. package/dist/operation-logs/index.js +3 -0
  140. package/dist/operation-logs/schemas.d.ts +34 -0
  141. package/dist/operation-logs/schemas.js +22 -0
  142. package/dist/operation-logs/types.d.ts +32 -0
  143. package/dist/operation-logs/types.js +1 -0
  144. package/dist/protocols/api.d.ts +34 -0
  145. package/dist/protocols/api.js +13 -0
  146. package/dist/protocols/index.d.ts +3 -0
  147. package/dist/protocols/index.js +3 -0
  148. package/dist/protocols/schemas.d.ts +66 -0
  149. package/dist/protocols/schemas.js +36 -0
  150. package/dist/protocols/types.d.ts +99 -0
  151. package/dist/protocols/types.js +1 -0
  152. package/dist/service-orders/api.d.ts +38 -0
  153. package/dist/service-orders/api.js +14 -0
  154. package/dist/service-orders/index.d.ts +3 -0
  155. package/dist/service-orders/index.js +3 -0
  156. package/dist/service-orders/schemas.d.ts +82 -0
  157. package/dist/service-orders/schemas.js +47 -0
  158. package/dist/service-orders/types.d.ts +84 -0
  159. package/dist/service-orders/types.js +1 -0
  160. package/dist/sharings/api.d.ts +17 -0
  161. package/dist/sharings/api.js +8 -0
  162. package/dist/sharings/index.d.ts +3 -0
  163. package/dist/sharings/index.js +3 -0
  164. package/dist/sharings/schemas.d.ts +47 -0
  165. package/dist/sharings/schemas.js +36 -0
  166. package/dist/sharings/types.d.ts +54 -0
  167. package/dist/sharings/types.js +1 -0
  168. package/dist/surveys/api.d.ts +2 -0
  169. package/dist/surveys/api.js +3 -0
  170. package/dist/surveys/index.d.ts +3 -0
  171. package/dist/surveys/index.js +3 -0
  172. package/dist/surveys/schemas.d.ts +33 -0
  173. package/dist/surveys/schemas.js +23 -0
  174. package/dist/surveys/types.d.ts +27 -0
  175. package/dist/surveys/types.js +1 -0
  176. package/dist/tags/api.d.ts +24 -0
  177. package/dist/tags/api.js +28 -0
  178. package/dist/tags/index.d.ts +3 -0
  179. package/dist/tags/index.js +3 -0
  180. package/dist/tags/schemas.d.ts +26 -0
  181. package/dist/tags/schemas.js +19 -0
  182. package/dist/tags/types.d.ts +16 -0
  183. package/dist/tags/types.js +1 -0
  184. package/dist/tracking/api.d.ts +2 -0
  185. package/dist/tracking/api.js +3 -0
  186. package/dist/tracking/index.d.ts +3 -0
  187. package/dist/tracking/index.js +3 -0
  188. package/dist/tracking/schemas.d.ts +12 -0
  189. package/dist/tracking/schemas.js +12 -0
  190. package/dist/tracking/types.d.ts +11 -0
  191. package/dist/tracking/types.js +1 -0
  192. package/dist/trajectories/api.d.ts +27 -0
  193. package/dist/trajectories/api.js +13 -0
  194. package/dist/trajectories/index.d.ts +3 -0
  195. package/dist/trajectories/index.js +3 -0
  196. package/dist/trajectories/schemas.d.ts +39 -0
  197. package/dist/trajectories/schemas.js +30 -0
  198. package/dist/trajectories/types.d.ts +58 -0
  199. package/dist/trajectories/types.js +1 -0
  200. package/dist/trips/api.d.ts +30 -0
  201. package/dist/trips/api.js +12 -0
  202. package/dist/trips/index.d.ts +3 -0
  203. package/dist/trips/index.js +3 -0
  204. package/dist/trips/schemas.d.ts +62 -0
  205. package/dist/trips/schemas.js +36 -0
  206. package/dist/trips/types.d.ts +65 -0
  207. package/dist/trips/types.js +1 -0
  208. package/dist/users/api.d.ts +533 -0
  209. package/dist/users/api.js +102 -0
  210. package/dist/users/configuration/api.d.ts +21 -0
  211. package/dist/users/configuration/api.js +16 -0
  212. package/dist/users/configuration/index.d.ts +3 -0
  213. package/dist/users/configuration/index.js +3 -0
  214. package/dist/users/configuration/schemas.d.ts +91 -0
  215. package/dist/users/configuration/schemas.js +42 -0
  216. package/dist/users/configuration/types.d.ts +36 -0
  217. package/dist/users/configuration/types.js +1 -0
  218. package/dist/users/index.d.ts +4 -0
  219. package/dist/users/index.js +4 -0
  220. package/dist/users/schemas/addresses.d.ts +136 -0
  221. package/dist/users/schemas/addresses.js +94 -0
  222. package/dist/users/schemas/authenticated-user.d.ts +30 -0
  223. package/dist/users/schemas/authenticated-user.js +21 -0
  224. package/dist/users/schemas/common.d.ts +28 -0
  225. package/dist/users/schemas/common.js +26 -0
  226. package/dist/users/schemas/documents.d.ts +40 -0
  227. package/dist/users/schemas/documents.js +53 -0
  228. package/dist/users/schemas/passwords.d.ts +10 -0
  229. package/dist/users/schemas/passwords.js +15 -0
  230. package/dist/users/schemas/roles.d.ts +60 -0
  231. package/dist/users/schemas/roles.js +9 -0
  232. package/dist/users/schemas/sessions.d.ts +84 -0
  233. package/dist/users/schemas/sessions.js +55 -0
  234. package/dist/users/schemas/usernames.d.ts +14 -0
  235. package/dist/users/schemas/usernames.js +12 -0
  236. package/dist/users/schemas/users.d.ts +648 -0
  237. package/dist/users/schemas/users.js +243 -0
  238. package/dist/users/schemas.d.ts +8 -0
  239. package/dist/users/schemas.js +8 -0
  240. package/dist/users/types.d.ts +1 -0
  241. package/dist/users/types.js +1 -0
  242. package/dist/vehicles/api.d.ts +28 -0
  243. package/dist/vehicles/api.js +13 -0
  244. package/dist/vehicles/index.d.ts +3 -0
  245. package/dist/vehicles/index.js +3 -0
  246. package/dist/vehicles/schemas.d.ts +88 -0
  247. package/dist/vehicles/schemas.js +71 -0
  248. package/dist/vehicles/types.d.ts +142 -0
  249. package/dist/vehicles/types.js +1 -0
  250. package/package.json +59 -0
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ export declare const ExportFileSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ attributes: z.ZodObject<{
5
+ meta: z.ZodNullable<z.ZodObject<{
6
+ title: z.ZodNullable<z.ZodString>;
7
+ }, z.core.$strip>>;
8
+ status: z.ZodNullable<z.ZodString>;
9
+ format: z.ZodNullable<z.ZodString>;
10
+ locale: z.ZodNullable<z.ZodString>;
11
+ link: z.ZodNullable<z.ZodString>;
12
+ resource_hierarchy: z.ZodNullable<z.ZodArray<z.ZodObject<{
13
+ model: z.ZodString;
14
+ sub_models: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ }, z.core.$strip>>>;
16
+ created_at: z.ZodNullable<z.ZodString>;
17
+ updated_at: z.ZodNullable<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ relationships: z.ZodObject<{
20
+ enterprise: z.ZodNullable<z.ZodObject<{
21
+ attributes: z.ZodObject<{
22
+ name: z.ZodNullable<z.ZodString>;
23
+ cnpj: z.ZodNullable<z.ZodString>;
24
+ }, z.core.$strip>;
25
+ }, z.core.$strip>>;
26
+ }, z.core.$strip>;
27
+ }, z.core.$strip>;
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ export const ExportFileSchema = z.object({
3
+ id: z.string(),
4
+ attributes: z.object({
5
+ meta: z.object({ title: z.string().nullable() }).nullable(),
6
+ status: z.string().nullable(),
7
+ format: z.string().nullable(),
8
+ locale: z.string().nullable(),
9
+ link: z.string().nullable(),
10
+ resource_hierarchy: z.array(z.object({
11
+ model: z.string(),
12
+ sub_models: z.string().nullable().optional(),
13
+ })).nullable(),
14
+ created_at: z.string().nullable(),
15
+ updated_at: z.string().nullable(),
16
+ }),
17
+ relationships: z.object({
18
+ enterprise: z.object({
19
+ attributes: z.object({ name: z.string().nullable(), cnpj: z.string().nullable() }),
20
+ }).nullable(),
21
+ }),
22
+ });
@@ -0,0 +1,47 @@
1
+ import type { EnterpriseRelAttr, Timestamped } from '../core/types';
2
+ export interface ExportFileAttributes extends Timestamped {
3
+ meta: {
4
+ title: string | null;
5
+ } | null;
6
+ status: string | null;
7
+ format: string | null;
8
+ locale: string | null;
9
+ link: string | null;
10
+ resource_hierarchy: Array<{
11
+ model: string;
12
+ sub_models?: string | null;
13
+ }> | null;
14
+ }
15
+ export interface ExportFile {
16
+ id: string;
17
+ attributes: ExportFileAttributes;
18
+ relationships: {
19
+ enterprise: {
20
+ attributes: Pick<EnterpriseRelAttr, 'name' | 'cnpj'>;
21
+ } | null;
22
+ };
23
+ }
24
+ export interface CreateExportPayload {
25
+ attributes: {
26
+ format: string;
27
+ query: string;
28
+ locale: string;
29
+ resource_hierarchy: Array<{
30
+ model: string;
31
+ sub_models?: string | null;
32
+ }>;
33
+ meta: {
34
+ title: string;
35
+ };
36
+ };
37
+ }
38
+ export interface ExportFilePanelRow {
39
+ attributes: {
40
+ count: string;
41
+ status: string | null;
42
+ format: string | null;
43
+ created_at: {
44
+ day: string;
45
+ } | null;
46
+ };
47
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { ApiClientLike } from '../core/client';
2
+ import type { QueryParams } from '../core/query-builder';
3
+ import type { Document } from '../core/types';
4
+ import type { Fueling, FuelingPanelRow } from './types';
5
+ export declare function createFuelingsApi(client: ApiClientLike): {
6
+ listDocuments: (id: string, params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<{
7
+ data: Document[];
8
+ count: number;
9
+ }>;
10
+ panel: (params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<{
11
+ data: FuelingPanelRow[];
12
+ }>;
13
+ endpoint: string;
14
+ list: <R = Fueling>(params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<import("..").ListResponse<R>>;
15
+ get: <R = Fueling>(id: string, params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<{
16
+ data: R;
17
+ }>;
18
+ create: (payload: unknown) => Promise<undefined>;
19
+ update: (id: string, payload: unknown) => Promise<undefined>;
20
+ remove: (id: string) => Promise<undefined>;
21
+ removeMany: (payload: unknown, signal?: AbortSignal) => Promise<undefined>;
22
+ };
@@ -0,0 +1,9 @@
1
+ import { createResourceApi } from '../core/client.js';
2
+ import { withQuery } from '../core/query-builder.js';
3
+ export function createFuelingsApi(client) {
4
+ return {
5
+ ...createResourceApi(client, '/v5/fuelings'),
6
+ listDocuments: (id, params = {}, signal) => client.get(withQuery(`/v5/fuelings/${id}/documents`, params), { signal }).then(r => r.data),
7
+ panel: (params = {}, signal) => client.get(withQuery('/v5/fuelings', params), { signal }).then(r => r.data),
8
+ };
9
+ }
@@ -0,0 +1,3 @@
1
+ export * from './api';
2
+ export * from './schemas';
3
+ export * from './types';
@@ -0,0 +1,3 @@
1
+ export * from './api.js';
2
+ export * from './schemas.js';
3
+ export * from './types.js';
@@ -0,0 +1,84 @@
1
+ import { z } from 'zod';
2
+ export declare const FuelingEntrySchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ attributes: z.ZodObject<{
5
+ amount: z.ZodNullable<z.ZodNumber>;
6
+ unit_price: z.ZodNullable<z.ZodNumber>;
7
+ total_price: z.ZodNullable<z.ZodNumber>;
8
+ currency: z.ZodNullable<z.ZodString>;
9
+ description: z.ZodNullable<z.ZodString>;
10
+ }, z.core.$strip>;
11
+ }, z.core.$strip>;
12
+ export declare const FuelingSchema: z.ZodObject<{
13
+ id: z.ZodString;
14
+ attributes: z.ZodObject<{
15
+ token: z.ZodNullable<z.ZodString>;
16
+ status: z.ZodNullable<z.ZodString>;
17
+ priority: z.ZodNullable<z.ZodString>;
18
+ description: z.ZodNullable<z.ZodString>;
19
+ notes: z.ZodNullable<z.ZodString>;
20
+ due_date: z.ZodNullable<z.ZodString>;
21
+ total_price: z.ZodNullable<z.ZodNumber>;
22
+ amount: z.ZodNullable<z.ZodNumber>;
23
+ unit: z.ZodNullable<z.ZodString>;
24
+ currency: z.ZodNullable<z.ZodString>;
25
+ created_at: z.ZodNullable<z.ZodString>;
26
+ updated_at: z.ZodNullable<z.ZodString>;
27
+ }, z.core.$strip>;
28
+ relationships: z.ZodObject<{
29
+ enterprise: z.ZodNullable<z.ZodObject<{
30
+ attributes: z.ZodObject<{
31
+ name: z.ZodNullable<z.ZodString>;
32
+ cnpj: z.ZodNullable<z.ZodString>;
33
+ email: z.ZodNullable<z.ZodString>;
34
+ }, z.core.$strip>;
35
+ }, z.core.$strip>>;
36
+ type: z.ZodNullable<z.ZodObject<{
37
+ attributes: z.ZodObject<{
38
+ name: z.ZodNullable<z.ZodString>;
39
+ }, z.core.$strip>;
40
+ }, z.core.$strip>>;
41
+ asset: z.ZodNullable<z.ZodObject<{
42
+ attributes: z.ZodObject<{
43
+ plate: z.ZodNullable<z.ZodString>;
44
+ label: z.ZodNullable<z.ZodString>;
45
+ vin: z.ZodNullable<z.ZodString>;
46
+ type_name: z.ZodNullable<z.ZodString>;
47
+ }, z.core.$strip>;
48
+ }, z.core.$strip>>;
49
+ asset_type: z.ZodNullable<z.ZodObject<{
50
+ attributes: z.ZodObject<{
51
+ name: z.ZodNullable<z.ZodString>;
52
+ }, z.core.$strip>;
53
+ }, z.core.$strip>>;
54
+ assignee: z.ZodNullable<z.ZodObject<{
55
+ attributes: z.ZodObject<{
56
+ name: z.ZodNullable<z.ZodString>;
57
+ email: z.ZodNullable<z.ZodString>;
58
+ phone1: z.ZodNullable<z.ZodString>;
59
+ }, z.core.$strip>;
60
+ }, z.core.$strip>>;
61
+ addresses: z.ZodArray<z.ZodObject<{
62
+ id: z.ZodString;
63
+ attributes: z.ZodObject<{
64
+ formatted_address: z.ZodNullable<z.ZodString>;
65
+ }, z.core.$strip>;
66
+ }, z.core.$strip>>;
67
+ entries: z.ZodArray<z.ZodObject<{
68
+ id: z.ZodString;
69
+ attributes: z.ZodObject<{
70
+ amount: z.ZodNullable<z.ZodNumber>;
71
+ unit_price: z.ZodNullable<z.ZodNumber>;
72
+ total_price: z.ZodNullable<z.ZodNumber>;
73
+ currency: z.ZodNullable<z.ZodString>;
74
+ description: z.ZodNullable<z.ZodString>;
75
+ }, z.core.$strip>;
76
+ }, z.core.$strip>>;
77
+ tags: z.ZodArray<z.ZodObject<{
78
+ id: z.ZodString;
79
+ attributes: z.ZodObject<{
80
+ name: z.ZodString;
81
+ }, z.core.$strip>;
82
+ }, z.core.$strip>>;
83
+ }, z.core.$strip>;
84
+ }, z.core.$strip>;
@@ -0,0 +1,52 @@
1
+ import { z } from 'zod';
2
+ export const FuelingEntrySchema = z.object({
3
+ id: z.string(),
4
+ attributes: z.object({
5
+ amount: z.number().nullable(),
6
+ unit_price: z.number().nullable(),
7
+ total_price: z.number().nullable(),
8
+ currency: z.string().nullable(),
9
+ description: z.string().nullable(),
10
+ }),
11
+ });
12
+ export const FuelingSchema = z.object({
13
+ id: z.string(),
14
+ attributes: z.object({
15
+ token: z.string().nullable(),
16
+ status: z.string().nullable(),
17
+ priority: z.string().nullable(),
18
+ description: z.string().nullable(),
19
+ notes: z.string().nullable(),
20
+ due_date: z.string().nullable(),
21
+ total_price: z.number().nullable(),
22
+ amount: z.number().nullable(),
23
+ unit: z.string().nullable(),
24
+ currency: z.string().nullable(),
25
+ created_at: z.string().nullable(),
26
+ updated_at: z.string().nullable(),
27
+ }),
28
+ relationships: z.object({
29
+ enterprise: z.object({
30
+ attributes: z.object({ name: z.string().nullable(), cnpj: z.string().nullable(), email: z.string().nullable() }),
31
+ }).nullable(),
32
+ type: z.object({ attributes: z.object({ name: z.string().nullable() }) }).nullable(),
33
+ asset: z.object({
34
+ attributes: z.object({
35
+ plate: z.string().nullable(),
36
+ label: z.string().nullable(),
37
+ vin: z.string().nullable(),
38
+ type_name: z.string().nullable(),
39
+ }),
40
+ }).nullable(),
41
+ asset_type: z.object({ attributes: z.object({ name: z.string().nullable() }) }).nullable(),
42
+ assignee: z.object({
43
+ attributes: z.object({ name: z.string().nullable(), email: z.string().nullable(), phone1: z.string().nullable() }),
44
+ }).nullable(),
45
+ addresses: z.array(z.object({
46
+ id: z.string(),
47
+ attributes: z.object({ formatted_address: z.string().nullable() }),
48
+ })),
49
+ entries: z.array(FuelingEntrySchema),
50
+ tags: z.array(z.object({ id: z.string(), attributes: z.object({ name: z.string() }) })),
51
+ }),
52
+ });
@@ -0,0 +1,80 @@
1
+ import type { AssigneeRelAttr, Document, EnterpriseRelAttr, TaskBaseAttributes, TypeRelAttr, VehicleRelAttr } from '../core/types';
2
+ export interface FuelingAttributes extends TaskBaseAttributes {
3
+ due_date: string | null;
4
+ total_price: number | null;
5
+ amount: number | null;
6
+ unit: string | null;
7
+ currency: string | null;
8
+ }
9
+ export interface FuelingEntry {
10
+ id: string;
11
+ attributes: {
12
+ amount: number | null;
13
+ unit_price: number | null;
14
+ total_price: number | null;
15
+ currency: string | null;
16
+ description: string | null;
17
+ };
18
+ }
19
+ export interface Fueling {
20
+ id: string;
21
+ attributes: FuelingAttributes;
22
+ relationships: {
23
+ enterprise: {
24
+ attributes: EnterpriseRelAttr;
25
+ } | null;
26
+ type: {
27
+ attributes: TypeRelAttr;
28
+ } | null;
29
+ asset: {
30
+ attributes: Pick<VehicleRelAttr, 'plate' | 'label' | 'vin' | 'type_name'>;
31
+ } | null;
32
+ asset_type: {
33
+ attributes: TypeRelAttr;
34
+ } | null;
35
+ assignee: {
36
+ attributes: Pick<AssigneeRelAttr, 'name' | 'email' | 'phone1'>;
37
+ } | null;
38
+ addresses: Array<{
39
+ id: string;
40
+ attributes: {
41
+ formatted_address: string | null;
42
+ };
43
+ }>;
44
+ entries: FuelingEntry[];
45
+ tags: Array<{
46
+ id: string;
47
+ attributes: {
48
+ name: string;
49
+ };
50
+ }>;
51
+ };
52
+ }
53
+ export interface FuelingPanelRow {
54
+ attributes: {
55
+ count: string;
56
+ due_date: {
57
+ day: string;
58
+ } | null;
59
+ metric_name: string | null;
60
+ currency: string | null;
61
+ unit: string | null;
62
+ asset: {
63
+ label: string | null;
64
+ } | null;
65
+ asset_type: {
66
+ name: string | null;
67
+ } | null;
68
+ type: {
69
+ name: string | null;
70
+ } | null;
71
+ sum: {
72
+ task_main_fuelings: {
73
+ total_price: string | null;
74
+ amount: string | null;
75
+ consumption: string | null;
76
+ };
77
+ } | null;
78
+ };
79
+ }
80
+ export type { Document };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ export * from './alerts/index';
2
+ export * from './auth/index';
3
+ export * from './checklist/index';
4
+ export * from './chips/index';
5
+ export * from './core/index';
6
+ export * from './devices/index';
7
+ export * from './enterprises/index';
8
+ export * from './events/index';
9
+ export * from './exports/index';
10
+ export * from './fuelings/index';
11
+ export * from './maintenances/index';
12
+ export * from './operation-logs/index';
13
+ export * from './protocols/index';
14
+ export * from './service-orders/index';
15
+ export * from './sharings/index';
16
+ export * from './surveys/index';
17
+ export * from './tags/index';
18
+ export * from './tracking/index';
19
+ export * from './trajectories/index';
20
+ export * from './trips/index';
21
+ export * from './users/index';
22
+ export * from './vehicles/index';
package/dist/index.js ADDED
@@ -0,0 +1,22 @@
1
+ export * from './alerts/index.js';
2
+ export * from './auth/index.js';
3
+ export * from './checklist/index.js';
4
+ export * from './chips/index.js';
5
+ export * from './core/index.js';
6
+ export * from './devices/index.js';
7
+ export * from './enterprises/index.js';
8
+ export * from './events/index.js';
9
+ export * from './exports/index.js';
10
+ export * from './fuelings/index.js';
11
+ export * from './maintenances/index.js';
12
+ export * from './operation-logs/index.js';
13
+ export * from './protocols/index.js';
14
+ export * from './service-orders/index.js';
15
+ export * from './sharings/index.js';
16
+ export * from './surveys/index.js';
17
+ export * from './tags/index.js';
18
+ export * from './tracking/index.js';
19
+ export * from './trajectories/index.js';
20
+ export * from './trips/index.js';
21
+ export * from './users/index.js';
22
+ export * from './vehicles/index.js';
@@ -0,0 +1,31 @@
1
+ import type { ApiClientLike } from '../core/client';
2
+ import type { QueryParams } from '../core/query-builder';
3
+ import type { CustomField, Document, TaskEntry } from '../core/types';
4
+ import type { Maintenance, MaintenancePanelRow } from './types';
5
+ export declare function createMaintenancesApi(client: ApiClientLike): {
6
+ listCustomFields: (id: string, params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<{
7
+ data: CustomField[];
8
+ count: number;
9
+ }>;
10
+ listDocuments: (id: string, params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<{
11
+ data: Document[];
12
+ count: number;
13
+ }>;
14
+ listEntries: (id: string, params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<{
15
+ data: TaskEntry[];
16
+ count: number;
17
+ }>;
18
+ createEntry: (id: string, payload: unknown) => Promise<undefined>;
19
+ panel: (params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<{
20
+ data: MaintenancePanelRow[];
21
+ }>;
22
+ endpoint: string;
23
+ list: <R = Maintenance>(params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<import("..").ListResponse<R>>;
24
+ get: <R = Maintenance>(id: string, params?: Partial<QueryParams>, signal?: AbortSignal) => Promise<{
25
+ data: R;
26
+ }>;
27
+ create: (payload: unknown) => Promise<undefined>;
28
+ update: (id: string, payload: unknown) => Promise<undefined>;
29
+ remove: (id: string) => Promise<undefined>;
30
+ removeMany: (payload: unknown, signal?: AbortSignal) => Promise<undefined>;
31
+ };
@@ -0,0 +1,12 @@
1
+ import { createResourceApi } from '../core/client.js';
2
+ import { withQuery } from '../core/query-builder.js';
3
+ export function createMaintenancesApi(client) {
4
+ return {
5
+ ...createResourceApi(client, '/v5/maintenances'),
6
+ listCustomFields: (id, params = {}, signal) => client.get(withQuery(`/v5/maintenances/${id}/custom-fields`, params), { signal }).then(r => r.data),
7
+ listDocuments: (id, params = {}, signal) => client.get(withQuery(`/v5/maintenances/${id}/documents`, params), { signal }).then(r => r.data),
8
+ listEntries: (id, params = {}, signal) => client.get(withQuery(`/v5/maintenances/${id}/entries`, params), { signal }).then(r => r.data),
9
+ createEntry: (id, payload) => client.post(`/v5/maintenances/${id}/entries`, { data: payload }).then(() => undefined),
10
+ panel: (params = {}, signal) => client.get(withQuery('/v5/maintenances', params), { signal }).then(r => r.data),
11
+ };
12
+ }
@@ -0,0 +1,3 @@
1
+ export * from './api';
2
+ export * from './schemas';
3
+ export * from './types';
@@ -0,0 +1,3 @@
1
+ export * from './api.js';
2
+ export * from './schemas.js';
3
+ export * from './types.js';
@@ -0,0 +1,74 @@
1
+ import { z } from 'zod';
2
+ export declare const MaintenanceSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ attributes: z.ZodObject<{
5
+ name: z.ZodNullable<z.ZodString>;
6
+ token: z.ZodNullable<z.ZodString>;
7
+ status: z.ZodNullable<z.ZodString>;
8
+ priority: z.ZodNullable<z.ZodString>;
9
+ description: z.ZodNullable<z.ZodString>;
10
+ notes: z.ZodNullable<z.ZodString>;
11
+ due_date: z.ZodNullable<z.ZodString>;
12
+ start_at: z.ZodNullable<z.ZodString>;
13
+ end_at: z.ZodNullable<z.ZodString>;
14
+ total_price: z.ZodNullable<z.ZodNumber>;
15
+ schedule_config: z.ZodNullable<z.ZodObject<{
16
+ scheduleInDays: z.ZodNullable<z.ZodNumber>;
17
+ scheduleDistanceInKm: z.ZodNullable<z.ZodNumber>;
18
+ scheduleDurationInHours: z.ZodNullable<z.ZodNumber>;
19
+ }, z.core.$strip>>;
20
+ created_at: z.ZodNullable<z.ZodString>;
21
+ updated_at: z.ZodNullable<z.ZodString>;
22
+ }, z.core.$strip>;
23
+ relationships: z.ZodObject<{
24
+ enterprise: z.ZodNullable<z.ZodObject<{
25
+ attributes: z.ZodObject<{
26
+ name: z.ZodNullable<z.ZodString>;
27
+ cnpj: z.ZodNullable<z.ZodString>;
28
+ email: z.ZodNullable<z.ZodString>;
29
+ }, z.core.$strip>;
30
+ }, z.core.$strip>>;
31
+ type: z.ZodNullable<z.ZodObject<{
32
+ attributes: z.ZodObject<{
33
+ name: z.ZodNullable<z.ZodString>;
34
+ }, z.core.$strip>;
35
+ }, z.core.$strip>>;
36
+ section: z.ZodNullable<z.ZodObject<{
37
+ attributes: z.ZodObject<{
38
+ name: z.ZodNullable<z.ZodString>;
39
+ }, z.core.$strip>;
40
+ }, z.core.$strip>>;
41
+ asset: z.ZodNullable<z.ZodObject<{
42
+ attributes: z.ZodObject<{
43
+ plate: z.ZodNullable<z.ZodString>;
44
+ vin: z.ZodNullable<z.ZodString>;
45
+ label: z.ZodNullable<z.ZodString>;
46
+ }, z.core.$strip>;
47
+ }, z.core.$strip>>;
48
+ assignee: z.ZodNullable<z.ZodObject<{
49
+ attributes: z.ZodObject<{
50
+ name: z.ZodNullable<z.ZodString>;
51
+ email: z.ZodNullable<z.ZodString>;
52
+ phone1: z.ZodNullable<z.ZodString>;
53
+ phone2: z.ZodNullable<z.ZodString>;
54
+ }, z.core.$strip>;
55
+ }, z.core.$strip>>;
56
+ addresses: z.ZodArray<z.ZodObject<{
57
+ id: z.ZodString;
58
+ attributes: z.ZodObject<{
59
+ formatted_address: z.ZodNullable<z.ZodString>;
60
+ }, z.core.$strip>;
61
+ }, z.core.$strip>>;
62
+ completion: z.ZodNullable<z.ZodObject<{
63
+ attributes: z.ZodObject<{
64
+ completed_at: z.ZodNullable<z.ZodString>;
65
+ }, z.core.$strip>;
66
+ }, z.core.$strip>>;
67
+ tags: z.ZodArray<z.ZodObject<{
68
+ id: z.ZodString;
69
+ attributes: z.ZodObject<{
70
+ name: z.ZodString;
71
+ }, z.core.$strip>;
72
+ }, z.core.$strip>>;
73
+ }, z.core.$strip>;
74
+ }, z.core.$strip>;
@@ -0,0 +1,44 @@
1
+ import { z } from 'zod';
2
+ export const MaintenanceSchema = z.object({
3
+ id: z.string(),
4
+ attributes: z.object({
5
+ name: z.string().nullable(),
6
+ token: z.string().nullable(),
7
+ status: z.string().nullable(),
8
+ priority: z.string().nullable(),
9
+ description: z.string().nullable(),
10
+ notes: z.string().nullable(),
11
+ due_date: z.string().nullable(),
12
+ start_at: z.string().nullable(),
13
+ end_at: z.string().nullable(),
14
+ total_price: z.number().nullable(),
15
+ schedule_config: z.object({
16
+ scheduleInDays: z.number().nullable(),
17
+ scheduleDistanceInKm: z.number().nullable(),
18
+ scheduleDurationInHours: z.number().nullable(),
19
+ }).nullable(),
20
+ created_at: z.string().nullable(),
21
+ updated_at: z.string().nullable(),
22
+ }),
23
+ relationships: z.object({
24
+ enterprise: z.object({
25
+ attributes: z.object({ name: z.string().nullable(), cnpj: z.string().nullable(), email: z.string().nullable() }),
26
+ }).nullable(),
27
+ type: z.object({ attributes: z.object({ name: z.string().nullable() }) }).nullable(),
28
+ section: z.object({ attributes: z.object({ name: z.string().nullable() }) }).nullable(),
29
+ asset: z.object({
30
+ attributes: z.object({ plate: z.string().nullable(), vin: z.string().nullable(), label: z.string().nullable() }),
31
+ }).nullable(),
32
+ assignee: z.object({
33
+ attributes: z.object({
34
+ name: z.string().nullable(),
35
+ email: z.string().nullable(),
36
+ phone1: z.string().nullable(),
37
+ phone2: z.string().nullable(),
38
+ }),
39
+ }).nullable(),
40
+ addresses: z.array(z.object({ id: z.string(), attributes: z.object({ formatted_address: z.string().nullable() }) })),
41
+ completion: z.object({ attributes: z.object({ completed_at: z.string().nullable() }) }).nullable(),
42
+ tags: z.array(z.object({ id: z.string(), attributes: z.object({ name: z.string() }) })),
43
+ }),
44
+ });
@@ -0,0 +1,69 @@
1
+ import type { AssigneeRelAttr, CompletionRelAttr, CustomField, Document, EnterpriseRelAttr, SectionRelAttr, TaskBaseAttributes, TaskEntry, TypeRelAttr, VehicleRelAttr } from '../core/types';
2
+ export interface MaintenanceAttributes extends TaskBaseAttributes {
3
+ name: string | null;
4
+ due_date: string | null;
5
+ start_at: string | null;
6
+ end_at: string | null;
7
+ total_price: number | null;
8
+ schedule_config: {
9
+ scheduleInDays: number | null;
10
+ scheduleDistanceInKm: number | null;
11
+ scheduleDurationInHours: number | null;
12
+ } | null;
13
+ }
14
+ export interface Maintenance {
15
+ id: string;
16
+ attributes: MaintenanceAttributes;
17
+ relationships: {
18
+ enterprise: {
19
+ attributes: EnterpriseRelAttr;
20
+ } | null;
21
+ type: {
22
+ attributes: TypeRelAttr;
23
+ } | null;
24
+ section: {
25
+ attributes: SectionRelAttr;
26
+ } | null;
27
+ asset: {
28
+ attributes: Pick<VehicleRelAttr, 'plate' | 'vin' | 'label'>;
29
+ } | null;
30
+ assignee: {
31
+ attributes: AssigneeRelAttr;
32
+ } | null;
33
+ addresses: Array<{
34
+ id: string;
35
+ attributes: {
36
+ formatted_address: string | null;
37
+ };
38
+ }>;
39
+ completion: {
40
+ attributes: CompletionRelAttr;
41
+ } | null;
42
+ tags: Array<{
43
+ id: string;
44
+ attributes: {
45
+ name: string;
46
+ };
47
+ }>;
48
+ };
49
+ }
50
+ export interface MaintenancePanelRow {
51
+ attributes: {
52
+ count: string;
53
+ start_at: {
54
+ day: string;
55
+ } | null;
56
+ type: {
57
+ name: string | null;
58
+ } | null;
59
+ asset: {
60
+ label: string | null;
61
+ } | null;
62
+ sum: {
63
+ entries: {
64
+ total_price: string | null;
65
+ };
66
+ } | null;
67
+ };
68
+ }
69
+ export type { CustomField, Document, TaskEntry };
@@ -0,0 +1 @@
1
+ export {};