@tmlmobilidade/types 20250903.2310.20 → 20250903.2354.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/sams/sam.d.ts +12 -10
- package/dist/src/sams/sam.js +1 -1
- package/package.json +1 -1
package/dist/src/sams/sam.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type UnixTimestamp } from '../_common/unix-timestamp.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { SamAnalysis } from './sam-analysis.js';
|
|
3
4
|
export declare const SamSchema: z.ZodObject<{
|
|
4
5
|
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
5
6
|
updated_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
@@ -39,7 +40,7 @@ export declare const SamSchema: z.ZodObject<{
|
|
|
39
40
|
vehicle_id: number | null;
|
|
40
41
|
}>, "many">>;
|
|
41
42
|
latest_apex_version: z.ZodNullable<z.ZodString>;
|
|
42
|
-
remarks: z.ZodString
|
|
43
|
+
remarks: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
43
44
|
seen_first_at: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
|
|
44
45
|
seen_last_at: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
|
|
45
46
|
system_status: z.ZodDefault<z.ZodEnum<["waiting", "processing", "complete", "error"]>>;
|
|
@@ -74,7 +75,7 @@ export declare const SamSchema: z.ZodObject<{
|
|
|
74
75
|
transactions_found: number | null;
|
|
75
76
|
transactions_missing: number | null;
|
|
76
77
|
latest_apex_version: string | null;
|
|
77
|
-
remarks: string;
|
|
78
|
+
remarks: string | null;
|
|
78
79
|
created_at?: (number & {
|
|
79
80
|
__brand: "UnixTimestamp";
|
|
80
81
|
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
@@ -90,7 +91,6 @@ export declare const SamSchema: z.ZodObject<{
|
|
|
90
91
|
transactions_found: number | null;
|
|
91
92
|
transactions_missing: number | null;
|
|
92
93
|
latest_apex_version: string | null;
|
|
93
|
-
remarks: string;
|
|
94
94
|
created_at?: number | null | undefined;
|
|
95
95
|
updated_at?: number | null | undefined;
|
|
96
96
|
analysis?: {
|
|
@@ -104,6 +104,7 @@ export declare const SamSchema: z.ZodObject<{
|
|
|
104
104
|
vehicle_id: number | null;
|
|
105
105
|
}[] | undefined;
|
|
106
106
|
system_status?: "waiting" | "processing" | "complete" | "error" | undefined;
|
|
107
|
+
remarks?: string | null | undefined;
|
|
107
108
|
}>;
|
|
108
109
|
export declare const CreateSamSchema: z.ZodObject<Omit<{
|
|
109
110
|
created_at: z.ZodOptional<z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>>;
|
|
@@ -144,7 +145,7 @@ export declare const CreateSamSchema: z.ZodObject<Omit<{
|
|
|
144
145
|
vehicle_id: number | null;
|
|
145
146
|
}>, "many">>;
|
|
146
147
|
latest_apex_version: z.ZodNullable<z.ZodString>;
|
|
147
|
-
remarks: z.ZodString
|
|
148
|
+
remarks: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
148
149
|
seen_first_at: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
|
|
149
150
|
seen_last_at: z.ZodNullable<z.ZodBranded<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>, "UnixTimestamp">>;
|
|
150
151
|
system_status: z.ZodDefault<z.ZodEnum<["waiting", "processing", "complete", "error"]>>;
|
|
@@ -179,7 +180,7 @@ export declare const CreateSamSchema: z.ZodObject<Omit<{
|
|
|
179
180
|
transactions_found: number | null;
|
|
180
181
|
transactions_missing: number | null;
|
|
181
182
|
latest_apex_version: string | null;
|
|
182
|
-
remarks: string;
|
|
183
|
+
remarks: string | null;
|
|
183
184
|
}, {
|
|
184
185
|
_id: number;
|
|
185
186
|
agency_id: string;
|
|
@@ -189,7 +190,6 @@ export declare const CreateSamSchema: z.ZodObject<Omit<{
|
|
|
189
190
|
transactions_found: number | null;
|
|
190
191
|
transactions_missing: number | null;
|
|
191
192
|
latest_apex_version: string | null;
|
|
192
|
-
remarks: string;
|
|
193
193
|
analysis?: {
|
|
194
194
|
apex_version: string | null;
|
|
195
195
|
device_id: string | null;
|
|
@@ -201,6 +201,7 @@ export declare const CreateSamSchema: z.ZodObject<Omit<{
|
|
|
201
201
|
vehicle_id: number | null;
|
|
202
202
|
}[] | undefined;
|
|
203
203
|
system_status?: "waiting" | "processing" | "complete" | "error" | undefined;
|
|
204
|
+
remarks?: string | null | undefined;
|
|
204
205
|
}>;
|
|
205
206
|
export declare const UpdateSamSchema: z.ZodObject<{
|
|
206
207
|
_id: z.ZodOptional<z.ZodNumber>;
|
|
@@ -244,7 +245,7 @@ export declare const UpdateSamSchema: z.ZodObject<{
|
|
|
244
245
|
transactions_found: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
245
246
|
transactions_missing: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
246
247
|
latest_apex_version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
247
|
-
remarks: z.ZodOptional<z.ZodString
|
|
248
|
+
remarks: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
248
249
|
}, "strict", z.ZodTypeAny, {
|
|
249
250
|
_id?: number | undefined;
|
|
250
251
|
agency_id?: string | undefined;
|
|
@@ -273,7 +274,7 @@ export declare const UpdateSamSchema: z.ZodObject<{
|
|
|
273
274
|
transactions_found?: number | null | undefined;
|
|
274
275
|
transactions_missing?: number | null | undefined;
|
|
275
276
|
latest_apex_version?: string | null | undefined;
|
|
276
|
-
remarks?: string | undefined;
|
|
277
|
+
remarks?: string | null | undefined;
|
|
277
278
|
}, {
|
|
278
279
|
_id?: number | undefined;
|
|
279
280
|
agency_id?: string | undefined;
|
|
@@ -294,7 +295,7 @@ export declare const UpdateSamSchema: z.ZodObject<{
|
|
|
294
295
|
transactions_found?: number | null | undefined;
|
|
295
296
|
transactions_missing?: number | null | undefined;
|
|
296
297
|
latest_apex_version?: string | null | undefined;
|
|
297
|
-
remarks?: string | undefined;
|
|
298
|
+
remarks?: string | null | undefined;
|
|
298
299
|
}>;
|
|
299
300
|
/**
|
|
300
301
|
* SAMs are the chips that contain the keys used to sign APEX transactions.
|
|
@@ -303,7 +304,8 @@ export declare const UpdateSamSchema: z.ZodObject<{
|
|
|
303
304
|
* the transactions are real, unique and incremental. This allows the system to
|
|
304
305
|
* detect if a transaction has been tampered with or if any transactions are missing.
|
|
305
306
|
*/
|
|
306
|
-
export interface Sam extends Omit<z.infer<typeof SamSchema>, 'created_at' | 'seen_first_at' | 'seen_last_at' | 'updated_at'> {
|
|
307
|
+
export interface Sam extends Omit<z.infer<typeof SamSchema>, 'analysis' | 'created_at' | 'seen_first_at' | 'seen_last_at' | 'updated_at'> {
|
|
308
|
+
analysis: SamAnalysis[];
|
|
307
309
|
created_at: UnixTimestamp;
|
|
308
310
|
seen_first_at: null | UnixTimestamp;
|
|
309
311
|
seen_last_at: null | UnixTimestamp;
|
package/dist/src/sams/sam.js
CHANGED
|
@@ -10,7 +10,7 @@ export const SamSchema = DocumentSchema.extend({
|
|
|
10
10
|
agency_id: z.string(),
|
|
11
11
|
analysis: z.array(SamAnalysisSchema).default([]),
|
|
12
12
|
latest_apex_version: z.string().nullable(),
|
|
13
|
-
remarks: z.string(),
|
|
13
|
+
remarks: z.string().nullable().default(null),
|
|
14
14
|
seen_first_at: z.number().transform(validateUnixTimestamp).brand('UnixTimestamp').nullable(),
|
|
15
15
|
seen_last_at: z.number().transform(validateUnixTimestamp).brand('UnixTimestamp').nullable(),
|
|
16
16
|
system_status: ProcessingStatusSchema.default('waiting'),
|
package/package.json
CHANGED