@venulog/phasing-engine-schemas 0.3.0-alpha.0 → 0.3.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/dist/accessToken.d.ts +23 -0
- package/dist/accessToken.js +37 -0
- package/dist/common.d.ts +9 -0
- package/dist/common.js +29 -0
- package/dist/enums/index.d.ts +3 -0
- package/dist/enums/index.js +4 -0
- package/dist/enums/parkingAreaScheduleType.d.ts +4 -0
- package/dist/enums/parkingAreaScheduleType.js +5 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/parkingArea.d.ts +591 -0
- package/dist/parkingArea.js +796 -0
- package/dist/phaseBooking.d.ts +558 -0
- package/dist/phaseBooking.js +443 -1
- package/dist/phaseSlot.d.ts +2 -0
- package/dist/phaseSlot.js +15 -0
- package/package.json +9 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from './zod';
|
|
2
|
+
export declare const getAccessTokenParamsSchema: z.ZodObject<{
|
|
3
|
+
bookingId: z.ZodCoercedNumber<unknown>;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export declare const accessTokenDataSchema: z.ZodObject<{
|
|
6
|
+
access_token: z.ZodString;
|
|
7
|
+
booking_id: z.ZodNumber;
|
|
8
|
+
qr_token: z.ZodString;
|
|
9
|
+
expires_in: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export declare const getAccessTokenResponseSchema: z.ZodObject<{
|
|
12
|
+
success: z.ZodBoolean;
|
|
13
|
+
message: z.ZodString;
|
|
14
|
+
data: z.ZodObject<{
|
|
15
|
+
access_token: z.ZodString;
|
|
16
|
+
booking_id: z.ZodNumber;
|
|
17
|
+
qr_token: z.ZodString;
|
|
18
|
+
expires_in: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type GetAccessTokenParams = z.infer<typeof getAccessTokenParamsSchema>;
|
|
22
|
+
export type AccessTokenData = z.infer<typeof accessTokenDataSchema>;
|
|
23
|
+
export type GetAccessTokenResponse = z.infer<typeof getAccessTokenResponseSchema>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from './zod';
|
|
2
|
+
import { createMessageDataResponseSchema } from './common';
|
|
3
|
+
export const getAccessTokenParamsSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
bookingId: z.coerce
|
|
6
|
+
.number()
|
|
7
|
+
.int()
|
|
8
|
+
.positive({
|
|
9
|
+
message: 'Booking ID must be a positive integer'
|
|
10
|
+
})
|
|
11
|
+
.openapi({
|
|
12
|
+
description: 'The ID of the booking to generate access token for',
|
|
13
|
+
example: 1
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
.openapi('GetAccessTokenParams');
|
|
17
|
+
export const accessTokenDataSchema = z
|
|
18
|
+
.object({
|
|
19
|
+
access_token: z.string().openapi({
|
|
20
|
+
description: 'JWT access token for the booking',
|
|
21
|
+
example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
22
|
+
}),
|
|
23
|
+
booking_id: z.number().openapi({
|
|
24
|
+
description: 'ID of the booking',
|
|
25
|
+
example: 1
|
|
26
|
+
}),
|
|
27
|
+
qr_token: z.string().openapi({
|
|
28
|
+
description: 'QR token identifier',
|
|
29
|
+
example: 'ACCESS_a1B2c3D4e5F6g7H8'
|
|
30
|
+
}),
|
|
31
|
+
expires_in: z.string().openapi({
|
|
32
|
+
description: 'Token expiration duration',
|
|
33
|
+
example: '7d'
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
.openapi('AccessTokenData');
|
|
37
|
+
export const getAccessTokenResponseSchema = createMessageDataResponseSchema(accessTokenDataSchema, 'GetAccessTokenResponse', 'Access token generated successfully', 'Access token and related information');
|
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');
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,10 @@ 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';
|
|
8
|
+
export * from './accessToken.js';
|
|
7
9
|
export * from './enums/bookingStatus.js';
|
|
8
10
|
export * from './enums/phaseSlotScheduleType.js';
|
|
11
|
+
export * from './enums/parkingAreaScheduleType.js';
|
|
9
12
|
export { z } from './zod.js';
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,12 @@ 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';
|
|
9
|
+
export * from './accessToken.js';
|
|
8
10
|
// Enum exports
|
|
9
11
|
export * from './enums/bookingStatus.js';
|
|
10
12
|
export * from './enums/phaseSlotScheduleType.js';
|
|
13
|
+
export * from './enums/parkingAreaScheduleType.js';
|
|
11
14
|
// Zod re-export for convenience
|
|
12
15
|
export { z } from './zod.js';
|