@iblai/data-layer 0.3.1 → 1.1.1
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/README.md +313 -7
- package/dist/index.d.ts +22 -0
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/features/stripe/api-slice.d.ts +22 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,24 +1,330 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @iblai/data-layer
|
|
2
|
+
|
|
3
|
+
A Redux Toolkit-based data layer package for IBL AI applications, providing centralized state management and API integrations using RTK Query.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @iblai/data-layer
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
The data-layer package provides:
|
|
14
|
+
- **RTK Query API slices** for all IBL AI API endpoints
|
|
15
|
+
- **Redux store configuration** with pre-configured slices
|
|
16
|
+
- **Type-safe API hooks** for React components
|
|
17
|
+
- **Centralized state management** for auth, chat, subscriptions, and more
|
|
18
|
+
|
|
19
|
+
## Getting Started
|
|
20
|
+
|
|
21
|
+
### 1. Setup Redux Store
|
|
22
|
+
|
|
23
|
+
Wrap your application with the Redux Provider:
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { Provider } from 'react-redux';
|
|
27
|
+
import { store } from '@iblai/data-layer';
|
|
28
|
+
|
|
29
|
+
function App() {
|
|
30
|
+
return (
|
|
31
|
+
<Provider store={store}>
|
|
32
|
+
<YourApp />
|
|
33
|
+
</Provider>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2. Using API Hooks
|
|
39
|
+
|
|
40
|
+
The package provides auto-generated hooks for all API endpoints:
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { useGetUserProfileQuery, useUpdateUserProfileMutation } from '@iblai/data-layer';
|
|
44
|
+
|
|
45
|
+
function UserProfile() {
|
|
46
|
+
// Query hook - automatically fetches data
|
|
47
|
+
const { data: profile, isLoading, error } = useGetUserProfileQuery();
|
|
48
|
+
|
|
49
|
+
// Mutation hook - for updates
|
|
50
|
+
const [updateProfile, { isLoading: isUpdating }] = useUpdateUserProfileMutation();
|
|
51
|
+
|
|
52
|
+
const handleSave = async (data) => {
|
|
53
|
+
await updateProfile(data).unwrap();
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
if (isLoading) return <div>Loading...</div>;
|
|
57
|
+
if (error) return <div>Error: {error.message}</div>;
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div>
|
|
61
|
+
<h1>{profile.name}</h1>
|
|
62
|
+
{/* Your profile UI */}
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Available API Slices
|
|
69
|
+
|
|
70
|
+
### Core APIs
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
import {
|
|
74
|
+
// User & Auth
|
|
75
|
+
useGetUserProfileQuery,
|
|
76
|
+
useUpdateUserProfileMutation,
|
|
77
|
+
useLoginMutation,
|
|
78
|
+
|
|
79
|
+
// Tenants
|
|
80
|
+
useGetTenantsQuery,
|
|
81
|
+
useGetTenantQuery,
|
|
82
|
+
useCreateTenantMutation,
|
|
83
|
+
|
|
84
|
+
// Platform
|
|
85
|
+
useGetPlatformConfigQuery,
|
|
86
|
+
} from '@iblai/data-layer';
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### AI & Chat APIs
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
import {
|
|
93
|
+
// Mentors
|
|
94
|
+
useGetMentorsQuery,
|
|
95
|
+
useGetMentorQuery,
|
|
96
|
+
useCreateMentorMutation,
|
|
97
|
+
|
|
98
|
+
// Chat Sessions
|
|
99
|
+
useGetChatSessionsQuery,
|
|
100
|
+
useCreateChatSessionMutation,
|
|
101
|
+
|
|
102
|
+
// Memory
|
|
103
|
+
useGetMemoriesQuery,
|
|
104
|
+
useCreateMemoryMutation,
|
|
105
|
+
} from '@iblai/data-layer';
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Subscription APIs
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
import {
|
|
112
|
+
// Stripe Integration
|
|
113
|
+
useGetSubscriptionQuery,
|
|
114
|
+
useCreateCheckoutSessionMutation,
|
|
115
|
+
useCreateCustomerPortalSessionMutation,
|
|
116
|
+
|
|
117
|
+
// Pricing
|
|
118
|
+
useGetPricingPlansQuery,
|
|
119
|
+
} from '@iblai/data-layer';
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Features
|
|
123
|
+
|
|
124
|
+
### Automatic Caching
|
|
125
|
+
|
|
126
|
+
RTK Query automatically caches API responses and handles cache invalidation:
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
// This query result is cached
|
|
130
|
+
const { data } = useGetUserProfileQuery();
|
|
131
|
+
|
|
132
|
+
// Subsequent calls use cached data
|
|
133
|
+
const { data: sameData } = useGetUserProfileQuery(); // No network request
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Optimistic Updates
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
const [updateProfile] = useUpdateUserProfileMutation();
|
|
140
|
+
|
|
141
|
+
const handleUpdate = async (newData) => {
|
|
142
|
+
try {
|
|
143
|
+
await updateProfile({
|
|
144
|
+
id: userId,
|
|
145
|
+
...newData,
|
|
146
|
+
}).unwrap();
|
|
147
|
+
// UI updates optimistically before API response
|
|
148
|
+
} catch (error) {
|
|
149
|
+
// Error handling
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Manual Cache Invalidation
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
import { useDispatch } from 'react-redux';
|
|
158
|
+
import { apiSlice } from '@iblai/data-layer';
|
|
159
|
+
|
|
160
|
+
function RefreshButton() {
|
|
161
|
+
const dispatch = useDispatch();
|
|
162
|
+
|
|
163
|
+
const handleRefresh = () => {
|
|
164
|
+
// Invalidate specific tags
|
|
165
|
+
dispatch(apiSlice.util.invalidateTags(['User']));
|
|
166
|
+
|
|
167
|
+
// Or reset entire API state
|
|
168
|
+
dispatch(apiSlice.util.resetApiState());
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
return <button onClick={handleRefresh}>Refresh</button>;
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Polling
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
// Poll every 5 seconds
|
|
179
|
+
const { data } = useGetChatSessionsQuery(undefined, {
|
|
180
|
+
pollingInterval: 5000,
|
|
181
|
+
});
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Conditional Fetching
|
|
185
|
+
|
|
186
|
+
```tsx
|
|
187
|
+
// Only fetch when userId is available
|
|
188
|
+
const { data } = useGetUserProfileQuery(userId, {
|
|
189
|
+
skip: !userId,
|
|
190
|
+
});
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Store Structure
|
|
194
|
+
|
|
195
|
+
The store includes the following slices:
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
{
|
|
199
|
+
api: RTKQueryState, // All API data
|
|
200
|
+
auth: AuthState, // Authentication state
|
|
201
|
+
chat: ChatState, // Chat sessions and messages
|
|
202
|
+
files: FilesState, // File uploads and attachments
|
|
203
|
+
subscription: SubscriptionState, // Subscription info
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Accessing Store State
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
import { useSelector } from 'react-redux';
|
|
211
|
+
import { selectIsLoggedIn, selectCurrentUser } from '@iblai/data-layer';
|
|
212
|
+
|
|
213
|
+
function Header() {
|
|
214
|
+
const isLoggedIn = useSelector(selectIsLoggedIn);
|
|
215
|
+
const user = useSelector(selectCurrentUser);
|
|
216
|
+
|
|
217
|
+
return (
|
|
218
|
+
<header>
|
|
219
|
+
{isLoggedIn ? `Welcome ${user.name}` : 'Please log in'}
|
|
220
|
+
</header>
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## TypeScript Support
|
|
226
|
+
|
|
227
|
+
All APIs are fully typed:
|
|
228
|
+
|
|
229
|
+
```tsx
|
|
230
|
+
import type { UserProfile, Tenant, Mentor } from '@iblai/data-layer';
|
|
231
|
+
|
|
232
|
+
const { data } = useGetUserProfileQuery();
|
|
233
|
+
// data is typed as UserProfile | undefined
|
|
234
|
+
|
|
235
|
+
const { data: tenant } = useGetTenantQuery(tenantId);
|
|
236
|
+
// tenant is typed as Tenant | undefined
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Error Handling
|
|
240
|
+
|
|
241
|
+
```tsx
|
|
242
|
+
const { data, error, isError } = useGetUserProfileQuery();
|
|
243
|
+
|
|
244
|
+
if (isError) {
|
|
245
|
+
if ('status' in error) {
|
|
246
|
+
// RTK Query error
|
|
247
|
+
const errMsg = 'error' in error ? error.error : JSON.stringify(error.data);
|
|
248
|
+
return <div>Error: {errMsg}</div>;
|
|
249
|
+
} else {
|
|
250
|
+
// Serialized error
|
|
251
|
+
return <div>Error: {error.message}</div>;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## Advanced Usage
|
|
257
|
+
|
|
258
|
+
### Custom Endpoints
|
|
259
|
+
|
|
260
|
+
Extend the API slice with custom endpoints:
|
|
261
|
+
|
|
262
|
+
```tsx
|
|
263
|
+
import { apiSlice } from '@iblai/data-layer';
|
|
264
|
+
|
|
265
|
+
const extendedApi = apiSlice.injectEndpoints({
|
|
266
|
+
endpoints: (builder) => ({
|
|
267
|
+
getCustomData: builder.query({
|
|
268
|
+
query: () => '/custom-endpoint',
|
|
269
|
+
}),
|
|
270
|
+
}),
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
export const { useGetCustomDataQuery } = extendedApi;
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Prefetching
|
|
277
|
+
|
|
278
|
+
```tsx
|
|
279
|
+
import { useDispatch } from 'react-redux';
|
|
280
|
+
import { apiSlice } from '@iblai/data-layer';
|
|
281
|
+
|
|
282
|
+
function PrefetchExample() {
|
|
283
|
+
const dispatch = useDispatch();
|
|
284
|
+
|
|
285
|
+
const prefetchUserProfile = () => {
|
|
286
|
+
dispatch(
|
|
287
|
+
apiSlice.util.prefetch('getUserProfile', userId, { force: true })
|
|
288
|
+
);
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
return <button onMouseEnter={prefetchUserProfile}>Hover to prefetch</button>;
|
|
292
|
+
}
|
|
293
|
+
```
|
|
2
294
|
|
|
3
295
|
## Contributing
|
|
4
296
|
|
|
5
297
|
We welcome contributions! Please read our [contributing guidelines](CONTRIBUTING.md).
|
|
6
298
|
|
|
7
|
-
##
|
|
299
|
+
## Development
|
|
8
300
|
|
|
9
|
-
|
|
301
|
+
### Local Development Setup
|
|
10
302
|
|
|
11
|
-
|
|
303
|
+
When developing locally, use a local registry to publish packages:
|
|
12
304
|
|
|
13
305
|
```bash
|
|
14
306
|
make publish-local
|
|
15
307
|
```
|
|
16
308
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Don't forge to setup the `.npmrc` file to use the local registry.
|
|
309
|
+
Configure your `.npmrc`:
|
|
20
310
|
|
|
21
311
|
```bash
|
|
22
312
|
//localhost:4873/:_authToken=<token>
|
|
23
313
|
@iblai:registry=http://localhost:4873/
|
|
24
314
|
```
|
|
315
|
+
|
|
316
|
+
### Building
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
pnpm build
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Testing
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
pnpm test
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
## License
|
|
329
|
+
|
|
330
|
+
ISC
|
package/dist/index.d.ts
CHANGED
|
@@ -29778,6 +29778,7 @@ declare const stripeApiSlice: _reduxjs_toolkit_query.Api<_reduxjs_toolkit_query.
|
|
|
29778
29778
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>;
|
|
29779
29779
|
getStripePricingPageSession: _reduxjs_toolkit_query.QueryDefinition<{
|
|
29780
29780
|
platform_key: string;
|
|
29781
|
+
params: Record<string, any>;
|
|
29781
29782
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>;
|
|
29782
29783
|
createStripeCheckoutSession: _reduxjs_toolkit_query.MutationDefinition<StripeCheckoutSessionArgs, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", Record<string, any>, "stripeApiSlice", unknown>;
|
|
29783
29784
|
}, "stripeApiSlice", "stripe-context", typeof _reduxjs_toolkit_query.coreModuleName | typeof _reduxjs_toolkit_query_react.reactHooksModuleName>;
|
|
@@ -30108,6 +30109,7 @@ declare const useGetStripePricingPageSessionQuery: <R extends Record<string, any
|
|
|
30108
30109
|
isUninitialized: true;
|
|
30109
30110
|
}) | _reduxjs_toolkit_query.TSHelpersOverride<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30110
30111
|
platform_key: string;
|
|
30112
|
+
params: Record<string, any>;
|
|
30111
30113
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30112
30114
|
currentData?: StripeContextResponse | undefined;
|
|
30113
30115
|
isUninitialized: false;
|
|
@@ -30125,6 +30127,7 @@ declare const useGetStripePricingPageSessionQuery: <R extends Record<string, any
|
|
|
30125
30127
|
error: undefined;
|
|
30126
30128
|
} & Required<Pick<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30127
30129
|
platform_key: string;
|
|
30130
|
+
params: Record<string, any>;
|
|
30128
30131
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30129
30132
|
currentData?: StripeContextResponse | undefined;
|
|
30130
30133
|
isUninitialized: false;
|
|
@@ -30138,6 +30141,7 @@ declare const useGetStripePricingPageSessionQuery: <R extends Record<string, any
|
|
|
30138
30141
|
error: undefined;
|
|
30139
30142
|
} & Required<Pick<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30140
30143
|
platform_key: string;
|
|
30144
|
+
params: Record<string, any>;
|
|
30141
30145
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30142
30146
|
currentData?: StripeContextResponse | undefined;
|
|
30143
30147
|
isUninitialized: false;
|
|
@@ -30149,6 +30153,7 @@ declare const useGetStripePricingPageSessionQuery: <R extends Record<string, any
|
|
|
30149
30153
|
isError: true;
|
|
30150
30154
|
} & Required<Pick<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30151
30155
|
platform_key: string;
|
|
30156
|
+
params: Record<string, any>;
|
|
30152
30157
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30153
30158
|
currentData?: StripeContextResponse | undefined;
|
|
30154
30159
|
isUninitialized: false;
|
|
@@ -30160,6 +30165,7 @@ declare const useGetStripePricingPageSessionQuery: <R extends Record<string, any
|
|
|
30160
30165
|
status: _reduxjs_toolkit_query.QueryStatus;
|
|
30161
30166
|
}>(arg: typeof _reduxjs_toolkit_query.skipToken | {
|
|
30162
30167
|
platform_key: string;
|
|
30168
|
+
params: Record<string, any>;
|
|
30163
30169
|
}, options?: (_reduxjs_toolkit_query.SubscriptionOptions & {
|
|
30164
30170
|
skip?: boolean;
|
|
30165
30171
|
refetchOnMountOrArgChange?: boolean | number;
|
|
@@ -30185,6 +30191,7 @@ declare const useGetStripePricingPageSessionQuery: <R extends Record<string, any
|
|
|
30185
30191
|
isUninitialized: true;
|
|
30186
30192
|
}) | _reduxjs_toolkit_query.TSHelpersOverride<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30187
30193
|
platform_key: string;
|
|
30194
|
+
params: Record<string, any>;
|
|
30188
30195
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30189
30196
|
currentData?: StripeContextResponse | undefined;
|
|
30190
30197
|
isUninitialized: false;
|
|
@@ -30202,6 +30209,7 @@ declare const useGetStripePricingPageSessionQuery: <R extends Record<string, any
|
|
|
30202
30209
|
error: undefined;
|
|
30203
30210
|
} & Required<Pick<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30204
30211
|
platform_key: string;
|
|
30212
|
+
params: Record<string, any>;
|
|
30205
30213
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30206
30214
|
currentData?: StripeContextResponse | undefined;
|
|
30207
30215
|
isUninitialized: false;
|
|
@@ -30215,6 +30223,7 @@ declare const useGetStripePricingPageSessionQuery: <R extends Record<string, any
|
|
|
30215
30223
|
error: undefined;
|
|
30216
30224
|
} & Required<Pick<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30217
30225
|
platform_key: string;
|
|
30226
|
+
params: Record<string, any>;
|
|
30218
30227
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30219
30228
|
currentData?: StripeContextResponse | undefined;
|
|
30220
30229
|
isUninitialized: false;
|
|
@@ -30226,6 +30235,7 @@ declare const useGetStripePricingPageSessionQuery: <R extends Record<string, any
|
|
|
30226
30235
|
isError: true;
|
|
30227
30236
|
} & Required<Pick<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30228
30237
|
platform_key: string;
|
|
30238
|
+
params: Record<string, any>;
|
|
30229
30239
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30230
30240
|
currentData?: StripeContextResponse | undefined;
|
|
30231
30241
|
isUninitialized: false;
|
|
@@ -30239,6 +30249,7 @@ declare const useGetStripePricingPageSessionQuery: <R extends Record<string, any
|
|
|
30239
30249
|
}) | undefined) => [R][R extends any ? 0 : never] & {
|
|
30240
30250
|
refetch: () => _reduxjs_toolkit_query.QueryActionCreatorResult<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30241
30251
|
platform_key: string;
|
|
30252
|
+
params: Record<string, any>;
|
|
30242
30253
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>>;
|
|
30243
30254
|
};
|
|
30244
30255
|
declare const useLazyGetStripePricingPageSessionQuery: <R extends Record<string, any> = _reduxjs_toolkit_query.TSHelpersId<(Omit<{
|
|
@@ -30261,6 +30272,7 @@ declare const useLazyGetStripePricingPageSessionQuery: <R extends Record<string,
|
|
|
30261
30272
|
isUninitialized: true;
|
|
30262
30273
|
}) | _reduxjs_toolkit_query.TSHelpersOverride<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30263
30274
|
platform_key: string;
|
|
30275
|
+
params: Record<string, any>;
|
|
30264
30276
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30265
30277
|
currentData?: StripeContextResponse | undefined;
|
|
30266
30278
|
isUninitialized: false;
|
|
@@ -30278,6 +30290,7 @@ declare const useLazyGetStripePricingPageSessionQuery: <R extends Record<string,
|
|
|
30278
30290
|
error: undefined;
|
|
30279
30291
|
} & Required<Pick<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30280
30292
|
platform_key: string;
|
|
30293
|
+
params: Record<string, any>;
|
|
30281
30294
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30282
30295
|
currentData?: StripeContextResponse | undefined;
|
|
30283
30296
|
isUninitialized: false;
|
|
@@ -30291,6 +30304,7 @@ declare const useLazyGetStripePricingPageSessionQuery: <R extends Record<string,
|
|
|
30291
30304
|
error: undefined;
|
|
30292
30305
|
} & Required<Pick<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30293
30306
|
platform_key: string;
|
|
30307
|
+
params: Record<string, any>;
|
|
30294
30308
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30295
30309
|
currentData?: StripeContextResponse | undefined;
|
|
30296
30310
|
isUninitialized: false;
|
|
@@ -30302,6 +30316,7 @@ declare const useLazyGetStripePricingPageSessionQuery: <R extends Record<string,
|
|
|
30302
30316
|
isError: true;
|
|
30303
30317
|
} & Required<Pick<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30304
30318
|
platform_key: string;
|
|
30319
|
+
params: Record<string, any>;
|
|
30305
30320
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30306
30321
|
currentData?: StripeContextResponse | undefined;
|
|
30307
30322
|
isUninitialized: false;
|
|
@@ -30333,6 +30348,7 @@ declare const useLazyGetStripePricingPageSessionQuery: <R extends Record<string,
|
|
|
30333
30348
|
isUninitialized: true;
|
|
30334
30349
|
}) | _reduxjs_toolkit_query.TSHelpersOverride<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30335
30350
|
platform_key: string;
|
|
30351
|
+
params: Record<string, any>;
|
|
30336
30352
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30337
30353
|
currentData?: StripeContextResponse | undefined;
|
|
30338
30354
|
isUninitialized: false;
|
|
@@ -30350,6 +30366,7 @@ declare const useLazyGetStripePricingPageSessionQuery: <R extends Record<string,
|
|
|
30350
30366
|
error: undefined;
|
|
30351
30367
|
} & Required<Pick<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30352
30368
|
platform_key: string;
|
|
30369
|
+
params: Record<string, any>;
|
|
30353
30370
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30354
30371
|
currentData?: StripeContextResponse | undefined;
|
|
30355
30372
|
isUninitialized: false;
|
|
@@ -30363,6 +30380,7 @@ declare const useLazyGetStripePricingPageSessionQuery: <R extends Record<string,
|
|
|
30363
30380
|
error: undefined;
|
|
30364
30381
|
} & Required<Pick<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30365
30382
|
platform_key: string;
|
|
30383
|
+
params: Record<string, any>;
|
|
30366
30384
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30367
30385
|
currentData?: StripeContextResponse | undefined;
|
|
30368
30386
|
isUninitialized: false;
|
|
@@ -30374,6 +30392,7 @@ declare const useLazyGetStripePricingPageSessionQuery: <R extends Record<string,
|
|
|
30374
30392
|
isError: true;
|
|
30375
30393
|
} & Required<Pick<_reduxjs_toolkit_query.QuerySubState<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30376
30394
|
platform_key: string;
|
|
30395
|
+
params: Record<string, any>;
|
|
30377
30396
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>> & {
|
|
30378
30397
|
currentData?: StripeContextResponse | undefined;
|
|
30379
30398
|
isUninitialized: false;
|
|
@@ -30386,13 +30405,16 @@ declare const useLazyGetStripePricingPageSessionQuery: <R extends Record<string,
|
|
|
30386
30405
|
}) => R) | undefined;
|
|
30387
30406
|
}, "skip">) | undefined) => [(arg: {
|
|
30388
30407
|
platform_key: string;
|
|
30408
|
+
params: Record<string, any>;
|
|
30389
30409
|
}, preferCacheValue?: boolean) => _reduxjs_toolkit_query.QueryActionCreatorResult<_reduxjs_toolkit_query.QueryDefinition<{
|
|
30390
30410
|
platform_key: string;
|
|
30411
|
+
params: Record<string, any>;
|
|
30391
30412
|
}, _reduxjs_toolkit_query.BaseQueryFn<_data_layer_features_utils.CustomQueryArgs, unknown, _data_layer_features_utils.ExtendedFetchBaseQueryError, Record<string, unknown>, _reduxjs_toolkit_query.FetchBaseQueryMeta>, "stripe-context", StripeContextResponse, "stripeApiSlice", unknown>>, [R][R extends any ? 0 : never] & {
|
|
30392
30413
|
reset: () => void;
|
|
30393
30414
|
}, {
|
|
30394
30415
|
lastArg: {
|
|
30395
30416
|
platform_key: string;
|
|
30417
|
+
params: Record<string, any>;
|
|
30396
30418
|
};
|
|
30397
30419
|
}];
|
|
30398
30420
|
declare const useCreateStripeCheckoutSessionMutation: <R extends Record<string, any> = ({
|
package/dist/index.esm.js
CHANGED
|
@@ -37609,10 +37609,11 @@ const stripeApiSlice = createApi({
|
|
|
37609
37609
|
providesTags: ['stripe-context'],
|
|
37610
37610
|
}),
|
|
37611
37611
|
getStripePricingPageSession: builder.query({
|
|
37612
|
-
query: ({ platform_key }) => ({
|
|
37612
|
+
query: ({ platform_key, params }) => ({
|
|
37613
37613
|
url: STRIPE_ENDPOINTS.GET_STRIPE_PRICING_PAGE_SESSION.path(platform_key),
|
|
37614
37614
|
service: STRIPE_ENDPOINTS.GET_STRIPE_PRICING_PAGE_SESSION.service,
|
|
37615
37615
|
method: 'GET',
|
|
37616
|
+
params,
|
|
37616
37617
|
}),
|
|
37617
37618
|
providesTags: ['stripe-context'],
|
|
37618
37619
|
}),
|