@venulog/phasing-engine-schemas 0.7.0-alpha.4 → 0.7.1

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/README.md CHANGED
@@ -1,67 +1,67 @@
1
- # @venulog/phasing-engine-schemas
2
-
3
- Shared schemas and types for Phasing Engine API. Provides Zod validation schemas, TypeScript types, and OpenAPI documentation support.
4
-
5
- ## Installation
6
-
7
- This package is designed to be used as a local workspace package:
8
-
9
- ```bash
10
- npm install @venulog/phasing-engine-schemas
11
- ```
12
-
13
- ## Usage
14
-
15
- ```typescript
16
- import {
17
- phaseBookingSchema,
18
- PhaseBooking,
19
- BookingStatus,
20
- SlotStatus
21
- } from '@venulog/phasing-engine-schemas';
22
-
23
- // Use schemas for validation
24
- const booking = phaseBookingSchema.parse(data);
25
-
26
- // Use types for type safety
27
- const createBooking = (booking: PhaseBooking) => {
28
- // ...
29
- };
30
-
31
- // Use enums for status values
32
- if (booking.status === BookingStatus.CONFIRMED) {
33
- // ...
34
- }
35
- ```
36
-
37
- ## Available Exports
38
-
39
- ### Schemas
40
-
41
- - `auth` - Authentication related schemas
42
- - `common` - Base response schemas and factory functions
43
- - `pagination` - Pagination and sorting schemas
44
- - `phaseBooking` - Phase booking operation schemas
45
- - `phaseSlot` - Phase slot management schemas
46
-
47
- ### Enums
48
-
49
- - `BookingStatus` - Booking status values
50
- - `SlotStatus` - Slot status values
51
-
52
- ### Types
53
-
54
- All schemas export corresponding TypeScript types using Zod's `z.infer<>`.
55
-
56
- ## Development
57
-
58
- ```bash
59
- # Build the package
60
- npm run build
61
-
62
- # Watch mode for development
63
- npm run dev
64
-
65
- # Clean build artifacts
66
- npm run clean
67
- ```
1
+ # @venulog/phasing-engine-schemas
2
+
3
+ Shared schemas and types for Phasing Engine API. Provides Zod validation schemas, TypeScript types, and OpenAPI documentation support.
4
+
5
+ ## Installation
6
+
7
+ This package is designed to be used as a local workspace package:
8
+
9
+ ```bash
10
+ npm install @venulog/phasing-engine-schemas
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```typescript
16
+ import {
17
+ phaseBookingSchema,
18
+ PhaseBooking,
19
+ BookingStatus,
20
+ SlotStatus
21
+ } from '@venulog/phasing-engine-schemas';
22
+
23
+ // Use schemas for validation
24
+ const booking = phaseBookingSchema.parse(data);
25
+
26
+ // Use types for type safety
27
+ const createBooking = (booking: PhaseBooking) => {
28
+ // ...
29
+ };
30
+
31
+ // Use enums for status values
32
+ if (booking.status === BookingStatus.CONFIRMED) {
33
+ // ...
34
+ }
35
+ ```
36
+
37
+ ## Available Exports
38
+
39
+ ### Schemas
40
+
41
+ - `auth` - Authentication related schemas
42
+ - `common` - Base response schemas and factory functions
43
+ - `pagination` - Pagination and sorting schemas
44
+ - `phaseBooking` - Phase booking operation schemas
45
+ - `phaseSlot` - Phase slot management schemas
46
+
47
+ ### Enums
48
+
49
+ - `BookingStatus` - Booking status values
50
+ - `SlotStatus` - Slot status values
51
+
52
+ ### Types
53
+
54
+ All schemas export corresponding TypeScript types using Zod's `z.infer<>`.
55
+
56
+ ## Development
57
+
58
+ ```bash
59
+ # Build the package
60
+ npm run build
61
+
62
+ # Watch mode for development
63
+ npm run dev
64
+
65
+ # Clean build artifacts
66
+ npm run clean
67
+ ```
@@ -52,6 +52,8 @@ export declare const parkingBookingSchema: z.ZodObject<{
52
52
  company_role: z.ZodNullable<z.ZodString>;
53
53
  company: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
54
54
  vehicle: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
55
+ entry_scanned_at: z.ZodNullable<z.ZodString>;
56
+ exit_scanned_at: z.ZodNullable<z.ZodString>;
55
57
  parking_area_schedule: z.ZodOptional<z.ZodObject<{
56
58
  id: z.ZodNumber;
57
59
  date: z.ZodString;
@@ -113,6 +115,8 @@ export declare const eventBookingsDataSchema: z.ZodObject<{
113
115
  company_role: z.ZodNullable<z.ZodString>;
114
116
  company: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
115
117
  vehicle: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
118
+ entry_scanned_at: z.ZodNullable<z.ZodString>;
119
+ exit_scanned_at: z.ZodNullable<z.ZodString>;
116
120
  parking_area_schedule: z.ZodOptional<z.ZodObject<{
117
121
  id: z.ZodNumber;
118
122
  date: z.ZodString;
@@ -159,6 +163,8 @@ export declare const eventBookingsResponseSchema: z.ZodObject<{
159
163
  company_role: z.ZodNullable<z.ZodString>;
160
164
  company: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
161
165
  vehicle: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
166
+ entry_scanned_at: z.ZodNullable<z.ZodString>;
167
+ exit_scanned_at: z.ZodNullable<z.ZodString>;
162
168
  parking_area_schedule: z.ZodOptional<z.ZodObject<{
163
169
  id: z.ZodNumber;
164
170
  date: z.ZodString;
@@ -207,6 +213,16 @@ export declare const closeEventResponseSchema: z.ZodObject<{
207
213
  reason: z.ZodNullable<z.ZodString>;
208
214
  }, z.core.$strip>;
209
215
  }, z.core.$strip>;
216
+ export declare const confirmExitBodySchema: z.ZodObject<{
217
+ plate_number: z.ZodObject<{
218
+ url: z.ZodString;
219
+ name: z.ZodString;
220
+ path: z.ZodString;
221
+ size: z.ZodNumber;
222
+ type: z.ZodString;
223
+ bucket: z.ZodString;
224
+ }, z.core.$strip>;
225
+ }, z.core.$strip>;
210
226
  export declare const confirmAccessDataSchema: z.ZodObject<{
211
227
  bookingId: z.ZodCoercedNumber<unknown>;
212
228
  }, z.core.$strip>;
@@ -587,8 +603,6 @@ export declare const parkingBookingDetailsDataSchema: z.ZodObject<{
587
603
  }, z.core.$strip>>;
588
604
  created_at: z.ZodString;
589
605
  updated_at: z.ZodString;
590
- entry_scanned_at: z.ZodNullable<z.ZodString>;
591
- exit_scanned_at: z.ZodNullable<z.ZodString>;
592
606
  }, z.core.$strip>;
593
607
  export declare const getParkingBookingDetailsResponseSchema: z.ZodObject<{
594
608
  success: z.ZodBoolean;
@@ -642,8 +656,6 @@ export declare const getParkingBookingDetailsResponseSchema: z.ZodObject<{
642
656
  }, z.core.$strip>>;
643
657
  created_at: z.ZodString;
644
658
  updated_at: z.ZodString;
645
- entry_scanned_at: z.ZodNullable<z.ZodString>;
646
- exit_scanned_at: z.ZodNullable<z.ZodString>;
647
659
  }, z.core.$strip>;
648
660
  }, z.core.$strip>;
649
661
  export declare const getParkingBookingDetailsByTokenBodySchema: z.ZodObject<{
@@ -817,6 +829,7 @@ export type CloseEventBody = z.infer<typeof closeEventBodySchema>;
817
829
  export type CloseEventData = z.infer<typeof closeEventDataSchema>;
818
830
  export type CloseEventResponse = z.infer<typeof closeEventResponseSchema>;
819
831
  export type EventBookingsResponse = z.infer<typeof eventBookingsResponseSchema>;
832
+ export type ConfirmExitData = z.infer<typeof confirmExitBodySchema>;
820
833
  export type ConfirmBookingParams = z.infer<typeof confirmBookingParamsSchema>;
821
834
  export type ConfirmBookingResponse = z.infer<typeof confirmBookingResponseSchema>;
822
835
  export type CreateBookingBody = z.infer<typeof createParkingBookingBodySchema>;
@@ -99,6 +99,8 @@ export const parkingBookingSchema = z.object({
99
99
  company_role: z.string().nullable(),
100
100
  company: z.record(z.string(), z.unknown()).nullable().optional(),
101
101
  vehicle: z.record(z.string(), z.unknown()).nullable().optional(),
102
+ entry_scanned_at: z.string().nullable(),
103
+ exit_scanned_at: z.string().nullable(),
102
104
  // Include the schedule details
103
105
  parking_area_schedule: parkingAreaScheduleSchema.optional()
104
106
  });
@@ -210,6 +212,34 @@ export const closeEventDataSchema = z
210
212
  })
211
213
  .openapi('CloseEventData');
212
214
  export const closeEventResponseSchema = createMessageDataResponseSchema(closeEventDataSchema, 'CloseEventResponse', 'Event phase closed successfully', 'Details of the closed event phase');
215
+ export const confirmExitBodySchema = z.object({
216
+ plate_number: z.object({
217
+ url: z.string().openapi({
218
+ description: 'Public URL of the plate number',
219
+ example: 'https://example.net/xxxx.jpeg'
220
+ }),
221
+ name: z.string().openapi({
222
+ description: 'Name of the plate number file',
223
+ example: ''
224
+ }),
225
+ path: z.string().openapi({
226
+ description: 'Path of the plate number',
227
+ example: ''
228
+ }),
229
+ size: z.number().openapi({
230
+ description: 'File size of the plate number',
231
+ example: ''
232
+ }),
233
+ type: z.string().openapi({
234
+ description: 'File type of the plate number',
235
+ example: ''
236
+ }),
237
+ bucket: z.string().openapi({
238
+ description: 'Storage bucket name',
239
+ example: 'XXXXX'
240
+ })
241
+ })
242
+ });
213
243
  export const confirmAccessDataSchema = z.object({
214
244
  bookingId: z.coerce.number().int().positive({
215
245
  message: 'Booking ID must be a positive integer'
@@ -693,14 +723,6 @@ export const parkingBookingDetailsDataSchema = z
693
723
  updated_at: z.string().openapi({
694
724
  description: 'Timestamp when booking was last updated',
695
725
  example: '2025-12-05T10:30:00.000Z'
696
- }),
697
- entry_scanned_at: z.string().nullable().openapi({
698
- description: 'Timestamp when entry was scanned',
699
- example: '2025-12-15T08:05:00.000Z'
700
- }),
701
- exit_scanned_at: z.string().nullable().openapi({
702
- description: 'Timestamp when exit was scanned',
703
- example: '2025-12-15T08:25:00.000Z'
704
726
  })
705
727
  })
706
728
  .openapi('ParkingBookingDetailsData');
package/package.json CHANGED
@@ -1,75 +1,75 @@
1
- {
2
- "name": "@venulog/phasing-engine-schemas",
3
- "version": "0.7.0-alpha.4",
4
- "description": "Shared schemas and types for Phasing Engine API",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js"
12
- },
13
- "./auth": {
14
- "types": "./dist/auth.d.ts",
15
- "import": "./dist/auth.js"
16
- },
17
- "./common": {
18
- "types": "./dist/common.d.ts",
19
- "import": "./dist/common.js"
20
- },
21
- "./pagination": {
22
- "types": "./dist/pagination.d.ts",
23
- "import": "./dist/pagination.js"
24
- },
25
- "./parkingBooking": {
26
- "types": "./dist/parkingBooking.d.ts",
27
- "import": "./dist/parkingBooking.js"
28
- },
29
- "./event": {
30
- "types": "./dist/event.d.ts",
31
- "import": "./dist/event.js"
32
- },
33
- "./parkingArea": {
34
- "types": "./dist/parkingArea.d.ts",
35
- "import": "./dist/parkingArea.js"
36
- },
37
- "./enums": {
38
- "types": "./dist/enums/index.d.ts",
39
- "import": "./dist/enums/index.js"
40
- },
41
- "./accessToken": {
42
- "types": "./dist/accessToken.d.ts",
43
- "import": "./dist/accessToken.js"
44
- }
45
- },
46
- "files": [
47
- "dist"
48
- ],
49
- "scripts": {
50
- "build": "npm run clean && tsc",
51
- "dev": "tsc --watch",
52
- "clean": "rimraf dist",
53
- "prepublishOnly": "npm run build"
54
- },
55
- "keywords": [
56
- "schemas",
57
- "validation",
58
- "types",
59
- "zod",
60
- "phasing-engine"
61
- ],
62
- "license": "MIT",
63
- "dependencies": {
64
- "@asteasolutions/zod-to-openapi": "^8.1.0",
65
- "zod": "^4.1.13"
66
- },
67
- "devDependencies": {
68
- "typescript": "^5.6.3"
69
- },
70
- "repository": {
71
- "type": "git",
72
- "url": "git+https://github.com/manaty/phasing_engine.git",
73
- "directory": "packages/phasing-schemas"
74
- }
75
- }
1
+ {
2
+ "name": "@venulog/phasing-engine-schemas",
3
+ "version": "0.7.1",
4
+ "description": "Shared schemas and types for Phasing Engine API",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./auth": {
14
+ "types": "./dist/auth.d.ts",
15
+ "import": "./dist/auth.js"
16
+ },
17
+ "./common": {
18
+ "types": "./dist/common.d.ts",
19
+ "import": "./dist/common.js"
20
+ },
21
+ "./pagination": {
22
+ "types": "./dist/pagination.d.ts",
23
+ "import": "./dist/pagination.js"
24
+ },
25
+ "./parkingBooking": {
26
+ "types": "./dist/parkingBooking.d.ts",
27
+ "import": "./dist/parkingBooking.js"
28
+ },
29
+ "./event": {
30
+ "types": "./dist/event.d.ts",
31
+ "import": "./dist/event.js"
32
+ },
33
+ "./parkingArea": {
34
+ "types": "./dist/parkingArea.d.ts",
35
+ "import": "./dist/parkingArea.js"
36
+ },
37
+ "./enums": {
38
+ "types": "./dist/enums/index.d.ts",
39
+ "import": "./dist/enums/index.js"
40
+ },
41
+ "./accessToken": {
42
+ "types": "./dist/accessToken.d.ts",
43
+ "import": "./dist/accessToken.js"
44
+ }
45
+ },
46
+ "files": [
47
+ "dist"
48
+ ],
49
+ "scripts": {
50
+ "build": "npm run clean && tsc",
51
+ "dev": "tsc --watch",
52
+ "clean": "rm -rf dist",
53
+ "prepublishOnly": "npm run build"
54
+ },
55
+ "keywords": [
56
+ "schemas",
57
+ "validation",
58
+ "types",
59
+ "zod",
60
+ "phasing-engine"
61
+ ],
62
+ "license": "MIT",
63
+ "dependencies": {
64
+ "@asteasolutions/zod-to-openapi": "^8.1.0",
65
+ "zod": "^4.1.13"
66
+ },
67
+ "devDependencies": {
68
+ "typescript": "^5.6.3"
69
+ },
70
+ "repository": {
71
+ "type": "git",
72
+ "url": "git+https://github.com/manaty/phasing_engine.git",
73
+ "directory": "packages/phasing-schemas"
74
+ }
75
+ }