@tmlmobilidade/go-types-apex 20260611.1527.25
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/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/raw/banking-taps/banking-tap-v4-0.d.ts +669 -0
- package/dist/raw/banking-taps/banking-tap-v4-0.js +65 -0
- package/dist/raw/banking-taps/index.d.ts +1 -0
- package/dist/raw/banking-taps/index.js +1 -0
- package/dist/raw/index.d.ts +7 -0
- package/dist/raw/index.js +7 -0
- package/dist/raw/inspections/index.d.ts +2 -0
- package/dist/raw/inspections/index.js +2 -0
- package/dist/raw/inspections/inspection-decision-v2-0.d.ts +481 -0
- package/dist/raw/inspections/inspection-decision-v2-0.js +49 -0
- package/dist/raw/inspections/inspection-v2-0.d.ts +961 -0
- package/dist/raw/inspections/inspection-v2-0.js +89 -0
- package/dist/raw/locations/index.d.ts +1 -0
- package/dist/raw/locations/index.js +1 -0
- package/dist/raw/locations/location-v3-0.d.ts +645 -0
- package/dist/raw/locations/location-v3-0.js +63 -0
- package/dist/raw/raw-apex-transaction-base.d.ts +30 -0
- package/dist/raw/raw-apex-transaction-base.js +13 -0
- package/dist/raw/raw-apex-transaction.d.ts +3662 -0
- package/dist/raw/raw-apex-transaction.js +21 -0
- package/dist/raw/sales/index.d.ts +2 -0
- package/dist/raw/sales/index.js +2 -0
- package/dist/raw/sales/refund-v3-0.d.ts +769 -0
- package/dist/raw/sales/refund-v3-0.js +74 -0
- package/dist/raw/sales/sale-v3-0.d.ts +757 -0
- package/dist/raw/sales/sale-v3-0.js +73 -0
- package/dist/raw/validations/index.d.ts +2 -0
- package/dist/raw/validations/index.js +2 -0
- package/dist/raw/validations/validation-v2-0.d.ts +901 -0
- package/dist/raw/validations/validation-v2-0.js +85 -0
- package/dist/raw/validations/validation-v3-0.d.ts +901 -0
- package/dist/raw/validations/validation-v3-0.js +85 -0
- package/dist/simplified/any-simplified-apex.d.ts +8 -0
- package/dist/simplified/any-simplified-apex.js +2 -0
- package/dist/simplified/apex-validation-status.d.ts +145 -0
- package/dist/simplified/apex-validation-status.js +76 -0
- package/dist/simplified/index.d.ts +10 -0
- package/dist/simplified/index.js +10 -0
- package/dist/simplified/simplified-apex-banking-taps.d.ts +81 -0
- package/dist/simplified/simplified-apex-banking-taps.js +27 -0
- package/dist/simplified/simplified-apex-inspection-decision.d.ts +55 -0
- package/dist/simplified/simplified-apex-inspection-decision.js +18 -0
- package/dist/simplified/simplified-apex-inspection.d.ts +82 -0
- package/dist/simplified/simplified-apex-inspection.js +27 -0
- package/dist/simplified/simplified-apex-location.d.ts +112 -0
- package/dist/simplified/simplified-apex-location.js +20 -0
- package/dist/simplified/simplified-apex-on-board-refund.d.ts +172 -0
- package/dist/simplified/simplified-apex-on-board-refund.js +30 -0
- package/dist/simplified/simplified-apex-on-board-sale.d.ts +178 -0
- package/dist/simplified/simplified-apex-on-board-sale.js +31 -0
- package/dist/simplified/simplified-apex-type.d.ts +9 -0
- package/dist/simplified/simplified-apex-type.js +5 -0
- package/dist/simplified/simplified-apex-validation.d.ts +200 -0
- package/dist/simplified/simplified-apex-validation.js +41 -0
- package/package.json +49 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SimplifiedApexValidationSchema: z.ZodObject<{
|
|
3
|
+
_id: z.ZodString;
|
|
4
|
+
agency_id: z.ZodString;
|
|
5
|
+
apex_version: z.ZodString;
|
|
6
|
+
card_serial_number: z.ZodString;
|
|
7
|
+
category: z.ZodNullable<z.ZodEnum<["prepaid", "subscription", "on_board_sale"]>>;
|
|
8
|
+
created_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared").UnixTimestamp, number>;
|
|
9
|
+
device_id: z.ZodString;
|
|
10
|
+
event_type: z.ZodNumber;
|
|
11
|
+
is_ok: z.ZodBoolean;
|
|
12
|
+
is_ok_pcgi: z.ZodBoolean;
|
|
13
|
+
is_passenger: z.ZodBoolean;
|
|
14
|
+
line_id: z.ZodString;
|
|
15
|
+
mac_ase_counter_value: z.ZodNumber;
|
|
16
|
+
mac_sam_serial_number: z.ZodNumber;
|
|
17
|
+
on_board_refund_id: z.ZodNullable<z.ZodString>;
|
|
18
|
+
on_board_sale_id: z.ZodNullable<z.ZodString>;
|
|
19
|
+
pattern_id: z.ZodString;
|
|
20
|
+
product_id: z.ZodString;
|
|
21
|
+
received_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared").UnixTimestamp, number>;
|
|
22
|
+
stop_id: z.ZodString;
|
|
23
|
+
trip_id: z.ZodString;
|
|
24
|
+
units_qty: z.ZodNullable<z.ZodNumber>;
|
|
25
|
+
validation_status: z.ZodNativeEnum<{
|
|
26
|
+
readonly _0_ContractValid: 0;
|
|
27
|
+
readonly _1_Antipassback: 1;
|
|
28
|
+
readonly _2_CardInBlackList: 2;
|
|
29
|
+
readonly _3_SamInBlackList: 3;
|
|
30
|
+
readonly _4_CardInWhiteList: 4;
|
|
31
|
+
readonly _5_ProfileInWhiteList: 5;
|
|
32
|
+
readonly _6_Interchange: 6;
|
|
33
|
+
readonly _7_Interrupted: 7;
|
|
34
|
+
readonly _8_NoValidContract: 8;
|
|
35
|
+
readonly _9_CardInvalidated: 9;
|
|
36
|
+
readonly _10_EventsFull: 10;
|
|
37
|
+
readonly _11_NotEnoughUnits: 11;
|
|
38
|
+
readonly _12_ContractExpired: 12;
|
|
39
|
+
readonly _13_MaxValue: 13;
|
|
40
|
+
}>;
|
|
41
|
+
vehicle_id: z.ZodNumber;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
_id: string;
|
|
44
|
+
agency_id: string;
|
|
45
|
+
created_at: number & {
|
|
46
|
+
__brand: "UnixTimestamp";
|
|
47
|
+
};
|
|
48
|
+
is_ok: boolean;
|
|
49
|
+
received_at: number & {
|
|
50
|
+
__brand: "UnixTimestamp";
|
|
51
|
+
};
|
|
52
|
+
apex_version: string;
|
|
53
|
+
device_id: string;
|
|
54
|
+
event_type: number;
|
|
55
|
+
is_ok_pcgi: boolean;
|
|
56
|
+
line_id: string;
|
|
57
|
+
mac_ase_counter_value: number;
|
|
58
|
+
mac_sam_serial_number: number;
|
|
59
|
+
pattern_id: string;
|
|
60
|
+
product_id: string;
|
|
61
|
+
stop_id: string;
|
|
62
|
+
trip_id: string;
|
|
63
|
+
units_qty: number | null;
|
|
64
|
+
vehicle_id: number;
|
|
65
|
+
card_serial_number: string;
|
|
66
|
+
on_board_sale_id: string | null;
|
|
67
|
+
is_passenger: boolean;
|
|
68
|
+
on_board_refund_id: string | null;
|
|
69
|
+
category: "prepaid" | "subscription" | "on_board_sale" | null;
|
|
70
|
+
validation_status: 0 | 1 | 2 | 6 | 3 | 8 | 4 | 5 | 7 | 9 | 10 | 11 | 12 | 13;
|
|
71
|
+
}, {
|
|
72
|
+
_id: string;
|
|
73
|
+
agency_id: string;
|
|
74
|
+
created_at: number;
|
|
75
|
+
is_ok: boolean;
|
|
76
|
+
received_at: number;
|
|
77
|
+
apex_version: string;
|
|
78
|
+
device_id: string;
|
|
79
|
+
event_type: number;
|
|
80
|
+
is_ok_pcgi: boolean;
|
|
81
|
+
line_id: string;
|
|
82
|
+
mac_ase_counter_value: number;
|
|
83
|
+
mac_sam_serial_number: number;
|
|
84
|
+
pattern_id: string;
|
|
85
|
+
product_id: string;
|
|
86
|
+
stop_id: string;
|
|
87
|
+
trip_id: string;
|
|
88
|
+
units_qty: number | null;
|
|
89
|
+
vehicle_id: number;
|
|
90
|
+
card_serial_number: string;
|
|
91
|
+
on_board_sale_id: string | null;
|
|
92
|
+
is_passenger: boolean;
|
|
93
|
+
on_board_refund_id: string | null;
|
|
94
|
+
category: "prepaid" | "subscription" | "on_board_sale" | null;
|
|
95
|
+
validation_status: 0 | 1 | 2 | 6 | 3 | 8 | 4 | 5 | 7 | 9 | 10 | 11 | 12 | 13;
|
|
96
|
+
}>;
|
|
97
|
+
export declare const UpdateSimplifiedApexValidationSchema: z.ZodObject<{
|
|
98
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
99
|
+
agency_id: z.ZodOptional<z.ZodString>;
|
|
100
|
+
apex_version: z.ZodOptional<z.ZodString>;
|
|
101
|
+
card_serial_number: z.ZodOptional<z.ZodString>;
|
|
102
|
+
category: z.ZodOptional<z.ZodNullable<z.ZodEnum<["prepaid", "subscription", "on_board_sale"]>>>;
|
|
103
|
+
created_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared").UnixTimestamp, number>>;
|
|
104
|
+
device_id: z.ZodOptional<z.ZodString>;
|
|
105
|
+
event_type: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
is_ok: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
is_ok_pcgi: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
is_passenger: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
line_id: z.ZodOptional<z.ZodString>;
|
|
110
|
+
mac_ase_counter_value: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
mac_sam_serial_number: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
on_board_refund_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
113
|
+
on_board_sale_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
+
pattern_id: z.ZodOptional<z.ZodString>;
|
|
115
|
+
product_id: z.ZodOptional<z.ZodString>;
|
|
116
|
+
received_at: z.ZodOptional<z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared").UnixTimestamp, number>>;
|
|
117
|
+
stop_id: z.ZodOptional<z.ZodString>;
|
|
118
|
+
trip_id: z.ZodOptional<z.ZodString>;
|
|
119
|
+
units_qty: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
120
|
+
validation_status: z.ZodOptional<z.ZodNativeEnum<{
|
|
121
|
+
readonly _0_ContractValid: 0;
|
|
122
|
+
readonly _1_Antipassback: 1;
|
|
123
|
+
readonly _2_CardInBlackList: 2;
|
|
124
|
+
readonly _3_SamInBlackList: 3;
|
|
125
|
+
readonly _4_CardInWhiteList: 4;
|
|
126
|
+
readonly _5_ProfileInWhiteList: 5;
|
|
127
|
+
readonly _6_Interchange: 6;
|
|
128
|
+
readonly _7_Interrupted: 7;
|
|
129
|
+
readonly _8_NoValidContract: 8;
|
|
130
|
+
readonly _9_CardInvalidated: 9;
|
|
131
|
+
readonly _10_EventsFull: 10;
|
|
132
|
+
readonly _11_NotEnoughUnits: 11;
|
|
133
|
+
readonly _12_ContractExpired: 12;
|
|
134
|
+
readonly _13_MaxValue: 13;
|
|
135
|
+
}>>;
|
|
136
|
+
vehicle_id: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
_id?: string | undefined;
|
|
139
|
+
agency_id?: string | undefined;
|
|
140
|
+
created_at?: import("@tmlmobilidade/go-types-shared").UnixTimestamp | undefined;
|
|
141
|
+
is_ok?: boolean | undefined;
|
|
142
|
+
received_at?: import("@tmlmobilidade/go-types-shared").UnixTimestamp | undefined;
|
|
143
|
+
apex_version?: string | undefined;
|
|
144
|
+
device_id?: string | undefined;
|
|
145
|
+
event_type?: number | undefined;
|
|
146
|
+
is_ok_pcgi?: boolean | undefined;
|
|
147
|
+
line_id?: string | undefined;
|
|
148
|
+
mac_ase_counter_value?: number | undefined;
|
|
149
|
+
mac_sam_serial_number?: number | undefined;
|
|
150
|
+
pattern_id?: string | undefined;
|
|
151
|
+
product_id?: string | undefined;
|
|
152
|
+
stop_id?: string | undefined;
|
|
153
|
+
trip_id?: string | undefined;
|
|
154
|
+
units_qty?: number | null | undefined;
|
|
155
|
+
vehicle_id?: number | undefined;
|
|
156
|
+
card_serial_number?: string | undefined;
|
|
157
|
+
on_board_sale_id?: string | null | undefined;
|
|
158
|
+
is_passenger?: boolean | undefined;
|
|
159
|
+
on_board_refund_id?: string | null | undefined;
|
|
160
|
+
category?: "prepaid" | "subscription" | "on_board_sale" | null | undefined;
|
|
161
|
+
validation_status?: 0 | 1 | 2 | 6 | 3 | 8 | 4 | 5 | 7 | 9 | 10 | 11 | 12 | 13 | undefined;
|
|
162
|
+
}, {
|
|
163
|
+
_id?: string | undefined;
|
|
164
|
+
agency_id?: string | undefined;
|
|
165
|
+
created_at?: number | undefined;
|
|
166
|
+
is_ok?: boolean | undefined;
|
|
167
|
+
received_at?: number | undefined;
|
|
168
|
+
apex_version?: string | undefined;
|
|
169
|
+
device_id?: string | undefined;
|
|
170
|
+
event_type?: number | undefined;
|
|
171
|
+
is_ok_pcgi?: boolean | undefined;
|
|
172
|
+
line_id?: string | undefined;
|
|
173
|
+
mac_ase_counter_value?: number | undefined;
|
|
174
|
+
mac_sam_serial_number?: number | undefined;
|
|
175
|
+
pattern_id?: string | undefined;
|
|
176
|
+
product_id?: string | undefined;
|
|
177
|
+
stop_id?: string | undefined;
|
|
178
|
+
trip_id?: string | undefined;
|
|
179
|
+
units_qty?: number | null | undefined;
|
|
180
|
+
vehicle_id?: number | undefined;
|
|
181
|
+
card_serial_number?: string | undefined;
|
|
182
|
+
on_board_sale_id?: string | null | undefined;
|
|
183
|
+
is_passenger?: boolean | undefined;
|
|
184
|
+
on_board_refund_id?: string | null | undefined;
|
|
185
|
+
category?: "prepaid" | "subscription" | "on_board_sale" | null | undefined;
|
|
186
|
+
validation_status?: 0 | 1 | 2 | 6 | 3 | 8 | 4 | 5 | 7 | 9 | 10 | 11 | 12 | 13 | undefined;
|
|
187
|
+
}>;
|
|
188
|
+
/**
|
|
189
|
+
* APEX Validations are APEX transactions of type 11 that are generated when a card holder touches a validator
|
|
190
|
+
* reader (ex: bus validator, subway gate). These validation transactions represent the card holder's right to travel
|
|
191
|
+
* on a given route, line, or vehicle. T11s have statuses that indicate if the card holder was allowed to travel
|
|
192
|
+
* or not, and with which conditions. A validation also contains information about the card holder's card, the vehicle,
|
|
193
|
+
* the validator machine, the route, and the time and location of the validation.
|
|
194
|
+
*/
|
|
195
|
+
export type SimplifiedApexValidation = z.infer<typeof SimplifiedApexValidationSchema>;
|
|
196
|
+
export type UpdateSimplifiedApexValidationDto = z.infer<typeof UpdateSimplifiedApexValidationSchema>;
|
|
197
|
+
/**
|
|
198
|
+
* Validation statuses that are considered valid for the card holder to travel.
|
|
199
|
+
*/
|
|
200
|
+
export declare const ALLOWED_VALIDATION_STATUSES: (0 | 6 | 4 | 5)[];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { ApexValidationStatus, ApexValidationStatusSchema } from './apex-validation-status.js';
|
|
3
|
+
import { UnixTimestampSchema } from '@tmlmobilidade/go-types-shared';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/* * */
|
|
6
|
+
export const SimplifiedApexValidationSchema = z.object({
|
|
7
|
+
_id: z.string(),
|
|
8
|
+
agency_id: z.string(),
|
|
9
|
+
apex_version: z.string(),
|
|
10
|
+
card_serial_number: z.string(),
|
|
11
|
+
category: z.enum(['prepaid', 'subscription', 'on_board_sale']).nullable(),
|
|
12
|
+
created_at: UnixTimestampSchema,
|
|
13
|
+
device_id: z.string(),
|
|
14
|
+
event_type: z.number(),
|
|
15
|
+
is_ok: z.boolean(),
|
|
16
|
+
is_ok_pcgi: z.boolean(),
|
|
17
|
+
is_passenger: z.boolean(),
|
|
18
|
+
line_id: z.string(),
|
|
19
|
+
mac_ase_counter_value: z.number(),
|
|
20
|
+
mac_sam_serial_number: z.number(),
|
|
21
|
+
on_board_refund_id: z.string().nullable(),
|
|
22
|
+
on_board_sale_id: z.string().nullable(),
|
|
23
|
+
pattern_id: z.string(),
|
|
24
|
+
product_id: z.string(),
|
|
25
|
+
received_at: UnixTimestampSchema,
|
|
26
|
+
stop_id: z.string(),
|
|
27
|
+
trip_id: z.string(),
|
|
28
|
+
units_qty: z.number().nullable(),
|
|
29
|
+
validation_status: ApexValidationStatusSchema,
|
|
30
|
+
vehicle_id: z.number(),
|
|
31
|
+
});
|
|
32
|
+
export const UpdateSimplifiedApexValidationSchema = SimplifiedApexValidationSchema.partial();
|
|
33
|
+
/**
|
|
34
|
+
* Validation statuses that are considered valid for the card holder to travel.
|
|
35
|
+
*/
|
|
36
|
+
export const ALLOWED_VALIDATION_STATUSES = [
|
|
37
|
+
ApexValidationStatus._0_ContractValid,
|
|
38
|
+
ApexValidationStatus._4_CardInWhiteList,
|
|
39
|
+
ApexValidationStatus._5_ProfileInWhiteList,
|
|
40
|
+
ApexValidationStatus._6_Interchange,
|
|
41
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tmlmobilidade/go-types-apex",
|
|
3
|
+
"version": "20260611.1527.25",
|
|
4
|
+
"author": {
|
|
5
|
+
"email": "iso@tmlmobilidade.pt",
|
|
6
|
+
"name": "TML-ISO"
|
|
7
|
+
},
|
|
8
|
+
"license": "AGPL-3.0-or-later",
|
|
9
|
+
"homepage": "https://go.tmlmobilidade.pt",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/tmlmobilidade/go/issues"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/tmlmobilidade/go.git"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"public transit",
|
|
19
|
+
"tml",
|
|
20
|
+
"transportes metropolitanos de lisboa",
|
|
21
|
+
"go"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc && resolve-tspaths",
|
|
34
|
+
"lint": "eslint ./src/ && tsc --noEmit",
|
|
35
|
+
"lint:fix": "eslint ./src/ --fix",
|
|
36
|
+
"watch": "tsc-watch --onSuccess 'resolve-tspaths'"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@tmlmobilidade/go-types-shared": "*",
|
|
40
|
+
"zod": "3.25.76"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@tmlmobilidade/tsconfig": "*",
|
|
44
|
+
"@types/node": "25.9.3",
|
|
45
|
+
"resolve-tspaths": "0.8.23",
|
|
46
|
+
"tsc-watch": "7.2.0",
|
|
47
|
+
"typescript": "6.0.3"
|
|
48
|
+
}
|
|
49
|
+
}
|