@venulog/phasing-engine-schemas 0.4.0-alpha.1 → 0.4.0-alpha.2

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.
@@ -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/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './phaseBooking.js';
5
5
  export * from './phaseSlot.js';
6
6
  export * from './parkingArea.js';
7
7
  export * from './event.js';
8
+ export * from './accessToken.js';
8
9
  export * from './enums/bookingStatus.js';
9
10
  export * from './enums/phaseSlotScheduleType.js';
10
11
  export * from './enums/parkingAreaScheduleType.js';
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ export * from './phaseBooking.js';
6
6
  export * from './phaseSlot.js';
7
7
  export * from './parkingArea.js';
8
8
  export * from './event.js';
9
+ export * from './accessToken.js';
9
10
  // Enum exports
10
11
  export * from './enums/bookingStatus.js';
11
12
  export * from './enums/phaseSlotScheduleType.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venulog/phasing-engine-schemas",
3
- "version": "0.4.0-alpha.1",
3
+ "version": "0.4.0-alpha.2",
4
4
  "description": "Shared schemas and types for Phasing Engine API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",