@venulog/phasing-engine-schemas 0.4.0-alpha.0 → 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';
@@ -392,7 +392,7 @@ export declare const updatePhaseBookingBodySchema: z.ZodObject<{
392
392
  }, z.core.$strip>;
393
393
  export declare const updatePhaseBookingDataSchema: z.ZodObject<{
394
394
  booking_id: z.ZodNumber;
395
- session_id: z.ZodString;
395
+ qr_token: z.ZodString;
396
396
  company: z.ZodNullable<z.ZodObject<{
397
397
  hall: z.ZodString;
398
398
  stand_number: z.ZodString;
@@ -420,7 +420,7 @@ export declare const updatePhaseBookingResponseSchema: z.ZodObject<{
420
420
  message: z.ZodString;
421
421
  data: z.ZodObject<{
422
422
  booking_id: z.ZodNumber;
423
- session_id: z.ZodString;
423
+ qr_token: z.ZodString;
424
424
  company: z.ZodNullable<z.ZodObject<{
425
425
  hall: z.ZodString;
426
426
  stand_number: z.ZodString;
@@ -852,7 +852,7 @@ export declare const getBookingDetailsParamsSchema: z.ZodObject<{
852
852
  bookingId: z.ZodCoercedNumber<unknown>;
853
853
  }, z.core.$strip>;
854
854
  export declare const bookingDetailsDataSchema: z.ZodObject<{
855
- access_token: z.ZodNullable<z.ZodString>;
855
+ qr_token: z.ZodNullable<z.ZodString>;
856
856
  booking_id: z.ZodNumber;
857
857
  status: z.ZodString;
858
858
  booking_date: z.ZodString;
@@ -900,7 +900,7 @@ export declare const bookingDetailsDataSchema: z.ZodObject<{
900
900
  export declare const getBookingDetailsResponseSchema: z.ZodObject<{
901
901
  success: z.ZodBoolean;
902
902
  data: z.ZodObject<{
903
- access_token: z.ZodNullable<z.ZodString>;
903
+ qr_token: z.ZodNullable<z.ZodString>;
904
904
  booking_id: z.ZodNumber;
905
905
  status: z.ZodString;
906
906
  booking_date: z.ZodString;
@@ -955,7 +955,7 @@ export declare const getBookingDetailsByTokenBodySchema: z.ZodObject<{
955
955
  export declare const getBookingDetailsByTokenResponseSchema: z.ZodObject<{
956
956
  success: z.ZodBoolean;
957
957
  data: z.ZodObject<{
958
- access_token: z.ZodNullable<z.ZodString>;
958
+ qr_token: z.ZodNullable<z.ZodString>;
959
959
  booking_id: z.ZodNumber;
960
960
  status: z.ZodString;
961
961
  booking_date: z.ZodString;
@@ -1009,7 +1009,7 @@ export type UpdatePhaseBookingResponse = z.infer<typeof updatePhaseBookingRespon
1009
1009
  export declare const bookingWithRelationsSchema: z.ZodObject<{
1010
1010
  id: z.ZodNumber;
1011
1011
  status: z.ZodString;
1012
- session_id: z.ZodNullable<z.ZodString>;
1012
+ qr_token: z.ZodNullable<z.ZodString>;
1013
1013
  booking_date: z.ZodString;
1014
1014
  start_time: z.ZodString;
1015
1015
  end_time: z.ZodString;
@@ -468,8 +468,8 @@ export const updatePhaseBookingDataSchema = z
468
468
  description: 'ID of the updated booking',
469
469
  example: 1
470
470
  }),
471
- session_id: z.string().openapi({
472
- description: 'New regenerated session token',
471
+ qr_token: z.string().openapi({
472
+ description: 'New regenerated QR token',
473
473
  example: 'ACCESS_1a2b3c4d5e6f7g8h_eyJib29raW5nSWQiOjF9'
474
474
  }),
475
475
  company: companyDetailsSchema.nullable().openapi({
@@ -962,8 +962,8 @@ export const getBookingDetailsParamsSchema = z
962
962
  .openapi('GetBookingDetailsParams');
963
963
  export const bookingDetailsDataSchema = z
964
964
  .object({
965
- access_token: z.string().nullable().openapi({
966
- description: 'Access pass token for verification',
965
+ qr_token: z.string().nullable().openapi({
966
+ description: 'QR token for verification',
967
967
  example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
968
968
  }),
969
969
  booking_id: z.number().openapi({
@@ -1066,7 +1066,7 @@ export const bookingWithRelationsSchema = z
1066
1066
  .object({
1067
1067
  id: z.number(),
1068
1068
  status: z.string(),
1069
- session_id: z.string().nullable(),
1069
+ qr_token: z.string().nullable(),
1070
1070
  booking_date: z.string(),
1071
1071
  start_time: z.string(),
1072
1072
  end_time: z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venulog/phasing-engine-schemas",
3
- "version": "0.4.0-alpha.0",
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",