@timum/timum_pdk 3.1.0 → 3.2.0
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/main.js +3 -3
- package/package.json +2 -2
- package/src/timumPdk.js +23 -4
package/package.json
CHANGED
package/src/timumPdk.js
CHANGED
|
@@ -67,6 +67,7 @@ export const timumApiSlice = createApi({
|
|
|
67
67
|
'Provider',
|
|
68
68
|
'User',
|
|
69
69
|
'IdentifiedCustomer',
|
|
70
|
+
'BookingConfig',
|
|
70
71
|
],
|
|
71
72
|
endpoints: (builder) => ({
|
|
72
73
|
// ##########################################
|
|
@@ -75,10 +76,7 @@ export const timumApiSlice = createApi({
|
|
|
75
76
|
|
|
76
77
|
cancelableBookable: builder.query({
|
|
77
78
|
query: (props) => ({
|
|
78
|
-
url: constructUrl(
|
|
79
|
-
`/bookables/cancelable_bookable`,
|
|
80
|
-
props,
|
|
81
|
-
),
|
|
79
|
+
url: constructUrl(`/bookables/cancelable_bookable`, props),
|
|
82
80
|
method: 'get',
|
|
83
81
|
headers: props.headers,
|
|
84
82
|
}),
|
|
@@ -127,6 +125,23 @@ export const timumApiSlice = createApi({
|
|
|
127
125
|
providesTags: (/* result = [], error, arg */) => ['Product'],
|
|
128
126
|
}),
|
|
129
127
|
|
|
128
|
+
// Public, unauthenticated product-scoped bookingConfig fetch.
|
|
129
|
+
// Customer-facing widget loads this lazily when a product is selected so
|
|
130
|
+
// the product's override slice can be merged on top of the channel config.
|
|
131
|
+
// Default keepUnusedDataFor (60s) is too short for a booking session —
|
|
132
|
+
// 2h covers realistic product-toggle patterns without re-fetching.
|
|
133
|
+
getProductBookingConf: builder.query({
|
|
134
|
+
query: (props) => ({
|
|
135
|
+
url: constructUrl(`/products/${props.prdRef}/bookingConfig`, props),
|
|
136
|
+
headers: props.headers,
|
|
137
|
+
method: 'get',
|
|
138
|
+
}),
|
|
139
|
+
providesTags: (_result, _error, arg) => [
|
|
140
|
+
{ type: 'BookingConfig', id: `product:${arg.prdRef}` },
|
|
141
|
+
],
|
|
142
|
+
keepUnusedDataFor: 7200,
|
|
143
|
+
}),
|
|
144
|
+
|
|
130
145
|
createAppointmentWithConsumer: builder.mutation({
|
|
131
146
|
query: (props) => ({
|
|
132
147
|
url: constructUrl(
|
|
@@ -349,6 +364,8 @@ export const {
|
|
|
349
364
|
// # ConsumerAPI v2
|
|
350
365
|
// ##########################################
|
|
351
366
|
|
|
367
|
+
useLazyCancelableBookableQuery,
|
|
368
|
+
useCancelableBookableQuery,
|
|
352
369
|
useUpcomingBookablesQuery,
|
|
353
370
|
useLazyUpcomingBookablesQuery,
|
|
354
371
|
useSpecificBookablesQuery,
|
|
@@ -357,6 +374,8 @@ export const {
|
|
|
357
374
|
useLazyActiveProductsQuery,
|
|
358
375
|
useSpecificProductsQuery,
|
|
359
376
|
useLazySpecificProductsQuery,
|
|
377
|
+
useGetProductBookingConfQuery,
|
|
378
|
+
useLazyGetProductBookingConfQuery,
|
|
360
379
|
useCreateAppointmentWithConsumerMutation,
|
|
361
380
|
useIdentifyCustomerQuery,
|
|
362
381
|
useLazyIdentifyCustomerQuery,
|