@timum/timum_pdk 3.1.1 → 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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@timum/timum_pdk",
3
- "version": "3.1.1",
4
- "next_version": "3.1.1",
3
+ "version": "3.2.0",
4
+ "next_version": "3.2.0",
5
5
  "current_major_version": "3",
6
6
  "license": "MIT",
7
7
  "description": "Contains timum public and general api endpoints",
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(
@@ -359,6 +374,8 @@ export const {
359
374
  useLazyActiveProductsQuery,
360
375
  useSpecificProductsQuery,
361
376
  useLazySpecificProductsQuery,
377
+ useGetProductBookingConfQuery,
378
+ useLazyGetProductBookingConfQuery,
362
379
  useCreateAppointmentWithConsumerMutation,
363
380
  useIdentifyCustomerQuery,
364
381
  useLazyIdentifyCustomerQuery,