@venulog/phasing-engine-schemas 0.3.0 → 0.4.0-alpha.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
+ ```
package/dist/common.d.ts CHANGED
@@ -16,3 +16,12 @@ export declare function createMessageDataResponseSchema<T extends z.ZodTypeAny>(
16
16
  data: T;
17
17
  }, z.core.$strip>;
18
18
  export type BaseResponse = z.infer<typeof baseResponseSchema>;
19
+ export declare const documentSchema: z.ZodObject<{
20
+ url: z.ZodURL;
21
+ name: z.ZodOptional<z.ZodString>;
22
+ size: z.ZodOptional<z.ZodNumber>;
23
+ bucket: z.ZodOptional<z.ZodString>;
24
+ type: z.ZodOptional<z.ZodString>;
25
+ path: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strip>;
27
+ export type Document = z.infer<typeof documentSchema>;
package/dist/common.js CHANGED
@@ -43,3 +43,32 @@ export function createMessageDataResponseSchema(dataSchema, schemaName, messageE
43
43
  })
44
44
  .openapi(schemaName);
45
45
  }
46
+ // Document schema for file attachments
47
+ export const documentSchema = z
48
+ .object({
49
+ url: z.url().openapi({
50
+ description: 'URL of the document',
51
+ example: 'https://example.com/document.pdf'
52
+ }),
53
+ name: z.string().optional().openapi({
54
+ description: 'Name of the document',
55
+ example: 'event-banner.jpg'
56
+ }),
57
+ size: z.number().optional().openapi({
58
+ description: 'Size of the document in bytes',
59
+ example: 1024000
60
+ }),
61
+ bucket: z.string().optional().openapi({
62
+ description: 'Storage bucket name',
63
+ example: 'event-assets'
64
+ }),
65
+ type: z.string().optional().openapi({
66
+ description: 'MIME type of the document',
67
+ example: 'image/jpeg'
68
+ }),
69
+ path: z.string().optional().openapi({
70
+ description: 'Storage path of the document',
71
+ example: 'events/banners/event-123-banner.jpg'
72
+ })
73
+ })
74
+ .openapi('Document');
@@ -0,0 +1,3 @@
1
+ export * from './bookingStatus.js';
2
+ export * from './phaseSlotScheduleType.js';
3
+ export * from './parkingAreaScheduleType.js';
@@ -0,0 +1,4 @@
1
+ // Enum exports
2
+ export * from './bookingStatus.js';
3
+ export * from './phaseSlotScheduleType.js';
4
+ export * from './parkingAreaScheduleType.js';
@@ -0,0 +1,4 @@
1
+ export declare enum ParkingAreaScheduleType {
2
+ ASSEMBLY = "assembly",
3
+ DISMANTLING = "dismantling"
4
+ }
@@ -0,0 +1,5 @@
1
+ export var ParkingAreaScheduleType;
2
+ (function (ParkingAreaScheduleType) {
3
+ ParkingAreaScheduleType["ASSEMBLY"] = "assembly";
4
+ ParkingAreaScheduleType["DISMANTLING"] = "dismantling";
5
+ })(ParkingAreaScheduleType || (ParkingAreaScheduleType = {}));
package/dist/index.d.ts CHANGED
@@ -3,7 +3,9 @@ export * from './pagination.js';
3
3
  export * from './auth.js';
4
4
  export * from './phaseBooking.js';
5
5
  export * from './phaseSlot.js';
6
+ export * from './parkingArea.js';
6
7
  export * from './event.js';
7
8
  export * from './enums/bookingStatus.js';
8
9
  export * from './enums/phaseSlotScheduleType.js';
10
+ export * from './enums/parkingAreaScheduleType.js';
9
11
  export { z } from './zod.js';
package/dist/index.js CHANGED
@@ -4,9 +4,11 @@ export * from './pagination.js';
4
4
  export * from './auth.js';
5
5
  export * from './phaseBooking.js';
6
6
  export * from './phaseSlot.js';
7
+ export * from './parkingArea.js';
7
8
  export * from './event.js';
8
9
  // Enum exports
9
10
  export * from './enums/bookingStatus.js';
10
11
  export * from './enums/phaseSlotScheduleType.js';
12
+ export * from './enums/parkingAreaScheduleType.js';
11
13
  // Zod re-export for convenience
12
14
  export { z } from './zod.js';