@venulog/phasing-engine-schemas 0.7.5 → 0.7.6
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/camera.d.ts +219 -0
- package/dist/camera.js +227 -0
- package/dist/enums/accessEventType.d.ts +8 -0
- package/dist/enums/accessEventType.js +17 -0
- package/dist/enums/cameraTrigger.d.ts +7 -0
- package/dist/enums/cameraTrigger.js +15 -0
- package/dist/enums/index.d.ts +5 -0
- package/dist/enums/index.js +5 -0
- package/dist/enums/positionSource.d.ts +7 -0
- package/dist/enums/positionSource.js +15 -0
- package/dist/enums/simulationMode.d.ts +11 -0
- package/dist/enums/simulationMode.js +20 -0
- package/dist/enums/vehicleState.d.ts +13 -0
- package/dist/enums/vehicleState.js +37 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +12 -0
- package/dist/parkingAreaAccess.d.ts +400 -0
- package/dist/parkingAreaAccess.js +466 -0
- package/dist/parkingAreaLayer.d.ts +354 -0
- package/dist/parkingAreaLayer.js +385 -0
- package/dist/parkingBooking.d.ts +58 -23
- package/dist/parkingBooking.js +74 -1
- package/dist/simulation.d.ts +171 -0
- package/dist/simulation.js +231 -0
- package/dist/vehiclePosition.d.ts +216 -0
- package/dist/vehiclePosition.js +237 -0
- package/package.json +21 -1
package/dist/camera.d.ts
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { z } from './zod.js';
|
|
2
|
+
import { CameraTrigger } from './enums/cameraTrigger.js';
|
|
3
|
+
export declare const cameraTriggerSchema: z.ZodEnum<{
|
|
4
|
+
motion: CameraTrigger.MOTION;
|
|
5
|
+
scan: CameraTrigger.SCAN;
|
|
6
|
+
manual: CameraTrigger.MANUAL;
|
|
7
|
+
scheduled: CameraTrigger.SCHEDULED;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const cameraSchema: z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
gate_id: z.ZodString;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
stream_url: z.ZodNullable<z.ZodString>;
|
|
14
|
+
snapshot_url: z.ZodNullable<z.ZodString>;
|
|
15
|
+
position: z.ZodObject<{
|
|
16
|
+
x: z.ZodNumber;
|
|
17
|
+
y: z.ZodNumber;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
is_active: z.ZodBoolean;
|
|
20
|
+
last_snapshot_at: z.ZodNullable<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type Camera = z.infer<typeof cameraSchema>;
|
|
23
|
+
export declare const camerasDataSchema: z.ZodObject<{
|
|
24
|
+
cameras: z.ZodArray<z.ZodObject<{
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
gate_id: z.ZodString;
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
stream_url: z.ZodNullable<z.ZodString>;
|
|
29
|
+
snapshot_url: z.ZodNullable<z.ZodString>;
|
|
30
|
+
position: z.ZodObject<{
|
|
31
|
+
x: z.ZodNumber;
|
|
32
|
+
y: z.ZodNumber;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
is_active: z.ZodBoolean;
|
|
35
|
+
last_snapshot_at: z.ZodNullable<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export type CamerasData = z.infer<typeof camerasDataSchema>;
|
|
39
|
+
export declare const getCamerasResponseSchema: z.ZodObject<{
|
|
40
|
+
success: z.ZodBoolean;
|
|
41
|
+
data: z.ZodObject<{
|
|
42
|
+
cameras: z.ZodArray<z.ZodObject<{
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
gate_id: z.ZodString;
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
stream_url: z.ZodNullable<z.ZodString>;
|
|
47
|
+
snapshot_url: z.ZodNullable<z.ZodString>;
|
|
48
|
+
position: z.ZodObject<{
|
|
49
|
+
x: z.ZodNumber;
|
|
50
|
+
y: z.ZodNumber;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
is_active: z.ZodBoolean;
|
|
53
|
+
last_snapshot_at: z.ZodNullable<z.ZodString>;
|
|
54
|
+
}, z.core.$strip>>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export type GetCamerasResponse = z.infer<typeof getCamerasResponseSchema>;
|
|
58
|
+
export declare const snapshotMetadataSchema: z.ZodObject<{
|
|
59
|
+
detected_plate: z.ZodOptional<z.ZodString>;
|
|
60
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
vehicle_detected: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
vehicle_type: z.ZodOptional<z.ZodString>;
|
|
63
|
+
bounding_box: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
x: z.ZodNumber;
|
|
65
|
+
y: z.ZodNumber;
|
|
66
|
+
width: z.ZodNumber;
|
|
67
|
+
height: z.ZodNumber;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
export type SnapshotMetadata = z.infer<typeof snapshotMetadataSchema>;
|
|
71
|
+
export declare const uploadSnapshotBodySchema: z.ZodObject<{
|
|
72
|
+
image_base64: z.ZodString;
|
|
73
|
+
captured_at: z.ZodString;
|
|
74
|
+
trigger: z.ZodEnum<{
|
|
75
|
+
motion: CameraTrigger.MOTION;
|
|
76
|
+
scan: CameraTrigger.SCAN;
|
|
77
|
+
manual: CameraTrigger.MANUAL;
|
|
78
|
+
scheduled: CameraTrigger.SCHEDULED;
|
|
79
|
+
}>;
|
|
80
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
detected_plate: z.ZodOptional<z.ZodString>;
|
|
82
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
vehicle_detected: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
+
vehicle_type: z.ZodOptional<z.ZodString>;
|
|
85
|
+
bounding_box: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
x: z.ZodNumber;
|
|
87
|
+
y: z.ZodNumber;
|
|
88
|
+
width: z.ZodNumber;
|
|
89
|
+
height: z.ZodNumber;
|
|
90
|
+
}, z.core.$strip>>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export type UploadSnapshotBody = z.infer<typeof uploadSnapshotBodySchema>;
|
|
94
|
+
export declare const cameraIdParamsSchema: z.ZodObject<{
|
|
95
|
+
cameraId: z.ZodString;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export type CameraIdParams = z.infer<typeof cameraIdParamsSchema>;
|
|
98
|
+
export declare const uploadSnapshotDataSchema: z.ZodObject<{
|
|
99
|
+
snapshot_id: z.ZodString;
|
|
100
|
+
image_url: z.ZodString;
|
|
101
|
+
thumbnail_url: z.ZodNullable<z.ZodString>;
|
|
102
|
+
matched_booking_id: z.ZodNullable<z.ZodNumber>;
|
|
103
|
+
received_at: z.ZodString;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export type UploadSnapshotData = z.infer<typeof uploadSnapshotDataSchema>;
|
|
106
|
+
export declare const uploadSnapshotResponseSchema: z.ZodObject<{
|
|
107
|
+
success: z.ZodBoolean;
|
|
108
|
+
data: z.ZodObject<{
|
|
109
|
+
snapshot_id: z.ZodString;
|
|
110
|
+
image_url: z.ZodString;
|
|
111
|
+
thumbnail_url: z.ZodNullable<z.ZodString>;
|
|
112
|
+
matched_booking_id: z.ZodNullable<z.ZodNumber>;
|
|
113
|
+
received_at: z.ZodString;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
export type UploadSnapshotResponse = z.infer<typeof uploadSnapshotResponseSchema>;
|
|
117
|
+
export declare const cameraSnapshotSchema: z.ZodObject<{
|
|
118
|
+
id: z.ZodString;
|
|
119
|
+
camera_id: z.ZodString;
|
|
120
|
+
image_url: z.ZodString;
|
|
121
|
+
thumbnail_url: z.ZodNullable<z.ZodString>;
|
|
122
|
+
trigger: z.ZodEnum<{
|
|
123
|
+
motion: CameraTrigger.MOTION;
|
|
124
|
+
scan: CameraTrigger.SCAN;
|
|
125
|
+
manual: CameraTrigger.MANUAL;
|
|
126
|
+
scheduled: CameraTrigger.SCHEDULED;
|
|
127
|
+
}>;
|
|
128
|
+
captured_at: z.ZodString;
|
|
129
|
+
metadata: z.ZodNullable<z.ZodObject<{
|
|
130
|
+
detected_plate: z.ZodOptional<z.ZodString>;
|
|
131
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
vehicle_detected: z.ZodOptional<z.ZodBoolean>;
|
|
133
|
+
vehicle_type: z.ZodOptional<z.ZodString>;
|
|
134
|
+
bounding_box: z.ZodOptional<z.ZodObject<{
|
|
135
|
+
x: z.ZodNumber;
|
|
136
|
+
y: z.ZodNumber;
|
|
137
|
+
width: z.ZodNumber;
|
|
138
|
+
height: z.ZodNumber;
|
|
139
|
+
}, z.core.$strip>>;
|
|
140
|
+
}, z.core.$strip>>;
|
|
141
|
+
matched_booking_id: z.ZodNullable<z.ZodNumber>;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
export type CameraSnapshot = z.infer<typeof cameraSnapshotSchema>;
|
|
144
|
+
export declare const getSnapshotsQuerySchema: z.ZodObject<{
|
|
145
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
146
|
+
trigger: z.ZodOptional<z.ZodEnum<{
|
|
147
|
+
motion: CameraTrigger.MOTION;
|
|
148
|
+
scan: CameraTrigger.SCAN;
|
|
149
|
+
manual: CameraTrigger.MANUAL;
|
|
150
|
+
scheduled: CameraTrigger.SCHEDULED;
|
|
151
|
+
}>>;
|
|
152
|
+
since: z.ZodOptional<z.ZodString>;
|
|
153
|
+
}, z.core.$strip>;
|
|
154
|
+
export type GetSnapshotsQuery = z.infer<typeof getSnapshotsQuerySchema>;
|
|
155
|
+
export declare const getSnapshotsDataSchema: z.ZodObject<{
|
|
156
|
+
camera_id: z.ZodString;
|
|
157
|
+
snapshots: z.ZodArray<z.ZodObject<{
|
|
158
|
+
id: z.ZodString;
|
|
159
|
+
camera_id: z.ZodString;
|
|
160
|
+
image_url: z.ZodString;
|
|
161
|
+
thumbnail_url: z.ZodNullable<z.ZodString>;
|
|
162
|
+
trigger: z.ZodEnum<{
|
|
163
|
+
motion: CameraTrigger.MOTION;
|
|
164
|
+
scan: CameraTrigger.SCAN;
|
|
165
|
+
manual: CameraTrigger.MANUAL;
|
|
166
|
+
scheduled: CameraTrigger.SCHEDULED;
|
|
167
|
+
}>;
|
|
168
|
+
captured_at: z.ZodString;
|
|
169
|
+
metadata: z.ZodNullable<z.ZodObject<{
|
|
170
|
+
detected_plate: z.ZodOptional<z.ZodString>;
|
|
171
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
vehicle_detected: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
+
vehicle_type: z.ZodOptional<z.ZodString>;
|
|
174
|
+
bounding_box: z.ZodOptional<z.ZodObject<{
|
|
175
|
+
x: z.ZodNumber;
|
|
176
|
+
y: z.ZodNumber;
|
|
177
|
+
width: z.ZodNumber;
|
|
178
|
+
height: z.ZodNumber;
|
|
179
|
+
}, z.core.$strip>>;
|
|
180
|
+
}, z.core.$strip>>;
|
|
181
|
+
matched_booking_id: z.ZodNullable<z.ZodNumber>;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
total_count: z.ZodNumber;
|
|
184
|
+
}, z.core.$strip>;
|
|
185
|
+
export type GetSnapshotsData = z.infer<typeof getSnapshotsDataSchema>;
|
|
186
|
+
export declare const getSnapshotsResponseSchema: z.ZodObject<{
|
|
187
|
+
success: z.ZodBoolean;
|
|
188
|
+
data: z.ZodObject<{
|
|
189
|
+
camera_id: z.ZodString;
|
|
190
|
+
snapshots: z.ZodArray<z.ZodObject<{
|
|
191
|
+
id: z.ZodString;
|
|
192
|
+
camera_id: z.ZodString;
|
|
193
|
+
image_url: z.ZodString;
|
|
194
|
+
thumbnail_url: z.ZodNullable<z.ZodString>;
|
|
195
|
+
trigger: z.ZodEnum<{
|
|
196
|
+
motion: CameraTrigger.MOTION;
|
|
197
|
+
scan: CameraTrigger.SCAN;
|
|
198
|
+
manual: CameraTrigger.MANUAL;
|
|
199
|
+
scheduled: CameraTrigger.SCHEDULED;
|
|
200
|
+
}>;
|
|
201
|
+
captured_at: z.ZodString;
|
|
202
|
+
metadata: z.ZodNullable<z.ZodObject<{
|
|
203
|
+
detected_plate: z.ZodOptional<z.ZodString>;
|
|
204
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
205
|
+
vehicle_detected: z.ZodOptional<z.ZodBoolean>;
|
|
206
|
+
vehicle_type: z.ZodOptional<z.ZodString>;
|
|
207
|
+
bounding_box: z.ZodOptional<z.ZodObject<{
|
|
208
|
+
x: z.ZodNumber;
|
|
209
|
+
y: z.ZodNumber;
|
|
210
|
+
width: z.ZodNumber;
|
|
211
|
+
height: z.ZodNumber;
|
|
212
|
+
}, z.core.$strip>>;
|
|
213
|
+
}, z.core.$strip>>;
|
|
214
|
+
matched_booking_id: z.ZodNullable<z.ZodNumber>;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
total_count: z.ZodNumber;
|
|
217
|
+
}, z.core.$strip>;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
export type GetSnapshotsResponse = z.infer<typeof getSnapshotsResponseSchema>;
|
package/dist/camera.js
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { z } from './zod.js';
|
|
2
|
+
import { CameraTrigger } from './enums/cameraTrigger.js';
|
|
3
|
+
import { createSuccessResponseSchema } from './common.js';
|
|
4
|
+
// ============================================================================
|
|
5
|
+
// Enums as Zod schemas
|
|
6
|
+
// ============================================================================
|
|
7
|
+
export const cameraTriggerSchema = z.enum([
|
|
8
|
+
CameraTrigger.MOTION,
|
|
9
|
+
CameraTrigger.SCAN,
|
|
10
|
+
CameraTrigger.MANUAL,
|
|
11
|
+
CameraTrigger.SCHEDULED
|
|
12
|
+
]);
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Camera Schema
|
|
15
|
+
// ============================================================================
|
|
16
|
+
export const cameraSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
id: z.string().uuid().openapi({
|
|
19
|
+
description: 'Camera UUID',
|
|
20
|
+
example: '550e8400-e29b-41d4-a716-446655440000'
|
|
21
|
+
}),
|
|
22
|
+
gate_id: z.string().openapi({
|
|
23
|
+
description: 'Gate identifier',
|
|
24
|
+
example: 'GATE_A'
|
|
25
|
+
}),
|
|
26
|
+
name: z.string().openapi({
|
|
27
|
+
description: 'Camera name',
|
|
28
|
+
example: 'Gate A - Entry Camera'
|
|
29
|
+
}),
|
|
30
|
+
stream_url: z.string().url().nullable().openapi({
|
|
31
|
+
description: 'RTSP/HLS stream URL',
|
|
32
|
+
example: 'rtsp://camera.example.com/gate-a'
|
|
33
|
+
}),
|
|
34
|
+
snapshot_url: z.string().url().nullable().openapi({
|
|
35
|
+
description: 'Static image endpoint',
|
|
36
|
+
example: 'https://camera.example.com/gate-a/snapshot'
|
|
37
|
+
}),
|
|
38
|
+
position: z
|
|
39
|
+
.object({
|
|
40
|
+
x: z.number().min(0).max(100),
|
|
41
|
+
y: z.number().min(0).max(100)
|
|
42
|
+
})
|
|
43
|
+
.openapi({
|
|
44
|
+
description: 'Position on site plan (0-100%)',
|
|
45
|
+
example: { x: 10, y: 85 }
|
|
46
|
+
}),
|
|
47
|
+
is_active: z.boolean().openapi({
|
|
48
|
+
description: 'Whether camera is currently active',
|
|
49
|
+
example: true
|
|
50
|
+
}),
|
|
51
|
+
last_snapshot_at: z.string().datetime().nullable().openapi({
|
|
52
|
+
description: 'Timestamp of last snapshot',
|
|
53
|
+
example: '2026-01-04T12:30:00Z'
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
.openapi('Camera');
|
|
57
|
+
// ============================================================================
|
|
58
|
+
// Get Cameras Response
|
|
59
|
+
// ============================================================================
|
|
60
|
+
export const camerasDataSchema = z
|
|
61
|
+
.object({
|
|
62
|
+
cameras: z.array(cameraSchema).openapi({
|
|
63
|
+
description: 'List of cameras for the event'
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
.openapi('CamerasData');
|
|
67
|
+
export const getCamerasResponseSchema = createSuccessResponseSchema(camerasDataSchema, 'GetCamerasResponse', 'Camera list for an event');
|
|
68
|
+
// ============================================================================
|
|
69
|
+
// Camera Snapshot Metadata
|
|
70
|
+
// ============================================================================
|
|
71
|
+
export const snapshotMetadataSchema = z
|
|
72
|
+
.object({
|
|
73
|
+
detected_plate: z.string().optional().openapi({
|
|
74
|
+
description: 'License plate detected by OCR',
|
|
75
|
+
example: 'AB-123-CD'
|
|
76
|
+
}),
|
|
77
|
+
confidence: z.number().min(0).max(1).optional().openapi({
|
|
78
|
+
description: 'OCR confidence score (0-1)',
|
|
79
|
+
example: 0.95
|
|
80
|
+
}),
|
|
81
|
+
vehicle_detected: z.boolean().optional().openapi({
|
|
82
|
+
description: 'Whether a vehicle was detected in the image',
|
|
83
|
+
example: true
|
|
84
|
+
}),
|
|
85
|
+
vehicle_type: z.string().optional().openapi({
|
|
86
|
+
description: 'Detected vehicle type',
|
|
87
|
+
example: 'truck'
|
|
88
|
+
}),
|
|
89
|
+
bounding_box: z
|
|
90
|
+
.object({
|
|
91
|
+
x: z.number(),
|
|
92
|
+
y: z.number(),
|
|
93
|
+
width: z.number(),
|
|
94
|
+
height: z.number()
|
|
95
|
+
})
|
|
96
|
+
.optional()
|
|
97
|
+
.openapi({
|
|
98
|
+
description: 'Bounding box of detected vehicle'
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
.openapi('SnapshotMetadata');
|
|
102
|
+
// ============================================================================
|
|
103
|
+
// Upload Snapshot Request
|
|
104
|
+
// ============================================================================
|
|
105
|
+
export const uploadSnapshotBodySchema = z
|
|
106
|
+
.object({
|
|
107
|
+
image_base64: z.string().min(1).openapi({
|
|
108
|
+
description: 'Base64 encoded JPEG image',
|
|
109
|
+
example: '/9j/4AAQSkZJRgABAQAAAQABAAD...'
|
|
110
|
+
}),
|
|
111
|
+
captured_at: z.string().datetime().openapi({
|
|
112
|
+
description: 'When the snapshot was captured',
|
|
113
|
+
example: '2026-01-04T12:34:56Z'
|
|
114
|
+
}),
|
|
115
|
+
trigger: cameraTriggerSchema.openapi({
|
|
116
|
+
description: 'What triggered the snapshot',
|
|
117
|
+
example: 'scan'
|
|
118
|
+
}),
|
|
119
|
+
metadata: snapshotMetadataSchema.optional().openapi({
|
|
120
|
+
description: 'Detection/OCR results'
|
|
121
|
+
})
|
|
122
|
+
})
|
|
123
|
+
.openapi('UploadSnapshotBody');
|
|
124
|
+
// ============================================================================
|
|
125
|
+
// Camera Path Params
|
|
126
|
+
// ============================================================================
|
|
127
|
+
export const cameraIdParamsSchema = z
|
|
128
|
+
.object({
|
|
129
|
+
cameraId: z.string().uuid().openapi({
|
|
130
|
+
description: 'Camera UUID',
|
|
131
|
+
example: '550e8400-e29b-41d4-a716-446655440000'
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
.openapi('CameraIdParams');
|
|
135
|
+
// ============================================================================
|
|
136
|
+
// Upload Snapshot Response
|
|
137
|
+
// ============================================================================
|
|
138
|
+
export const uploadSnapshotDataSchema = z
|
|
139
|
+
.object({
|
|
140
|
+
snapshot_id: z.string().uuid().openapi({
|
|
141
|
+
description: 'UUID of the created snapshot',
|
|
142
|
+
example: '550e8400-e29b-41d4-a716-446655440000'
|
|
143
|
+
}),
|
|
144
|
+
image_url: z.string().url().openapi({
|
|
145
|
+
description: 'URL of the stored image',
|
|
146
|
+
example: 'https://storage.example.com/snapshots/abc123.jpg'
|
|
147
|
+
}),
|
|
148
|
+
thumbnail_url: z.string().url().nullable().openapi({
|
|
149
|
+
description: 'URL of the thumbnail',
|
|
150
|
+
example: 'https://storage.example.com/snapshots/abc123-thumb.jpg'
|
|
151
|
+
}),
|
|
152
|
+
matched_booking_id: z.number().int().positive().nullable().openapi({
|
|
153
|
+
description: 'Booking ID if plate was matched',
|
|
154
|
+
example: 123
|
|
155
|
+
}),
|
|
156
|
+
received_at: z.string().datetime().openapi({
|
|
157
|
+
description: 'Server timestamp',
|
|
158
|
+
example: '2026-01-04T12:34:56Z'
|
|
159
|
+
})
|
|
160
|
+
})
|
|
161
|
+
.openapi('UploadSnapshotData');
|
|
162
|
+
export const uploadSnapshotResponseSchema = createSuccessResponseSchema(uploadSnapshotDataSchema, 'UploadSnapshotResponse', 'Snapshot upload result');
|
|
163
|
+
// ============================================================================
|
|
164
|
+
// Camera Snapshot (for display)
|
|
165
|
+
// ============================================================================
|
|
166
|
+
export const cameraSnapshotSchema = z
|
|
167
|
+
.object({
|
|
168
|
+
id: z.string().uuid().openapi({
|
|
169
|
+
description: 'Snapshot UUID'
|
|
170
|
+
}),
|
|
171
|
+
camera_id: z.string().uuid().openapi({
|
|
172
|
+
description: 'Camera UUID'
|
|
173
|
+
}),
|
|
174
|
+
image_url: z.string().url().openapi({
|
|
175
|
+
description: 'Full image URL'
|
|
176
|
+
}),
|
|
177
|
+
thumbnail_url: z.string().url().nullable().openapi({
|
|
178
|
+
description: 'Thumbnail URL'
|
|
179
|
+
}),
|
|
180
|
+
trigger: cameraTriggerSchema.openapi({
|
|
181
|
+
description: 'What triggered the snapshot'
|
|
182
|
+
}),
|
|
183
|
+
captured_at: z.string().datetime().openapi({
|
|
184
|
+
description: 'Capture timestamp'
|
|
185
|
+
}),
|
|
186
|
+
metadata: snapshotMetadataSchema.nullable().openapi({
|
|
187
|
+
description: 'Detection results'
|
|
188
|
+
}),
|
|
189
|
+
matched_booking_id: z.number().int().positive().nullable().openapi({
|
|
190
|
+
description: 'Matched booking ID if plate was recognized'
|
|
191
|
+
})
|
|
192
|
+
})
|
|
193
|
+
.openapi('CameraSnapshot');
|
|
194
|
+
// ============================================================================
|
|
195
|
+
// Get Snapshots Query
|
|
196
|
+
// ============================================================================
|
|
197
|
+
export const getSnapshotsQuerySchema = z
|
|
198
|
+
.object({
|
|
199
|
+
limit: z.coerce.number().int().positive().max(100).optional().default(20).openapi({
|
|
200
|
+
description: 'Max number of snapshots to return',
|
|
201
|
+
example: 20
|
|
202
|
+
}),
|
|
203
|
+
trigger: cameraTriggerSchema.optional().openapi({
|
|
204
|
+
description: 'Filter by trigger type'
|
|
205
|
+
}),
|
|
206
|
+
since: z.string().datetime().optional().openapi({
|
|
207
|
+
description: 'Only return snapshots after this time'
|
|
208
|
+
})
|
|
209
|
+
})
|
|
210
|
+
.openapi('GetSnapshotsQuery');
|
|
211
|
+
// ============================================================================
|
|
212
|
+
// Get Snapshots Response
|
|
213
|
+
// ============================================================================
|
|
214
|
+
export const getSnapshotsDataSchema = z
|
|
215
|
+
.object({
|
|
216
|
+
camera_id: z.string().uuid().openapi({
|
|
217
|
+
description: 'Camera UUID'
|
|
218
|
+
}),
|
|
219
|
+
snapshots: z.array(cameraSnapshotSchema).openapi({
|
|
220
|
+
description: 'List of snapshots'
|
|
221
|
+
}),
|
|
222
|
+
total_count: z.number().int().min(0).openapi({
|
|
223
|
+
description: 'Total count'
|
|
224
|
+
})
|
|
225
|
+
})
|
|
226
|
+
.openapi('GetSnapshotsData');
|
|
227
|
+
export const getSnapshotsResponseSchema = createSuccessResponseSchema(getSnapshotsDataSchema, 'GetSnapshotsResponse', 'Camera snapshots');
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare enum AccessEventType {
|
|
2
|
+
APPROACH = "approach",// Vehicle detected approaching gate
|
|
3
|
+
SCAN = "scan",// QR/badge scanned
|
|
4
|
+
ENTRY = "entry",// Vehicle entered through gate
|
|
5
|
+
EXIT = "exit",// Vehicle exited through gate
|
|
6
|
+
DENIED = "denied"
|
|
7
|
+
}
|
|
8
|
+
export declare const ACCESS_EVENT_TYPE_LABELS: Record<AccessEventType, string>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Access event type enumeration for gate logging
|
|
2
|
+
// Represents different types of gate interactions
|
|
3
|
+
export var AccessEventType;
|
|
4
|
+
(function (AccessEventType) {
|
|
5
|
+
AccessEventType["APPROACH"] = "approach";
|
|
6
|
+
AccessEventType["SCAN"] = "scan";
|
|
7
|
+
AccessEventType["ENTRY"] = "entry";
|
|
8
|
+
AccessEventType["EXIT"] = "exit";
|
|
9
|
+
AccessEventType["DENIED"] = "denied"; // Access denied (invalid badge, wrong time, etc.)
|
|
10
|
+
})(AccessEventType || (AccessEventType = {}));
|
|
11
|
+
export const ACCESS_EVENT_TYPE_LABELS = {
|
|
12
|
+
[AccessEventType.APPROACH]: 'Approach Detected',
|
|
13
|
+
[AccessEventType.SCAN]: 'Badge Scanned',
|
|
14
|
+
[AccessEventType.ENTRY]: 'Entry Confirmed',
|
|
15
|
+
[AccessEventType.EXIT]: 'Exit Confirmed',
|
|
16
|
+
[AccessEventType.DENIED]: 'Access Denied'
|
|
17
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Camera trigger type enumeration
|
|
2
|
+
// Indicates what triggered a camera snapshot
|
|
3
|
+
export var CameraTrigger;
|
|
4
|
+
(function (CameraTrigger) {
|
|
5
|
+
CameraTrigger["MOTION"] = "motion";
|
|
6
|
+
CameraTrigger["SCAN"] = "scan";
|
|
7
|
+
CameraTrigger["MANUAL"] = "manual";
|
|
8
|
+
CameraTrigger["SCHEDULED"] = "scheduled"; // Periodic capture
|
|
9
|
+
})(CameraTrigger || (CameraTrigger = {}));
|
|
10
|
+
export const CAMERA_TRIGGER_LABELS = {
|
|
11
|
+
[CameraTrigger.MOTION]: 'Motion Detected',
|
|
12
|
+
[CameraTrigger.SCAN]: 'Badge Scan',
|
|
13
|
+
[CameraTrigger.MANUAL]: 'Manual Capture',
|
|
14
|
+
[CameraTrigger.SCHEDULED]: 'Scheduled'
|
|
15
|
+
};
|
package/dist/enums/index.d.ts
CHANGED
|
@@ -2,3 +2,8 @@ export * from './bookingStatus.js';
|
|
|
2
2
|
export * from './parkingAreaScheduleType.js';
|
|
3
3
|
export * from './vehicleType.js';
|
|
4
4
|
export * from './unloadingType.js';
|
|
5
|
+
export * from './vehicleState.js';
|
|
6
|
+
export * from './accessEventType.js';
|
|
7
|
+
export * from './positionSource.js';
|
|
8
|
+
export * from './cameraTrigger.js';
|
|
9
|
+
export * from './simulationMode.js';
|
package/dist/enums/index.js
CHANGED
|
@@ -3,3 +3,8 @@ export * from './bookingStatus.js';
|
|
|
3
3
|
export * from './parkingAreaScheduleType.js';
|
|
4
4
|
export * from './vehicleType.js';
|
|
5
5
|
export * from './unloadingType.js';
|
|
6
|
+
export * from './vehicleState.js';
|
|
7
|
+
export * from './accessEventType.js';
|
|
8
|
+
export * from './positionSource.js';
|
|
9
|
+
export * from './cameraTrigger.js';
|
|
10
|
+
export * from './simulationMode.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare enum PositionSource {
|
|
2
|
+
GPS = "gps",// Real GPS from mobile app
|
|
3
|
+
SIMULATED = "simulated",// Generated by simulation engine
|
|
4
|
+
INFERRED = "inferred",// Calculated from gate events
|
|
5
|
+
MANUAL = "manual"
|
|
6
|
+
}
|
|
7
|
+
export declare const POSITION_SOURCE_LABELS: Record<PositionSource, string>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Position data source enumeration
|
|
2
|
+
// Indicates how a vehicle position was obtained
|
|
3
|
+
export var PositionSource;
|
|
4
|
+
(function (PositionSource) {
|
|
5
|
+
PositionSource["GPS"] = "gps";
|
|
6
|
+
PositionSource["SIMULATED"] = "simulated";
|
|
7
|
+
PositionSource["INFERRED"] = "inferred";
|
|
8
|
+
PositionSource["MANUAL"] = "manual"; // Manually set by operator
|
|
9
|
+
})(PositionSource || (PositionSource = {}));
|
|
10
|
+
export const POSITION_SOURCE_LABELS = {
|
|
11
|
+
[PositionSource.GPS]: 'GPS',
|
|
12
|
+
[PositionSource.SIMULATED]: 'Simulated',
|
|
13
|
+
[PositionSource.INFERRED]: 'Inferred',
|
|
14
|
+
[PositionSource.MANUAL]: 'Manual'
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum SimulationMode {
|
|
2
|
+
ENTRY = "entry",// Simulate entry movements only (gate to parking)
|
|
3
|
+
EXIT = "exit",// Simulate exit movements only (parking to gate)
|
|
4
|
+
BOTH = "both"
|
|
5
|
+
}
|
|
6
|
+
export declare const SIMULATION_MODE_LABELS: Record<SimulationMode, string>;
|
|
7
|
+
export declare enum SimulationStatus {
|
|
8
|
+
RUNNING = "running",
|
|
9
|
+
STOPPED = "stopped",
|
|
10
|
+
COMPLETED = "completed"
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Simulation mode enumeration
|
|
2
|
+
// Controls which vehicle movements to simulate
|
|
3
|
+
export var SimulationMode;
|
|
4
|
+
(function (SimulationMode) {
|
|
5
|
+
SimulationMode["ENTRY"] = "entry";
|
|
6
|
+
SimulationMode["EXIT"] = "exit";
|
|
7
|
+
SimulationMode["BOTH"] = "both"; // Simulate both entry and exit movements
|
|
8
|
+
})(SimulationMode || (SimulationMode = {}));
|
|
9
|
+
export const SIMULATION_MODE_LABELS = {
|
|
10
|
+
[SimulationMode.ENTRY]: 'Entry Only',
|
|
11
|
+
[SimulationMode.EXIT]: 'Exit Only',
|
|
12
|
+
[SimulationMode.BOTH]: 'Both Entry and Exit'
|
|
13
|
+
};
|
|
14
|
+
// Simulation status
|
|
15
|
+
export var SimulationStatus;
|
|
16
|
+
(function (SimulationStatus) {
|
|
17
|
+
SimulationStatus["RUNNING"] = "running";
|
|
18
|
+
SimulationStatus["STOPPED"] = "stopped";
|
|
19
|
+
SimulationStatus["COMPLETED"] = "completed";
|
|
20
|
+
})(SimulationStatus || (SimulationStatus = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum VehicleState {
|
|
2
|
+
BOOKED = "booked",// Has reservation, not yet arrived
|
|
3
|
+
APPROACHING = "approaching",// Detected near gate (GPS/geofence)
|
|
4
|
+
AT_GATE = "at_gate",// QR scanned, awaiting entry
|
|
5
|
+
ENTERING = "entering",// Gate opened, moving to spot
|
|
6
|
+
PARKED = "parked",// In assigned spot
|
|
7
|
+
DEPARTING = "departing",// Moving toward exit
|
|
8
|
+
AT_EXIT = "at_exit",// At exit gate
|
|
9
|
+
EXITED = "exited",// Left venue
|
|
10
|
+
HISTORICAL = "historical"
|
|
11
|
+
}
|
|
12
|
+
export declare const VEHICLE_STATE_LABELS: Record<VehicleState, string>;
|
|
13
|
+
export declare const VEHICLE_STATE_TRANSITIONS: Record<VehicleState, VehicleState[]>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Vehicle state enumeration for real-time tracking
|
|
2
|
+
// Represents the lifecycle of a vehicle during an event
|
|
3
|
+
export var VehicleState;
|
|
4
|
+
(function (VehicleState) {
|
|
5
|
+
VehicleState["BOOKED"] = "booked";
|
|
6
|
+
VehicleState["APPROACHING"] = "approaching";
|
|
7
|
+
VehicleState["AT_GATE"] = "at_gate";
|
|
8
|
+
VehicleState["ENTERING"] = "entering";
|
|
9
|
+
VehicleState["PARKED"] = "parked";
|
|
10
|
+
VehicleState["DEPARTING"] = "departing";
|
|
11
|
+
VehicleState["AT_EXIT"] = "at_exit";
|
|
12
|
+
VehicleState["EXITED"] = "exited";
|
|
13
|
+
VehicleState["HISTORICAL"] = "historical"; // Past event (ghost display)
|
|
14
|
+
})(VehicleState || (VehicleState = {}));
|
|
15
|
+
export const VEHICLE_STATE_LABELS = {
|
|
16
|
+
[VehicleState.BOOKED]: 'Booked',
|
|
17
|
+
[VehicleState.APPROACHING]: 'Approaching',
|
|
18
|
+
[VehicleState.AT_GATE]: 'At Gate',
|
|
19
|
+
[VehicleState.ENTERING]: 'Entering',
|
|
20
|
+
[VehicleState.PARKED]: 'Parked',
|
|
21
|
+
[VehicleState.DEPARTING]: 'Departing',
|
|
22
|
+
[VehicleState.AT_EXIT]: 'At Exit',
|
|
23
|
+
[VehicleState.EXITED]: 'Exited',
|
|
24
|
+
[VehicleState.HISTORICAL]: 'Historical'
|
|
25
|
+
};
|
|
26
|
+
// Valid state transitions
|
|
27
|
+
export const VEHICLE_STATE_TRANSITIONS = {
|
|
28
|
+
[VehicleState.BOOKED]: [VehicleState.APPROACHING, VehicleState.AT_GATE],
|
|
29
|
+
[VehicleState.APPROACHING]: [VehicleState.AT_GATE],
|
|
30
|
+
[VehicleState.AT_GATE]: [VehicleState.ENTERING],
|
|
31
|
+
[VehicleState.ENTERING]: [VehicleState.PARKED],
|
|
32
|
+
[VehicleState.PARKED]: [VehicleState.DEPARTING],
|
|
33
|
+
[VehicleState.DEPARTING]: [VehicleState.AT_EXIT],
|
|
34
|
+
[VehicleState.AT_EXIT]: [VehicleState.EXITED],
|
|
35
|
+
[VehicleState.EXITED]: [VehicleState.HISTORICAL],
|
|
36
|
+
[VehicleState.HISTORICAL]: []
|
|
37
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,20 @@ export * from './pagination.js';
|
|
|
3
3
|
export * from './auth.js';
|
|
4
4
|
export * from './parkingBooking.js';
|
|
5
5
|
export * from './parkingArea.js';
|
|
6
|
+
export * from './parkingAreaLayer.js';
|
|
7
|
+
export * from './parkingAreaAccess.js';
|
|
6
8
|
export * from './event.js';
|
|
7
9
|
export * from './accessToken.js';
|
|
10
|
+
export * from './vehiclePosition.js';
|
|
11
|
+
export * from './camera.js';
|
|
12
|
+
export * from './simulation.js';
|
|
8
13
|
export * from './enums/bookingStatus.js';
|
|
9
14
|
export * from './enums/parkingAreaScheduleType.js';
|
|
15
|
+
export * from './enums/vehicleType.js';
|
|
16
|
+
export * from './enums/unloadingType.js';
|
|
17
|
+
export * from './enums/vehicleState.js';
|
|
18
|
+
export * from './enums/accessEventType.js';
|
|
19
|
+
export * from './enums/positionSource.js';
|
|
20
|
+
export * from './enums/cameraTrigger.js';
|
|
21
|
+
export * from './enums/simulationMode.js';
|
|
10
22
|
export { z } from './zod.js';
|
package/dist/index.js
CHANGED
|
@@ -4,10 +4,22 @@ export * from './pagination.js';
|
|
|
4
4
|
export * from './auth.js';
|
|
5
5
|
export * from './parkingBooking.js';
|
|
6
6
|
export * from './parkingArea.js';
|
|
7
|
+
export * from './parkingAreaLayer.js';
|
|
8
|
+
export * from './parkingAreaAccess.js';
|
|
7
9
|
export * from './event.js';
|
|
8
10
|
export * from './accessToken.js';
|
|
11
|
+
export * from './vehiclePosition.js';
|
|
12
|
+
export * from './camera.js';
|
|
13
|
+
export * from './simulation.js';
|
|
9
14
|
// Enum exports
|
|
10
15
|
export * from './enums/bookingStatus.js';
|
|
11
16
|
export * from './enums/parkingAreaScheduleType.js';
|
|
17
|
+
export * from './enums/vehicleType.js';
|
|
18
|
+
export * from './enums/unloadingType.js';
|
|
19
|
+
export * from './enums/vehicleState.js';
|
|
20
|
+
export * from './enums/accessEventType.js';
|
|
21
|
+
export * from './enums/positionSource.js';
|
|
22
|
+
export * from './enums/cameraTrigger.js';
|
|
23
|
+
export * from './enums/simulationMode.js';
|
|
12
24
|
// Zod re-export for convenience
|
|
13
25
|
export { z } from './zod.js';
|