@explorins/pers-sdk 2.1.42 → 2.2.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.
- package/dist/booking/api/booking-api.d.ts +71 -0
- package/dist/booking/api/booking-api.d.ts.map +1 -0
- package/dist/booking/index.d.ts +9 -0
- package/dist/booking/index.d.ts.map +1 -0
- package/dist/booking/services/booking-service.d.ts +79 -0
- package/dist/booking/services/booking-service.d.ts.map +1 -0
- package/dist/chunks/{pers-sdk-DxYmXQcW.js → pers-sdk-C01Z2nmP.js} +923 -4
- package/dist/chunks/pers-sdk-C01Z2nmP.js.map +1 -0
- package/dist/chunks/{pers-sdk-DeFxjuRB.cjs → pers-sdk-DQ6uC3h0.cjs} +925 -2
- package/dist/chunks/pers-sdk-DQ6uC3h0.cjs.map +1 -0
- package/dist/core/events/event-types.d.ts +5 -1
- package/dist/core/events/event-types.d.ts.map +1 -1
- package/dist/core/pers-api-client.d.ts.map +1 -1
- package/dist/core/pers-config.d.ts +30 -0
- package/dist/core/pers-config.d.ts.map +1 -1
- package/dist/core.cjs +3 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +1 -1
- package/dist/custom-field/api/custom-field-api.d.ts +58 -0
- package/dist/custom-field/api/custom-field-api.d.ts.map +1 -0
- package/dist/custom-field/index.d.ts +2 -0
- package/dist/custom-field/index.d.ts.map +1 -0
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/managers/booking-manager.d.ts +188 -0
- package/dist/managers/booking-manager.d.ts.map +1 -0
- package/dist/managers/custom-field-definition-manager.d.ts +317 -0
- package/dist/managers/custom-field-definition-manager.d.ts.map +1 -0
- package/dist/managers/index.d.ts +2 -0
- package/dist/managers/index.d.ts.map +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.js +1 -1
- package/dist/package.json +2 -2
- package/dist/pers-sdk.d.ts +65 -1
- package/dist/pers-sdk.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/chunks/pers-sdk-DeFxjuRB.cjs.map +0 -1
- package/dist/chunks/pers-sdk-DxYmXQcW.js.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { PersApiClient } from '../../core/pers-api-client';
|
|
2
|
+
import type { BookingDTO, CreateBookingDTO, UpdateBookingDTO } from '@explorins/pers-shared';
|
|
3
|
+
/**
|
|
4
|
+
* Booking filter options for querying bookings
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Options for booking validation checks
|
|
8
|
+
*/
|
|
9
|
+
export interface BookingValidationOptions {
|
|
10
|
+
/** Status to check - defaults to checking active+future */
|
|
11
|
+
status?: 'active' | 'future' | 'past' | 'active_future' | 'any';
|
|
12
|
+
/** Business ID to filter by */
|
|
13
|
+
businessId?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface BookingQueryOptions {
|
|
16
|
+
userId?: string;
|
|
17
|
+
businessId?: string;
|
|
18
|
+
status?: 'active' | 'future' | 'past' | 'any';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Low-level API for booking operations
|
|
22
|
+
*
|
|
23
|
+
* Provides direct HTTP calls to the booking endpoints.
|
|
24
|
+
* For most use cases, prefer using BookingManager or BookingService.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare class BookingApi {
|
|
29
|
+
private readonly apiClient;
|
|
30
|
+
private readonly basePath;
|
|
31
|
+
constructor(apiClient: PersApiClient);
|
|
32
|
+
/**
|
|
33
|
+
* List all bookings with optional filters
|
|
34
|
+
*
|
|
35
|
+
* @param options - Filter options (userId, businessId, status)
|
|
36
|
+
* @returns Promise resolving to array of bookings
|
|
37
|
+
*/
|
|
38
|
+
getAll(options?: BookingQueryOptions): Promise<BookingDTO[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Get a single booking by ID
|
|
41
|
+
*
|
|
42
|
+
* @param id - Booking UUID
|
|
43
|
+
* @returns Promise resolving to booking data
|
|
44
|
+
*/
|
|
45
|
+
getById(id: string): Promise<BookingDTO>;
|
|
46
|
+
/**
|
|
47
|
+
* Create a new booking
|
|
48
|
+
*
|
|
49
|
+
* @param data - Booking creation data
|
|
50
|
+
* @returns Promise resolving to created booking
|
|
51
|
+
*/
|
|
52
|
+
create(data: CreateBookingDTO): Promise<BookingDTO>;
|
|
53
|
+
/**
|
|
54
|
+
* Update an existing booking
|
|
55
|
+
*
|
|
56
|
+
* @param id - Booking UUID
|
|
57
|
+
* @param data - Booking update data
|
|
58
|
+
* @returns Promise resolving to updated booking
|
|
59
|
+
*/
|
|
60
|
+
update(id: string, data: UpdateBookingDTO): Promise<BookingDTO>;
|
|
61
|
+
/**
|
|
62
|
+
* Delete a booking
|
|
63
|
+
*
|
|
64
|
+
* @param id - Booking UUID
|
|
65
|
+
* @returns Promise resolving to success status
|
|
66
|
+
*/
|
|
67
|
+
delete(id: string): Promise<{
|
|
68
|
+
success: boolean;
|
|
69
|
+
}>;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=booking-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking-api.d.ts","sourceRoot":"","sources":["../../../src/booking/api/booking-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,2DAA2D;IAC3D,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,eAAe,GAAG,KAAK,CAAC;IAChE,+BAA+B;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;CAC/C;AAED;;;;;;;GAOG;AACH,qBAAa,UAAU;IAGT,OAAO,CAAC,QAAQ,CAAC,SAAS;IAFtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAe;gBAEX,SAAS,EAAE,aAAa;IAErD;;;;;OAKG;IACG,MAAM,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAmBlE;;;;;OAKG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI9C;;;;;OAKG;IACG,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IAIzD;;;;;;OAMG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IAIrE;;;;;OAKG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAGxD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @explorins/pers-sdk-booking
|
|
3
|
+
*
|
|
4
|
+
* Platform-agnostic Booking Domain SDK for PERS ecosystem
|
|
5
|
+
* Handles booking management for eligibility checks and tracking
|
|
6
|
+
*/
|
|
7
|
+
export { BookingApi, type BookingQueryOptions, type BookingValidationOptions } from './api/booking-api';
|
|
8
|
+
export { BookingService } from './services/booking-service';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/booking/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,UAAU,EAAE,KAAK,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAGxG,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { BookingApi, type BookingQueryOptions, type BookingValidationOptions } from '../api/booking-api';
|
|
2
|
+
import type { BookingDTO, CreateBookingDTO, UpdateBookingDTO } from '@explorins/pers-shared';
|
|
3
|
+
/**
|
|
4
|
+
* Booking Service - Business logic layer for booking operations
|
|
5
|
+
*
|
|
6
|
+
* Provides booking management functionality with validation and
|
|
7
|
+
* business rule enforcement.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare class BookingService {
|
|
12
|
+
private readonly bookingApi;
|
|
13
|
+
constructor(bookingApi: BookingApi);
|
|
14
|
+
/**
|
|
15
|
+
* Get all bookings with optional filters
|
|
16
|
+
*
|
|
17
|
+
* @param options - Filter options
|
|
18
|
+
* @returns Promise resolving to array of bookings
|
|
19
|
+
*/
|
|
20
|
+
getAll(options?: BookingQueryOptions): Promise<BookingDTO[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Get bookings for a specific user
|
|
23
|
+
*
|
|
24
|
+
* @param userId - User ID to filter by
|
|
25
|
+
* @param status - Optional status filter
|
|
26
|
+
* @returns Promise resolving to user's bookings
|
|
27
|
+
*/
|
|
28
|
+
getByUser(userId: string, status?: BookingQueryOptions['status']): Promise<BookingDTO[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Get bookings for a specific business
|
|
31
|
+
*
|
|
32
|
+
* @param businessId - Business ID to filter by
|
|
33
|
+
* @param status - Optional status filter
|
|
34
|
+
* @returns Promise resolving to business's bookings
|
|
35
|
+
*/
|
|
36
|
+
getByBusiness(businessId: string, status?: BookingQueryOptions['status']): Promise<BookingDTO[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Get a single booking by ID
|
|
39
|
+
*
|
|
40
|
+
* @param id - Booking UUID
|
|
41
|
+
* @returns Promise resolving to booking data
|
|
42
|
+
*/
|
|
43
|
+
getById(id: string): Promise<BookingDTO>;
|
|
44
|
+
/**
|
|
45
|
+
* Create a new booking
|
|
46
|
+
*
|
|
47
|
+
* @param data - Booking creation data
|
|
48
|
+
* @returns Promise resolving to created booking
|
|
49
|
+
*/
|
|
50
|
+
create(data: CreateBookingDTO): Promise<BookingDTO>;
|
|
51
|
+
/**
|
|
52
|
+
* Update an existing booking
|
|
53
|
+
*
|
|
54
|
+
* @param id - Booking UUID
|
|
55
|
+
* @param data - Booking update data
|
|
56
|
+
* @returns Promise resolving to updated booking
|
|
57
|
+
*/
|
|
58
|
+
update(id: string, data: UpdateBookingDTO): Promise<BookingDTO>;
|
|
59
|
+
/**
|
|
60
|
+
* Delete a booking
|
|
61
|
+
*
|
|
62
|
+
* @param id - Booking UUID
|
|
63
|
+
* @returns Promise resolving to success status
|
|
64
|
+
*/
|
|
65
|
+
delete(id: string): Promise<{
|
|
66
|
+
success: boolean;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Check if a user has an active or future booking
|
|
70
|
+
*
|
|
71
|
+
* Useful for eligibility checks on redemptions.
|
|
72
|
+
*
|
|
73
|
+
* @param userId - User ID to check
|
|
74
|
+
* @param options - Validation options (status filter, business filter)
|
|
75
|
+
* @returns Promise resolving to true if user has valid booking
|
|
76
|
+
*/
|
|
77
|
+
hasValidBooking(userId: string, options?: BookingValidationOptions): Promise<boolean>;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=booking-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking-service.d.ts","sourceRoot":"","sources":["../../../src/booking/services/booking-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACzG,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MA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