@tmlmobilidade/types 20250910.1541.13 → 20250911.1325.18
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/_common/operational-date.d.ts +1 -1
- package/dist/src/_common/operational-date.js +1 -2
- package/dist/src/_common/proposed-change.d.ts +9 -31
- package/dist/src/_common/proposed-change.js +5 -14
- package/dist/src/agency.d.ts +10 -21
- package/dist/src/agency.js +1 -1
- package/dist/src/alert.d.ts +32 -58
- package/dist/src/alert.js +8 -48
- package/dist/src/auth/login.js +2 -8
- package/dist/src/auth/role.d.ts +6 -13
- package/dist/src/auth/role.js +1 -1
- package/dist/src/auth/session.d.ts +13 -29
- package/dist/src/auth/session.js +3 -3
- package/dist/src/auth/user.d.ts +13 -32
- package/dist/src/auth/user.js +3 -3
- package/dist/src/auth/verification-token.d.ts +13 -25
- package/dist/src/auth/verification-token.js +3 -3
- package/dist/src/gtfs.d.ts +6 -17
- package/dist/src/organization.d.ts +1 -4
- package/dist/src/organization.js +1 -1
- package/dist/src/plans/gtfs-validation.d.ts +25 -63
- package/dist/src/plans/gtfs-validation.js +2 -6
- package/dist/src/plans/plan-controller.d.ts +3 -8
- package/dist/src/plans/plan-controller.js +2 -2
- package/dist/src/plans/plan.d.ts +34 -86
- package/dist/src/plans/plan.js +2 -6
- package/dist/src/rides/ride-audit.d.ts +52 -1168
- package/dist/src/rides/ride-audit.js +3 -5
- package/dist/src/rides/ride-justification.d.ts +84 -9
- package/dist/src/rides/ride-justification.js +4 -1
- package/dist/src/rides/ride.d.ts +54 -105
- package/dist/src/rides/ride.js +8 -8
- package/dist/src/sams/sam-analysis.d.ts +5 -13
- package/dist/src/sams/sam-analysis.js +3 -3
- package/dist/src/sams/sam.d.ts +37 -88
- package/dist/src/sams/sam.js +4 -4
- package/dist/src/simplified-apex/simplified-apex-location.d.ts +16 -23
- package/dist/src/simplified-apex/simplified-apex-location.js +2 -2
- package/dist/src/simplified-apex/simplified-apex-on-board-refund.d.ts +16 -23
- package/dist/src/simplified-apex/simplified-apex-on-board-refund.js +2 -2
- package/dist/src/simplified-apex/simplified-apex-on-board-sale.d.ts +27 -37
- package/dist/src/simplified-apex/simplified-apex-on-board-sale.js +3 -3
- package/dist/src/simplified-apex/simplified-apex-validation.d.ts +16 -23
- package/dist/src/simplified-apex/simplified-apex-validation.js +2 -2
- package/dist/src/stop.d.ts +68 -86
- package/dist/src/stop.js +11 -74
- package/dist/src/vehicle-event.d.ts +7 -12
- package/dist/src/vehicle-event.js +2 -2
- package/dist/src/zone.d.ts +0 -3
- package/dist/src/zone.js +1 -1
- package/package.json +1 -1
package/dist/src/rides/ride.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { DocumentSchema } from '../_common/document.js';
|
|
3
3
|
import { validateOperationalDate } from '../_common/operational-date.js';
|
|
4
|
-
import {
|
|
4
|
+
import { unixTimeStampSchema } from '../_common/unix-timestamp.js';
|
|
5
5
|
import { atLeastOneVehicleEventOnFirstStopSchema, endedAtLastStopSchema, expectedApexValidationIntervalSchema, expectedDriverIdQtySchema, expectedStartTimeSchema, expectedVehicleEventDelaySchema, expectedVehicleEventIntervalSchema, expectedVehicleEventQtySchema, expectedVehicleIdQtySchema, matchingApexLocationsSchema, matchingVehicleIdsSchema, simpleOneApexValidationSchema, simpleOneVehicleEventOrApexValidationSchema, simpleThreeVehicleEventsSchema, transactionSequentialitySchema } from './ride-analysis.js';
|
|
6
6
|
import { ProcessingStatusSchema } from '../system/processing-status.js';
|
|
7
7
|
import { z } from 'zod';
|
|
@@ -32,8 +32,8 @@ export const RideSchema = DocumentSchema.extend({
|
|
|
32
32
|
apex_on_board_sales_qty: z.number().nullable(),
|
|
33
33
|
apex_validations_qty: z.number().nullable(),
|
|
34
34
|
driver_ids: z.array(z.string()),
|
|
35
|
-
end_time_observed:
|
|
36
|
-
end_time_scheduled:
|
|
35
|
+
end_time_observed: unixTimeStampSchema.nullable(),
|
|
36
|
+
end_time_scheduled: unixTimeStampSchema,
|
|
37
37
|
extension_observed: z.number().nullable(),
|
|
38
38
|
extension_scheduled: z.number(),
|
|
39
39
|
hashed_shape_id: z.string(),
|
|
@@ -51,16 +51,16 @@ export const RideSchema = DocumentSchema.extend({
|
|
|
51
51
|
pattern_id: z.string(),
|
|
52
52
|
plan_id: z.string(),
|
|
53
53
|
route_id: z.string(),
|
|
54
|
-
seen_first_at:
|
|
55
|
-
seen_last_at:
|
|
56
|
-
start_time_observed:
|
|
57
|
-
start_time_scheduled:
|
|
54
|
+
seen_first_at: unixTimeStampSchema.nullable(),
|
|
55
|
+
seen_last_at: unixTimeStampSchema.nullable(),
|
|
56
|
+
start_time_observed: unixTimeStampSchema.nullable(),
|
|
57
|
+
start_time_scheduled: unixTimeStampSchema,
|
|
58
58
|
system_status: ProcessingStatusSchema.default('waiting'),
|
|
59
59
|
trip_id: z.string(),
|
|
60
60
|
vehicle_ids: z.array(z.number()),
|
|
61
61
|
}).strip();
|
|
62
62
|
export const CreateRideSchema = RideSchema.partial({ _id: true }).omit({ created_at: true, updated_at: true });
|
|
63
|
-
export const UpdateRideSchema = CreateRideSchema.partial();
|
|
63
|
+
export const UpdateRideSchema = CreateRideSchema.omit({ created_by: true }).partial();
|
|
64
64
|
/* * */
|
|
65
65
|
export const RidePermissionSchema = z.object({
|
|
66
66
|
agency_ids: z.array(z.string()),
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { type UnixTimestamp } from '../_common/unix-timestamp.js';
|
|
2
1
|
import { z } from 'zod';
|
|
3
2
|
export declare const SamAnalysisSchema: z.ZodObject<{
|
|
4
3
|
apex_version: z.ZodNullable<z.ZodString>;
|
|
5
4
|
device_id: z.ZodNullable<z.ZodString>;
|
|
6
|
-
end_time: z.ZodNullable<z.
|
|
5
|
+
end_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
7
6
|
first_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
|
|
8
7
|
first_transaction_id: z.ZodNullable<z.ZodString>;
|
|
9
8
|
first_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
|
|
10
9
|
last_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
|
|
11
10
|
last_transaction_id: z.ZodNullable<z.ZodString>;
|
|
12
11
|
last_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
|
|
13
|
-
start_time: z.ZodNullable<z.
|
|
12
|
+
start_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
14
13
|
transactions_expected: z.ZodNullable<z.ZodNumber>;
|
|
15
14
|
transactions_found: z.ZodNullable<z.ZodNumber>;
|
|
16
15
|
transactions_missing: z.ZodNullable<z.ZodNumber>;
|
|
@@ -18,18 +17,14 @@ export declare const SamAnalysisSchema: z.ZodObject<{
|
|
|
18
17
|
}, "strict", z.ZodTypeAny, {
|
|
19
18
|
apex_version: string | null;
|
|
20
19
|
device_id: string | null;
|
|
21
|
-
end_time: (
|
|
22
|
-
__brand: "UnixTimestamp";
|
|
23
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
20
|
+
end_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
24
21
|
first_transaction_ase_counter_value: number | null;
|
|
25
22
|
first_transaction_id: string | null;
|
|
26
23
|
first_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
27
24
|
last_transaction_ase_counter_value: number | null;
|
|
28
25
|
last_transaction_id: string | null;
|
|
29
26
|
last_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
30
|
-
start_time: (
|
|
31
|
-
__brand: "UnixTimestamp";
|
|
32
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
27
|
+
start_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
33
28
|
transactions_expected: number | null;
|
|
34
29
|
transactions_found: number | null;
|
|
35
30
|
transactions_missing: number | null;
|
|
@@ -50,7 +45,4 @@ export declare const SamAnalysisSchema: z.ZodObject<{
|
|
|
50
45
|
transactions_missing: number | null;
|
|
51
46
|
vehicle_id: number | null;
|
|
52
47
|
}>;
|
|
53
|
-
export
|
|
54
|
-
end_time: null | UnixTimestamp;
|
|
55
|
-
start_time: null | UnixTimestamp;
|
|
56
|
-
}
|
|
48
|
+
export type SamAnalysis = z.infer<typeof SamAnalysisSchema>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/* * */
|
|
2
|
-
import {
|
|
2
|
+
import { unixTimeStampSchema } from '../_common/unix-timestamp.js';
|
|
3
3
|
import { SimplifiedApexTypeSchema } from '../simplified-apex/simplified-apex-type.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
/* * */
|
|
6
6
|
export const SamAnalysisSchema = z.object({
|
|
7
7
|
apex_version: z.string().nullable(),
|
|
8
8
|
device_id: z.string().nullable(),
|
|
9
|
-
end_time:
|
|
9
|
+
end_time: unixTimeStampSchema.nullable(),
|
|
10
10
|
first_transaction_ase_counter_value: z.number().nullable(),
|
|
11
11
|
first_transaction_id: z.string().nullable(),
|
|
12
12
|
first_transaction_type: SimplifiedApexTypeSchema.nullable(),
|
|
13
13
|
last_transaction_ase_counter_value: z.number().nullable(),
|
|
14
14
|
last_transaction_id: z.string().nullable(),
|
|
15
15
|
last_transaction_type: SimplifiedApexTypeSchema.nullable(),
|
|
16
|
-
start_time:
|
|
16
|
+
start_time: unixTimeStampSchema.nullable(),
|
|
17
17
|
transactions_expected: z.number().nullable(),
|
|
18
18
|
transactions_found: z.number().nullable(),
|
|
19
19
|
transactions_missing: z.number().nullable(),
|
package/dist/src/sams/sam.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { type UnixTimestamp } from '../_common/unix-timestamp.js';
|
|
2
|
-
import { type SamAnalysis } from './sam-analysis.js';
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
export declare const SamSchema: z.ZodObject<{
|
|
5
|
-
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
3
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
6
4
|
created_by: z.ZodDefault<z.ZodString>;
|
|
7
|
-
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
5
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
8
6
|
updated_by: z.ZodDefault<z.ZodString>;
|
|
9
7
|
} & {
|
|
10
8
|
_id: z.ZodNumber;
|
|
@@ -12,14 +10,14 @@ export declare const SamSchema: z.ZodObject<{
|
|
|
12
10
|
analysis: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
13
11
|
apex_version: z.ZodNullable<z.ZodString>;
|
|
14
12
|
device_id: z.ZodNullable<z.ZodString>;
|
|
15
|
-
end_time: z.ZodNullable<z.
|
|
13
|
+
end_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
16
14
|
first_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
|
|
17
15
|
first_transaction_id: z.ZodNullable<z.ZodString>;
|
|
18
16
|
first_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
|
|
19
17
|
last_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
|
|
20
18
|
last_transaction_id: z.ZodNullable<z.ZodString>;
|
|
21
19
|
last_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
|
|
22
|
-
start_time: z.ZodNullable<z.
|
|
20
|
+
start_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
23
21
|
transactions_expected: z.ZodNullable<z.ZodNumber>;
|
|
24
22
|
transactions_found: z.ZodNullable<z.ZodNumber>;
|
|
25
23
|
transactions_missing: z.ZodNullable<z.ZodNumber>;
|
|
@@ -27,18 +25,14 @@ export declare const SamSchema: z.ZodObject<{
|
|
|
27
25
|
}, "strict", z.ZodTypeAny, {
|
|
28
26
|
apex_version: string | null;
|
|
29
27
|
device_id: string | null;
|
|
30
|
-
end_time: (
|
|
31
|
-
__brand: "UnixTimestamp";
|
|
32
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
28
|
+
end_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
33
29
|
first_transaction_ase_counter_value: number | null;
|
|
34
30
|
first_transaction_id: string | null;
|
|
35
31
|
first_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
36
32
|
last_transaction_ase_counter_value: number | null;
|
|
37
33
|
last_transaction_id: string | null;
|
|
38
34
|
last_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
39
|
-
start_time: (
|
|
40
|
-
__brand: "UnixTimestamp";
|
|
41
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
35
|
+
start_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
42
36
|
transactions_expected: number | null;
|
|
43
37
|
transactions_found: number | null;
|
|
44
38
|
transactions_missing: number | null;
|
|
@@ -61,8 +55,8 @@ export declare const SamSchema: z.ZodObject<{
|
|
|
61
55
|
}>, "many">>;
|
|
62
56
|
latest_apex_version: z.ZodNullable<z.ZodString>;
|
|
63
57
|
remarks: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
64
|
-
seen_first_at: z.ZodNullable<z.
|
|
65
|
-
seen_last_at: z.ZodNullable<z.
|
|
58
|
+
seen_first_at: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
59
|
+
seen_last_at: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
66
60
|
system_status: z.ZodDefault<z.ZodEnum<["waiting", "processing", "complete", "error"]>>;
|
|
67
61
|
transactions_expected: z.ZodNullable<z.ZodNumber>;
|
|
68
62
|
transactions_found: z.ZodNullable<z.ZodNumber>;
|
|
@@ -81,29 +75,21 @@ export declare const SamSchema: z.ZodObject<{
|
|
|
81
75
|
analysis: {
|
|
82
76
|
apex_version: string | null;
|
|
83
77
|
device_id: string | null;
|
|
84
|
-
end_time: (
|
|
85
|
-
__brand: "UnixTimestamp";
|
|
86
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
78
|
+
end_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
87
79
|
first_transaction_ase_counter_value: number | null;
|
|
88
80
|
first_transaction_id: string | null;
|
|
89
81
|
first_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
90
82
|
last_transaction_ase_counter_value: number | null;
|
|
91
83
|
last_transaction_id: string | null;
|
|
92
84
|
last_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
93
|
-
start_time: (
|
|
94
|
-
__brand: "UnixTimestamp";
|
|
95
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
85
|
+
start_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
96
86
|
transactions_expected: number | null;
|
|
97
87
|
transactions_found: number | null;
|
|
98
88
|
transactions_missing: number | null;
|
|
99
89
|
vehicle_id: number | null;
|
|
100
90
|
}[];
|
|
101
|
-
seen_first_at: (
|
|
102
|
-
|
|
103
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
104
|
-
seen_last_at: (number & {
|
|
105
|
-
__brand: "UnixTimestamp";
|
|
106
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
91
|
+
seen_first_at: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
92
|
+
seen_last_at: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
107
93
|
system_status: "waiting" | "processing" | "complete" | "error";
|
|
108
94
|
transactions_expected: number | null;
|
|
109
95
|
transactions_found: number | null;
|
|
@@ -143,9 +129,9 @@ export declare const SamSchema: z.ZodObject<{
|
|
|
143
129
|
remarks?: string | null | undefined;
|
|
144
130
|
}>;
|
|
145
131
|
export declare const CreateSamSchema: z.ZodObject<Omit<{
|
|
146
|
-
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
132
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
147
133
|
created_by: z.ZodDefault<z.ZodString>;
|
|
148
|
-
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
134
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
149
135
|
updated_by: z.ZodDefault<z.ZodString>;
|
|
150
136
|
} & {
|
|
151
137
|
_id: z.ZodNumber;
|
|
@@ -153,14 +139,14 @@ export declare const CreateSamSchema: z.ZodObject<Omit<{
|
|
|
153
139
|
analysis: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
154
140
|
apex_version: z.ZodNullable<z.ZodString>;
|
|
155
141
|
device_id: z.ZodNullable<z.ZodString>;
|
|
156
|
-
end_time: z.ZodNullable<z.
|
|
142
|
+
end_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
157
143
|
first_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
|
|
158
144
|
first_transaction_id: z.ZodNullable<z.ZodString>;
|
|
159
145
|
first_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
|
|
160
146
|
last_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
|
|
161
147
|
last_transaction_id: z.ZodNullable<z.ZodString>;
|
|
162
148
|
last_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
|
|
163
|
-
start_time: z.ZodNullable<z.
|
|
149
|
+
start_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
164
150
|
transactions_expected: z.ZodNullable<z.ZodNumber>;
|
|
165
151
|
transactions_found: z.ZodNullable<z.ZodNumber>;
|
|
166
152
|
transactions_missing: z.ZodNullable<z.ZodNumber>;
|
|
@@ -168,18 +154,14 @@ export declare const CreateSamSchema: z.ZodObject<Omit<{
|
|
|
168
154
|
}, "strict", z.ZodTypeAny, {
|
|
169
155
|
apex_version: string | null;
|
|
170
156
|
device_id: string | null;
|
|
171
|
-
end_time: (
|
|
172
|
-
__brand: "UnixTimestamp";
|
|
173
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
157
|
+
end_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
174
158
|
first_transaction_ase_counter_value: number | null;
|
|
175
159
|
first_transaction_id: string | null;
|
|
176
160
|
first_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
177
161
|
last_transaction_ase_counter_value: number | null;
|
|
178
162
|
last_transaction_id: string | null;
|
|
179
163
|
last_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
180
|
-
start_time: (
|
|
181
|
-
__brand: "UnixTimestamp";
|
|
182
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
164
|
+
start_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
183
165
|
transactions_expected: number | null;
|
|
184
166
|
transactions_found: number | null;
|
|
185
167
|
transactions_missing: number | null;
|
|
@@ -202,8 +184,8 @@ export declare const CreateSamSchema: z.ZodObject<Omit<{
|
|
|
202
184
|
}>, "many">>;
|
|
203
185
|
latest_apex_version: z.ZodNullable<z.ZodString>;
|
|
204
186
|
remarks: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
205
|
-
seen_first_at: z.ZodNullable<z.
|
|
206
|
-
seen_last_at: z.ZodNullable<z.
|
|
187
|
+
seen_first_at: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
188
|
+
seen_last_at: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
207
189
|
system_status: z.ZodDefault<z.ZodEnum<["waiting", "processing", "complete", "error"]>>;
|
|
208
190
|
transactions_expected: z.ZodNullable<z.ZodNumber>;
|
|
209
191
|
transactions_found: z.ZodNullable<z.ZodNumber>;
|
|
@@ -216,29 +198,21 @@ export declare const CreateSamSchema: z.ZodObject<Omit<{
|
|
|
216
198
|
analysis: {
|
|
217
199
|
apex_version: string | null;
|
|
218
200
|
device_id: string | null;
|
|
219
|
-
end_time: (
|
|
220
|
-
__brand: "UnixTimestamp";
|
|
221
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
201
|
+
end_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
222
202
|
first_transaction_ase_counter_value: number | null;
|
|
223
203
|
first_transaction_id: string | null;
|
|
224
204
|
first_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
225
205
|
last_transaction_ase_counter_value: number | null;
|
|
226
206
|
last_transaction_id: string | null;
|
|
227
207
|
last_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
228
|
-
start_time: (
|
|
229
|
-
__brand: "UnixTimestamp";
|
|
230
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
208
|
+
start_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
231
209
|
transactions_expected: number | null;
|
|
232
210
|
transactions_found: number | null;
|
|
233
211
|
transactions_missing: number | null;
|
|
234
212
|
vehicle_id: number | null;
|
|
235
213
|
}[];
|
|
236
|
-
seen_first_at: (
|
|
237
|
-
|
|
238
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
239
|
-
seen_last_at: (number & {
|
|
240
|
-
__brand: "UnixTimestamp";
|
|
241
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
214
|
+
seen_first_at: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
215
|
+
seen_last_at: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
242
216
|
system_status: "waiting" | "processing" | "complete" | "error";
|
|
243
217
|
transactions_expected: number | null;
|
|
244
218
|
transactions_found: number | null;
|
|
@@ -277,20 +251,19 @@ export declare const CreateSamSchema: z.ZodObject<Omit<{
|
|
|
277
251
|
}>;
|
|
278
252
|
export declare const UpdateSamSchema: z.ZodObject<{
|
|
279
253
|
_id: z.ZodOptional<z.ZodNumber>;
|
|
280
|
-
created_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
281
254
|
updated_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
282
255
|
agency_id: z.ZodOptional<z.ZodString>;
|
|
283
256
|
analysis: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
284
257
|
apex_version: z.ZodNullable<z.ZodString>;
|
|
285
258
|
device_id: z.ZodNullable<z.ZodString>;
|
|
286
|
-
end_time: z.ZodNullable<z.
|
|
259
|
+
end_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
287
260
|
first_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
|
|
288
261
|
first_transaction_id: z.ZodNullable<z.ZodString>;
|
|
289
262
|
first_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
|
|
290
263
|
last_transaction_ase_counter_value: z.ZodNullable<z.ZodNumber>;
|
|
291
264
|
last_transaction_id: z.ZodNullable<z.ZodString>;
|
|
292
265
|
last_transaction_type: z.ZodNullable<z.ZodEnum<["location", "on_board_refund", "on_board_sale", "validation"]>>;
|
|
293
|
-
start_time: z.ZodNullable<z.
|
|
266
|
+
start_time: z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
294
267
|
transactions_expected: z.ZodNullable<z.ZodNumber>;
|
|
295
268
|
transactions_found: z.ZodNullable<z.ZodNumber>;
|
|
296
269
|
transactions_missing: z.ZodNullable<z.ZodNumber>;
|
|
@@ -298,18 +271,14 @@ export declare const UpdateSamSchema: z.ZodObject<{
|
|
|
298
271
|
}, "strict", z.ZodTypeAny, {
|
|
299
272
|
apex_version: string | null;
|
|
300
273
|
device_id: string | null;
|
|
301
|
-
end_time: (
|
|
302
|
-
__brand: "UnixTimestamp";
|
|
303
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
274
|
+
end_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
304
275
|
first_transaction_ase_counter_value: number | null;
|
|
305
276
|
first_transaction_id: string | null;
|
|
306
277
|
first_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
307
278
|
last_transaction_ase_counter_value: number | null;
|
|
308
279
|
last_transaction_id: string | null;
|
|
309
280
|
last_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
310
|
-
start_time: (
|
|
311
|
-
__brand: "UnixTimestamp";
|
|
312
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
281
|
+
start_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
313
282
|
transactions_expected: number | null;
|
|
314
283
|
transactions_found: number | null;
|
|
315
284
|
transactions_missing: number | null;
|
|
@@ -330,8 +299,8 @@ export declare const UpdateSamSchema: z.ZodObject<{
|
|
|
330
299
|
transactions_missing: number | null;
|
|
331
300
|
vehicle_id: number | null;
|
|
332
301
|
}>, "many">>>;
|
|
333
|
-
seen_first_at: z.ZodOptional<z.ZodNullable<z.
|
|
334
|
-
seen_last_at: z.ZodOptional<z.ZodNullable<z.
|
|
302
|
+
seen_first_at: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
|
|
303
|
+
seen_last_at: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
|
|
335
304
|
system_status: z.ZodOptional<z.ZodDefault<z.ZodEnum<["waiting", "processing", "complete", "error"]>>>;
|
|
336
305
|
transactions_expected: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
337
306
|
transactions_found: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -340,35 +309,26 @@ export declare const UpdateSamSchema: z.ZodObject<{
|
|
|
340
309
|
remarks: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
341
310
|
}, "strict", z.ZodTypeAny, {
|
|
342
311
|
_id?: number | undefined;
|
|
343
|
-
created_by?: string | undefined;
|
|
344
312
|
updated_by?: string | undefined;
|
|
345
313
|
agency_id?: string | undefined;
|
|
346
314
|
analysis?: {
|
|
347
315
|
apex_version: string | null;
|
|
348
316
|
device_id: string | null;
|
|
349
|
-
end_time: (
|
|
350
|
-
__brand: "UnixTimestamp";
|
|
351
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
317
|
+
end_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
352
318
|
first_transaction_ase_counter_value: number | null;
|
|
353
319
|
first_transaction_id: string | null;
|
|
354
320
|
first_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
355
321
|
last_transaction_ase_counter_value: number | null;
|
|
356
322
|
last_transaction_id: string | null;
|
|
357
323
|
last_transaction_type: "validation" | "location" | "on_board_refund" | "on_board_sale" | null;
|
|
358
|
-
start_time: (
|
|
359
|
-
__brand: "UnixTimestamp";
|
|
360
|
-
} & z.BRAND<"UnixTimestamp">) | null;
|
|
324
|
+
start_time: import("../_common/unix-timestamp.js").UnixTimestamp | null;
|
|
361
325
|
transactions_expected: number | null;
|
|
362
326
|
transactions_found: number | null;
|
|
363
327
|
transactions_missing: number | null;
|
|
364
328
|
vehicle_id: number | null;
|
|
365
329
|
}[] | undefined;
|
|
366
|
-
seen_first_at?: (
|
|
367
|
-
|
|
368
|
-
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
369
|
-
seen_last_at?: (number & {
|
|
370
|
-
__brand: "UnixTimestamp";
|
|
371
|
-
} & z.BRAND<"UnixTimestamp">) | null | undefined;
|
|
330
|
+
seen_first_at?: import("../_common/unix-timestamp.js").UnixTimestamp | null | undefined;
|
|
331
|
+
seen_last_at?: import("../_common/unix-timestamp.js").UnixTimestamp | null | undefined;
|
|
372
332
|
system_status?: "waiting" | "processing" | "complete" | "error" | undefined;
|
|
373
333
|
transactions_expected?: number | null | undefined;
|
|
374
334
|
transactions_found?: number | null | undefined;
|
|
@@ -377,7 +337,6 @@ export declare const UpdateSamSchema: z.ZodObject<{
|
|
|
377
337
|
remarks?: string | null | undefined;
|
|
378
338
|
}, {
|
|
379
339
|
_id?: number | undefined;
|
|
380
|
-
created_by?: string | undefined;
|
|
381
340
|
updated_by?: string | undefined;
|
|
382
341
|
agency_id?: string | undefined;
|
|
383
342
|
analysis?: {
|
|
@@ -412,16 +371,6 @@ export declare const UpdateSamSchema: z.ZodObject<{
|
|
|
412
371
|
* the transactions are real, unique and incremental. This allows the system to
|
|
413
372
|
* detect if a transaction has been tampered with or if any transactions are missing.
|
|
414
373
|
*/
|
|
415
|
-
export
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
seen_first_at: null | UnixTimestamp;
|
|
419
|
-
seen_last_at: null | UnixTimestamp;
|
|
420
|
-
updated_at: UnixTimestamp;
|
|
421
|
-
}
|
|
422
|
-
export interface CreateSamDto extends Omit<z.infer<typeof CreateSamSchema>, 'analysis' | 'seen_first_at' | 'seen_last_at'> {
|
|
423
|
-
analysis: SamAnalysis[];
|
|
424
|
-
seen_first_at: null | UnixTimestamp;
|
|
425
|
-
seen_last_at: null | UnixTimestamp;
|
|
426
|
-
}
|
|
427
|
-
export type UpdateSamDto = Partial<CreateSamDto>;
|
|
374
|
+
export type Sam = z.infer<typeof SamSchema>;
|
|
375
|
+
export type CreateSamDto = z.infer<typeof CreateSamSchema>;
|
|
376
|
+
export type UpdateSamDto = z.infer<typeof UpdateSamSchema>;
|
package/dist/src/sams/sam.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { DocumentSchema } from '../_common/document.js';
|
|
3
|
-
import {
|
|
3
|
+
import { unixTimeStampSchema } from '../_common/unix-timestamp.js';
|
|
4
4
|
import { SamAnalysisSchema } from './sam-analysis.js';
|
|
5
5
|
import { ProcessingStatusSchema } from '../system/processing-status.js';
|
|
6
6
|
import { z } from 'zod';
|
|
@@ -11,12 +11,12 @@ export const SamSchema = DocumentSchema.extend({
|
|
|
11
11
|
analysis: z.array(SamAnalysisSchema).default([]),
|
|
12
12
|
latest_apex_version: z.string().nullable(),
|
|
13
13
|
remarks: z.string().nullable().default(null),
|
|
14
|
-
seen_first_at:
|
|
15
|
-
seen_last_at:
|
|
14
|
+
seen_first_at: unixTimeStampSchema.nullable(),
|
|
15
|
+
seen_last_at: unixTimeStampSchema.nullable(),
|
|
16
16
|
system_status: ProcessingStatusSchema.default('waiting'),
|
|
17
17
|
transactions_expected: z.number().nullable(),
|
|
18
18
|
transactions_found: z.number().nullable(),
|
|
19
19
|
transactions_missing: z.number().nullable(),
|
|
20
20
|
}).strict();
|
|
21
21
|
export const CreateSamSchema = SamSchema.omit({ created_at: true, updated_at: true });
|
|
22
|
-
export const UpdateSamSchema = CreateSamSchema.partial();
|
|
22
|
+
export const UpdateSamSchema = CreateSamSchema.omit({ created_by: true }).partial();
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { type UnixTimestamp } from '../_common/unix-timestamp.js';
|
|
2
1
|
import { z } from 'zod';
|
|
3
2
|
export declare const SimplifiedApexLocationSchema: z.ZodObject<{
|
|
4
3
|
_id: z.ZodString;
|
|
5
|
-
created_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
4
|
+
created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
6
5
|
created_by: z.ZodDefault<z.ZodString>;
|
|
7
|
-
updated_at: z.ZodEffects<z.ZodNumber, UnixTimestamp, number>;
|
|
6
|
+
updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
8
7
|
updated_by: z.ZodDefault<z.ZodString>;
|
|
9
8
|
} & {
|
|
10
9
|
agency_id: z.ZodString;
|
|
@@ -14,7 +13,7 @@ export declare const SimplifiedApexLocationSchema: z.ZodObject<{
|
|
|
14
13
|
mac_ase_counter_value: z.ZodNumber;
|
|
15
14
|
mac_sam_serial_number: z.ZodNumber;
|
|
16
15
|
pattern_id: z.ZodString;
|
|
17
|
-
received_at: z.
|
|
16
|
+
received_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
|
|
18
17
|
stop_id: z.ZodString;
|
|
19
18
|
trip_id: z.ZodString;
|
|
20
19
|
vehicle_id: z.ZodNumber;
|
|
@@ -30,8 +29,8 @@ export declare const SimplifiedApexLocationSchema: z.ZodObject<{
|
|
|
30
29
|
updated_by: string;
|
|
31
30
|
agency_id: string;
|
|
32
31
|
line_id: string;
|
|
33
|
-
pattern_id: string;
|
|
34
32
|
trip_id: string;
|
|
33
|
+
pattern_id: string;
|
|
35
34
|
apex_version: string;
|
|
36
35
|
device_id: string;
|
|
37
36
|
vehicle_id: number;
|
|
@@ -39,7 +38,7 @@ export declare const SimplifiedApexLocationSchema: z.ZodObject<{
|
|
|
39
38
|
mac_sam_serial_number: number;
|
|
40
39
|
received_at: number & {
|
|
41
40
|
__brand: "UnixTimestamp";
|
|
42
|
-
}
|
|
41
|
+
};
|
|
43
42
|
stop_id: string;
|
|
44
43
|
}, {
|
|
45
44
|
_id: string;
|
|
@@ -47,8 +46,8 @@ export declare const SimplifiedApexLocationSchema: z.ZodObject<{
|
|
|
47
46
|
updated_at: number;
|
|
48
47
|
agency_id: string;
|
|
49
48
|
line_id: string;
|
|
50
|
-
pattern_id: string;
|
|
51
49
|
trip_id: string;
|
|
50
|
+
pattern_id: string;
|
|
52
51
|
apex_version: string;
|
|
53
52
|
device_id: string;
|
|
54
53
|
vehicle_id: number;
|
|
@@ -61,9 +60,9 @@ export declare const SimplifiedApexLocationSchema: z.ZodObject<{
|
|
|
61
60
|
}>;
|
|
62
61
|
export declare const UpdateSimplifiedApexLocationSchema: z.ZodObject<{
|
|
63
62
|
_id: z.ZodOptional<z.ZodString>;
|
|
64
|
-
created_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>>;
|
|
63
|
+
created_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
65
64
|
created_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
66
|
-
updated_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, UnixTimestamp, number>>;
|
|
65
|
+
updated_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
67
66
|
updated_by: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
68
67
|
agency_id: z.ZodOptional<z.ZodString>;
|
|
69
68
|
apex_version: z.ZodOptional<z.ZodString>;
|
|
@@ -72,28 +71,26 @@ export declare const UpdateSimplifiedApexLocationSchema: z.ZodObject<{
|
|
|
72
71
|
mac_ase_counter_value: z.ZodOptional<z.ZodNumber>;
|
|
73
72
|
mac_sam_serial_number: z.ZodOptional<z.ZodNumber>;
|
|
74
73
|
pattern_id: z.ZodOptional<z.ZodString>;
|
|
75
|
-
received_at: z.ZodOptional<z.
|
|
74
|
+
received_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>;
|
|
76
75
|
stop_id: z.ZodOptional<z.ZodString>;
|
|
77
76
|
trip_id: z.ZodOptional<z.ZodString>;
|
|
78
77
|
vehicle_id: z.ZodOptional<z.ZodNumber>;
|
|
79
78
|
}, "strict", z.ZodTypeAny, {
|
|
80
79
|
_id?: string | undefined;
|
|
81
|
-
created_at?: UnixTimestamp | undefined;
|
|
80
|
+
created_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
|
|
82
81
|
created_by?: string | undefined;
|
|
83
|
-
updated_at?: UnixTimestamp | undefined;
|
|
82
|
+
updated_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
|
|
84
83
|
updated_by?: string | undefined;
|
|
85
84
|
agency_id?: string | undefined;
|
|
86
85
|
line_id?: string | undefined;
|
|
87
|
-
pattern_id?: string | undefined;
|
|
88
86
|
trip_id?: string | undefined;
|
|
87
|
+
pattern_id?: string | undefined;
|
|
89
88
|
apex_version?: string | undefined;
|
|
90
89
|
device_id?: string | undefined;
|
|
91
90
|
vehicle_id?: number | undefined;
|
|
92
91
|
mac_ase_counter_value?: number | undefined;
|
|
93
92
|
mac_sam_serial_number?: number | undefined;
|
|
94
|
-
received_at?: (
|
|
95
|
-
__brand: "UnixTimestamp";
|
|
96
|
-
} & z.BRAND<"UnixTimestamp">) | undefined;
|
|
93
|
+
received_at?: import("../_common/unix-timestamp.js").UnixTimestamp | undefined;
|
|
97
94
|
stop_id?: string | undefined;
|
|
98
95
|
}, {
|
|
99
96
|
_id?: string | undefined;
|
|
@@ -103,8 +100,8 @@ export declare const UpdateSimplifiedApexLocationSchema: z.ZodObject<{
|
|
|
103
100
|
updated_by?: string | undefined;
|
|
104
101
|
agency_id?: string | undefined;
|
|
105
102
|
line_id?: string | undefined;
|
|
106
|
-
pattern_id?: string | undefined;
|
|
107
103
|
trip_id?: string | undefined;
|
|
104
|
+
pattern_id?: string | undefined;
|
|
108
105
|
apex_version?: string | undefined;
|
|
109
106
|
device_id?: string | undefined;
|
|
110
107
|
vehicle_id?: number | undefined;
|
|
@@ -120,9 +117,5 @@ export declare const UpdateSimplifiedApexLocationSchema: z.ZodObject<{
|
|
|
120
117
|
* of products. In summary, these transactions are generated every time the vehicle has a change
|
|
121
118
|
* in the current stop ID, trip ID, route ID, pattern ID, etc.
|
|
122
119
|
*/
|
|
123
|
-
export
|
|
124
|
-
|
|
125
|
-
received_at: UnixTimestamp;
|
|
126
|
-
updated_at: UnixTimestamp;
|
|
127
|
-
}
|
|
128
|
-
export type UpdateSimplifiedApexLocationDto = Partial<SimplifiedApexLocation>;
|
|
120
|
+
export type SimplifiedApexLocation = z.infer<typeof SimplifiedApexLocationSchema>;
|
|
121
|
+
export type UpdateSimplifiedApexLocationDto = z.infer<typeof UpdateSimplifiedApexLocationSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { DocumentSchema } from '../_common/document.js';
|
|
3
|
-
import {
|
|
3
|
+
import { unixTimeStampSchema } from '../_common/unix-timestamp.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
/* * */
|
|
6
6
|
export const SimplifiedApexLocationSchema = DocumentSchema.extend({
|
|
@@ -11,7 +11,7 @@ export const SimplifiedApexLocationSchema = DocumentSchema.extend({
|
|
|
11
11
|
mac_ase_counter_value: z.number(),
|
|
12
12
|
mac_sam_serial_number: z.number(),
|
|
13
13
|
pattern_id: z.string(),
|
|
14
|
-
received_at:
|
|
14
|
+
received_at: unixTimeStampSchema,
|
|
15
15
|
stop_id: z.string(),
|
|
16
16
|
trip_id: z.string(),
|
|
17
17
|
vehicle_id: z.number(),
|