@venulog/phasing-engine-schemas 0.7.0-alpha.3 → 0.7.0-alpha.4
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 +67 -67
- package/dist/parkingBooking.d.ts +16 -12
- package/dist/parkingBooking.js +9 -1
- package/package.json +75 -75
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
|
+
```
|
package/dist/parkingBooking.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export declare const parkingBookingSchema: z.ZodObject<{
|
|
|
76
76
|
}, z.core.$strip>>;
|
|
77
77
|
}, z.core.$strip>;
|
|
78
78
|
export declare const companyDetailsSchema: z.ZodObject<{
|
|
79
|
-
hall: z.
|
|
79
|
+
hall: z.ZodString;
|
|
80
80
|
stand_number: z.ZodString;
|
|
81
81
|
company_name: z.ZodString;
|
|
82
82
|
business: z.ZodString;
|
|
@@ -257,7 +257,7 @@ export declare const bookingDetailsDataSchema: z.ZodObject<{
|
|
|
257
257
|
end_time: z.ZodString;
|
|
258
258
|
company_role: z.ZodNullable<z.ZodString>;
|
|
259
259
|
company: z.ZodObject<{
|
|
260
|
-
hall: z.
|
|
260
|
+
hall: z.ZodString;
|
|
261
261
|
stand_number: z.ZodString;
|
|
262
262
|
company_name: z.ZodString;
|
|
263
263
|
business: z.ZodString;
|
|
@@ -297,7 +297,7 @@ export declare const bookingDetailsDataSchema: z.ZodObject<{
|
|
|
297
297
|
export declare const createParkingBookingBodySchema: z.ZodObject<{
|
|
298
298
|
parking_area_schedule_id: z.ZodNumber;
|
|
299
299
|
company: z.ZodObject<{
|
|
300
|
-
hall: z.
|
|
300
|
+
hall: z.ZodString;
|
|
301
301
|
stand_number: z.ZodString;
|
|
302
302
|
company_name: z.ZodString;
|
|
303
303
|
business: z.ZodString;
|
|
@@ -325,7 +325,7 @@ export declare const createParkingBookingDataSchema: z.ZodObject<{
|
|
|
325
325
|
status: z.ZodString;
|
|
326
326
|
company_role: z.ZodString;
|
|
327
327
|
company: z.ZodObject<{
|
|
328
|
-
hall: z.
|
|
328
|
+
hall: z.ZodString;
|
|
329
329
|
stand_number: z.ZodString;
|
|
330
330
|
company_name: z.ZodString;
|
|
331
331
|
business: z.ZodString;
|
|
@@ -358,7 +358,7 @@ export declare const createParkingBookingResponseSchema: z.ZodObject<{
|
|
|
358
358
|
status: z.ZodString;
|
|
359
359
|
company_role: z.ZodString;
|
|
360
360
|
company: z.ZodObject<{
|
|
361
|
-
hall: z.
|
|
361
|
+
hall: z.ZodString;
|
|
362
362
|
stand_number: z.ZodString;
|
|
363
363
|
company_name: z.ZodString;
|
|
364
364
|
business: z.ZodString;
|
|
@@ -385,7 +385,7 @@ export declare const createParkingBookingResponseSchema: z.ZodObject<{
|
|
|
385
385
|
}, z.core.$strip>;
|
|
386
386
|
export declare const updateParkingBookingBodySchema: z.ZodObject<{
|
|
387
387
|
company: z.ZodOptional<z.ZodObject<{
|
|
388
|
-
hall: z.
|
|
388
|
+
hall: z.ZodString;
|
|
389
389
|
stand_number: z.ZodString;
|
|
390
390
|
company_name: z.ZodString;
|
|
391
391
|
business: z.ZodString;
|
|
@@ -409,7 +409,7 @@ export declare const updateParkingBookingDataSchema: z.ZodObject<{
|
|
|
409
409
|
booking_id: z.ZodNumber;
|
|
410
410
|
qr_token: z.ZodString;
|
|
411
411
|
company: z.ZodNullable<z.ZodObject<{
|
|
412
|
-
hall: z.
|
|
412
|
+
hall: z.ZodString;
|
|
413
413
|
stand_number: z.ZodString;
|
|
414
414
|
company_name: z.ZodString;
|
|
415
415
|
business: z.ZodString;
|
|
@@ -437,7 +437,7 @@ export declare const updateParkingBookingResponseSchema: z.ZodObject<{
|
|
|
437
437
|
booking_id: z.ZodNumber;
|
|
438
438
|
qr_token: z.ZodString;
|
|
439
439
|
company: z.ZodNullable<z.ZodObject<{
|
|
440
|
-
hall: z.
|
|
440
|
+
hall: z.ZodString;
|
|
441
441
|
stand_number: z.ZodString;
|
|
442
442
|
company_name: z.ZodString;
|
|
443
443
|
business: z.ZodString;
|
|
@@ -547,7 +547,7 @@ export declare const parkingBookingDetailsDataSchema: z.ZodObject<{
|
|
|
547
547
|
end_time: z.ZodString;
|
|
548
548
|
company_role: z.ZodNullable<z.ZodString>;
|
|
549
549
|
company: z.ZodObject<{
|
|
550
|
-
hall: z.
|
|
550
|
+
hall: z.ZodString;
|
|
551
551
|
stand_number: z.ZodString;
|
|
552
552
|
company_name: z.ZodString;
|
|
553
553
|
business: z.ZodString;
|
|
@@ -587,6 +587,8 @@ export declare const parkingBookingDetailsDataSchema: z.ZodObject<{
|
|
|
587
587
|
}, z.core.$strip>>;
|
|
588
588
|
created_at: z.ZodString;
|
|
589
589
|
updated_at: z.ZodString;
|
|
590
|
+
entry_scanned_at: z.ZodNullable<z.ZodString>;
|
|
591
|
+
exit_scanned_at: z.ZodNullable<z.ZodString>;
|
|
590
592
|
}, z.core.$strip>;
|
|
591
593
|
export declare const getParkingBookingDetailsResponseSchema: z.ZodObject<{
|
|
592
594
|
success: z.ZodBoolean;
|
|
@@ -600,7 +602,7 @@ export declare const getParkingBookingDetailsResponseSchema: z.ZodObject<{
|
|
|
600
602
|
end_time: z.ZodString;
|
|
601
603
|
company_role: z.ZodNullable<z.ZodString>;
|
|
602
604
|
company: z.ZodObject<{
|
|
603
|
-
hall: z.
|
|
605
|
+
hall: z.ZodString;
|
|
604
606
|
stand_number: z.ZodString;
|
|
605
607
|
company_name: z.ZodString;
|
|
606
608
|
business: z.ZodString;
|
|
@@ -640,6 +642,8 @@ export declare const getParkingBookingDetailsResponseSchema: z.ZodObject<{
|
|
|
640
642
|
}, z.core.$strip>>;
|
|
641
643
|
created_at: z.ZodString;
|
|
642
644
|
updated_at: z.ZodString;
|
|
645
|
+
entry_scanned_at: z.ZodNullable<z.ZodString>;
|
|
646
|
+
exit_scanned_at: z.ZodNullable<z.ZodString>;
|
|
643
647
|
}, z.core.$strip>;
|
|
644
648
|
}, z.core.$strip>;
|
|
645
649
|
export declare const getParkingBookingDetailsByTokenBodySchema: z.ZodObject<{
|
|
@@ -657,7 +661,7 @@ export declare const getParkingBookingDetailsByTokenResponseSchema: z.ZodObject<
|
|
|
657
661
|
end_time: z.ZodString;
|
|
658
662
|
company_role: z.ZodNullable<z.ZodString>;
|
|
659
663
|
company: z.ZodObject<{
|
|
660
|
-
hall: z.
|
|
664
|
+
hall: z.ZodString;
|
|
661
665
|
stand_number: z.ZodString;
|
|
662
666
|
company_name: z.ZodString;
|
|
663
667
|
business: z.ZodString;
|
|
@@ -710,7 +714,7 @@ export declare const getParkingBookingDetailsByQrResponseSchema: z.ZodObject<{
|
|
|
710
714
|
end_time: z.ZodString;
|
|
711
715
|
company_role: z.ZodNullable<z.ZodString>;
|
|
712
716
|
company: z.ZodObject<{
|
|
713
|
-
hall: z.
|
|
717
|
+
hall: z.ZodString;
|
|
714
718
|
stand_number: z.ZodString;
|
|
715
719
|
company_name: z.ZodString;
|
|
716
720
|
business: z.ZodString;
|
package/dist/parkingBooking.js
CHANGED
|
@@ -104,7 +104,7 @@ export const parkingBookingSchema = z.object({
|
|
|
104
104
|
});
|
|
105
105
|
export const companyDetailsSchema = z
|
|
106
106
|
.object({
|
|
107
|
-
hall: z.string().
|
|
107
|
+
hall: z.string().min(1, 'Hall is required').openapi({
|
|
108
108
|
description: 'Hall location',
|
|
109
109
|
example: 'Hall 1'
|
|
110
110
|
}),
|
|
@@ -693,6 +693,14 @@ export const parkingBookingDetailsDataSchema = z
|
|
|
693
693
|
updated_at: z.string().openapi({
|
|
694
694
|
description: 'Timestamp when booking was last updated',
|
|
695
695
|
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'
|
|
696
704
|
})
|
|
697
705
|
})
|
|
698
706
|
.openapi('ParkingBookingDetailsData');
|
package/package.json
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@venulog/phasing-engine-schemas",
|
|
3
|
-
"version": "0.7.0-alpha.
|
|
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": "
|
|
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.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
|
+
}
|