@techstuff-dev/foundation-api-utils 1.51.0 → 1.52.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/dist/cjs/chunks/{shared-CPf85o9W.js → shared-YoGh9ksj.js} +2 -2
- package/dist/cjs/chunks/{shared-CPf85o9W.js.map → shared-YoGh9ksj.js.map} +1 -1
- package/dist/cjs/chunks/{slice-CHzSWFmR.js → slice-4qoZ1wSU.js} +84 -9
- package/dist/cjs/chunks/slice-4qoZ1wSU.js.map +1 -0
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/store/index.native.js +2 -2
- package/dist/cjs/store/index.web.js +2 -2
- package/dist/esm/chunks/{shared-9n1t2QnH.js → shared-DYJftbDt.js} +2 -2
- package/dist/esm/chunks/{shared-9n1t2QnH.js.map → shared-DYJftbDt.js.map} +1 -1
- package/dist/esm/chunks/{slice-Bersugzi.js → slice-DJ0YEPf7.js} +85 -11
- package/dist/esm/chunks/slice-DJ0YEPf7.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/store/index.native.js +2 -2
- package/dist/esm/store/index.web.js +2 -2
- package/dist/types/index.d.ts +53 -3
- package/package.json +1 -1
- package/dist/cjs/chunks/slice-CHzSWFmR.js.map +0 -1
- package/dist/esm/chunks/slice-Bersugzi.js.map +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { x as addToCart, af as applyCoupon, ag as applyTax, a as authApi, r as cartSlice, c as contentApi, A as emptyCart, $ as formatAuthSession, Z as formatChallengeDays, Y as formatChallenges, a2 as formatConfig, Q as formatFaqs, a0 as formatFedaratedSession, U as formatGuests, a8 as formatLongform, a9 as formatMediaItem, R as formatPages, T as formatPress, N as formatPromos, X as formatSchedule, a7 as formatSeasons, _ as formatSecondsToISO8601Duration, a4 as formatSectionItems, a3 as formatSectionPanels, W as formatSections, a6 as formatSeries, S as formatSettings, P as formatShortform, a1 as formatSocialAuthSession, a5 as formatTaxonomies, M as formatUserPayload, V as formatVideos, O as formatWorkout, ac as getPlatform, ab as isReactNative, aa as isWeb, ae as onlyUnique, o as ordersApi, p as paymentApi, z as removeFromCart, w as removePromoCode, t as resetTaxRate, ad as runOnPlatform, H as selectCartCount, K as selectCartItems, L as selectCartItemsIds, E as selectCartNetTotal, I as selectCartStatus, G as selectCartTaxAmount, F as selectCartTaxRate, D as selectCartTotal, C as selectMediaInCart, J as selectPromoCode, v as setPromoCode, s as setTaxRate, ah as toCamelCaseObject, B as toggleCart, y as updateCart, j as useForgottenPasswordMutation, g as useGetUserInfoQuery, h as useLazyGetUserInfoQuery, l as useLazyVerifyUserAttributesQuery, f as useLazyVerifyUserQuery, n as useLazyVerifyUserResendQuery, d as useRegisterMutation, b as useResetPasswordAuthMutation, u as useResetPasswordMutation, i as useUpdateUserInfoMutation, q as useUpdateUserMutation, k as useVerifyUserAttributesQuery, e as useVerifyUserQuery, m as useVerifyUserResendQuery } from './chunks/slice-
|
|
1
|
+
export { x as addToCart, af as applyCoupon, ag as applyTax, a as authApi, r as cartSlice, c as contentApi, ai as createUnwrappingBaseQuery, A as emptyCart, $ as formatAuthSession, Z as formatChallengeDays, Y as formatChallenges, a2 as formatConfig, Q as formatFaqs, a0 as formatFedaratedSession, U as formatGuests, a8 as formatLongform, a9 as formatMediaItem, R as formatPages, T as formatPress, N as formatPromos, X as formatSchedule, a7 as formatSeasons, _ as formatSecondsToISO8601Duration, a4 as formatSectionItems, a3 as formatSectionPanels, W as formatSections, a6 as formatSeries, S as formatSettings, P as formatShortform, a1 as formatSocialAuthSession, a5 as formatTaxonomies, M as formatUserPayload, V as formatVideos, O as formatWorkout, ac as getPlatform, ab as isReactNative, aa as isWeb, ae as onlyUnique, o as ordersApi, p as paymentApi, z as removeFromCart, w as removePromoCode, t as resetTaxRate, ad as runOnPlatform, H as selectCartCount, K as selectCartItems, L as selectCartItemsIds, E as selectCartNetTotal, I as selectCartStatus, G as selectCartTaxAmount, F as selectCartTaxRate, D as selectCartTotal, C as selectMediaInCart, J as selectPromoCode, v as setPromoCode, s as setTaxRate, ah as toCamelCaseObject, B as toggleCart, y as updateCart, j as useForgottenPasswordMutation, g as useGetUserInfoQuery, h as useLazyGetUserInfoQuery, l as useLazyVerifyUserAttributesQuery, f as useLazyVerifyUserQuery, n as useLazyVerifyUserResendQuery, d as useRegisterMutation, b as useResetPasswordAuthMutation, u as useResetPasswordMutation, i as useUpdateUserInfoMutation, q as useUpdateUserMutation, k as useVerifyUserAttributesQuery, e as useVerifyUserQuery, m as useVerifyUserResendQuery } from './chunks/slice-DJ0YEPf7.js';
|
|
2
2
|
export { a as authSlice, g as getUserSession, i as isAuthenticated, e as isVerifying, l as logout, r as resetCreating, b as selectAccessToken, d as selectCurrentUser, h as selectCurrentUserRefreshToken, f as selectCurrentUserSub, c as selectRefreshToken, m as selectSubscription, n as selectSubscriptionPrice, k as selectUserSubscriptionStatus, j as selectUserTokens, s as setCredentials, u as updateSubscription } from './chunks/slice-ChJ8ZvmP.js';
|
|
3
3
|
export { u as useLoggedIn } from './chunks/useAuth-8d6DlERn.js';
|
|
4
4
|
import 'aws-amplify';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { configureStore } from '@reduxjs/toolkit';
|
|
2
2
|
import storage from '@react-native-async-storage/async-storage';
|
|
3
|
-
import { p as paymentApi, a as authApi, c as contentApi, o as ordersApi } from '../chunks/slice-
|
|
4
|
-
import { r as rootReducer } from '../chunks/shared-
|
|
3
|
+
import { p as paymentApi, a as authApi, c as contentApi, o as ordersApi } from '../chunks/slice-DJ0YEPf7.js';
|
|
4
|
+
import { r as rootReducer } from '../chunks/shared-DYJftbDt.js';
|
|
5
5
|
import 'aws-amplify';
|
|
6
6
|
import '../chunks/slice-ChJ8ZvmP.js';
|
|
7
7
|
import 'react-redux';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { configureStore } from '@reduxjs/toolkit';
|
|
2
|
-
import { p as paymentApi, a as authApi, c as contentApi, o as ordersApi } from '../chunks/slice-
|
|
3
|
-
import { r as rootReducer } from '../chunks/shared-
|
|
2
|
+
import { p as paymentApi, a as authApi, c as contentApi, o as ordersApi } from '../chunks/slice-DJ0YEPf7.js';
|
|
3
|
+
import { r as rootReducer } from '../chunks/shared-DYJftbDt.js';
|
|
4
4
|
import 'aws-amplify';
|
|
5
5
|
import '../chunks/slice-ChJ8ZvmP.js';
|
|
6
6
|
import 'react-redux';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
2
2
|
import { Slice, PayloadAction } from '@reduxjs/toolkit';
|
|
3
3
|
import * as _reduxjs_toolkit_query_react from '@reduxjs/toolkit/query/react';
|
|
4
|
-
import { BaseQueryFn as BaseQueryFn$1, FetchArgs as FetchArgs$1, FetchBaseQueryError as FetchBaseQueryError$1 } from '@reduxjs/toolkit/query/react';
|
|
4
|
+
import { BaseQueryFn as BaseQueryFn$1, FetchArgs as FetchArgs$1, FetchBaseQueryError as FetchBaseQueryError$1, fetchBaseQuery } from '@reduxjs/toolkit/query/react';
|
|
5
5
|
import * as _reduxjs_toolkit_query from '@reduxjs/toolkit/query';
|
|
6
6
|
import { BaseQueryFn, FetchArgs, FetchBaseQueryError } from '@reduxjs/toolkit/query';
|
|
7
7
|
import { R as ResetPasswordRequest, a as ResetPasswordResponse, b as ResetPasswordAuthRequest, c as ResetPasswordAuthResponse, F as ForgottenPasswordRequest, d as ForgottenPasswordResponse, e as RegisterRequest, f as RegisterResponse, V as VerifyUserRequest, g as VerifyUserAttributesRequest, h as VerifyUserAttributesResponse, i as VerifyUserResendRequest, U as UpdateUserInfoRequest, j as UpdateUserRequest, A as AuthState, k as UserDetails, D as DataArgs, E as ESDataTypes, I as IdArg, l as UserSubRequest, m as UserSubResponse, P as PaymentPlansResponse, n as UserPayload, o as ESPromo, p as Promo, q as ESWorkout, W as Workout, r as ESShortform, s as ESFaq, t as ESPage, u as Page, v as ESSetting, w as ESPress, x as ESGuest, y as ESVideo, z as Video, B as ESSection, S as Section, C as ESSchedule, G as Schedule, H as ESChallenge, J as Challenge, K as ESChallengeDay, L as ChallengeDay, M as User, N as FederatedSession, O as SocialTokens, Q as ESConfig, T as Config, X as ESSectionPanel, Y as SectionPanel, Z as ESSectionItem, _ as SectionItem, $ as ESTaxonomy, a0 as Taxonomy, a1 as ESSeries, a2 as Series, a3 as ESSeason, a4 as Season, a5 as ESLongform, a6 as LongForm, a7 as ESMediaItem, a8 as MediaItem } from './index-B9lcBPLO.js';
|
|
@@ -2467,5 +2467,55 @@ declare function applyTax(taxRate: {
|
|
|
2467
2467
|
}, netTotal: number): number;
|
|
2468
2468
|
declare function toCamelCaseObject(obj: any): any;
|
|
2469
2469
|
|
|
2470
|
-
|
|
2471
|
-
|
|
2470
|
+
/**
|
|
2471
|
+
* Standard API response format with success wrapper
|
|
2472
|
+
*/
|
|
2473
|
+
interface ApiResponse<T = any> {
|
|
2474
|
+
success: boolean;
|
|
2475
|
+
data?: T;
|
|
2476
|
+
error?: {
|
|
2477
|
+
code: string;
|
|
2478
|
+
message: string;
|
|
2479
|
+
details?: Record<string, any>;
|
|
2480
|
+
};
|
|
2481
|
+
meta?: {
|
|
2482
|
+
requestId?: string;
|
|
2483
|
+
timestamp?: string;
|
|
2484
|
+
[key: string]: any;
|
|
2485
|
+
};
|
|
2486
|
+
}
|
|
2487
|
+
/**
|
|
2488
|
+
* Creates a base query that automatically unwraps standardized API responses.
|
|
2489
|
+
*
|
|
2490
|
+
* If the API returns `{ success: true, data: T }`, this will return just `T`.
|
|
2491
|
+
* If the API returns `{ success: false, error: {...} }`, this will pass through the error correctly.
|
|
2492
|
+
*
|
|
2493
|
+
* This eliminates the need for `transformResponse` on every endpoint when using
|
|
2494
|
+
* a standardized response format across your API routes.
|
|
2495
|
+
*
|
|
2496
|
+
* @param baseQueryOptions - The same options you would pass to fetchBaseQuery
|
|
2497
|
+
* @returns A BaseQueryFn that unwraps standardized responses
|
|
2498
|
+
*
|
|
2499
|
+
* @example
|
|
2500
|
+
* ```typescript
|
|
2501
|
+
* const api = createApi({
|
|
2502
|
+
* baseQuery: createUnwrappingBaseQuery({
|
|
2503
|
+
* baseUrl: '/api',
|
|
2504
|
+
* prepareHeaders: (headers) => {
|
|
2505
|
+
* // Add auth headers
|
|
2506
|
+
* return headers;
|
|
2507
|
+
* },
|
|
2508
|
+
* }),
|
|
2509
|
+
* endpoints: (builder) => ({
|
|
2510
|
+
* getPlans: builder.query<{ plans: Plan[] }, void>({
|
|
2511
|
+
* query: () => '/payment/plans',
|
|
2512
|
+
* // No need for transformResponse!
|
|
2513
|
+
* }),
|
|
2514
|
+
* }),
|
|
2515
|
+
* });
|
|
2516
|
+
* ```
|
|
2517
|
+
*/
|
|
2518
|
+
declare function createUnwrappingBaseQuery(baseQueryOptions: Parameters<typeof fetchBaseQuery>[0]): BaseQueryFn<string | FetchArgs, unknown, FetchBaseQueryError>;
|
|
2519
|
+
|
|
2520
|
+
export { AuthState, Challenge, ChallengeDay, Config, DataArgs, ESChallenge, ESChallengeDay, ESConfig, ESDataTypes, ESFaq, ESGuest, ESLongform, ESMediaItem, ESPage, ESPress, ESPromo, ESSchedule, ESSeason, ESSection, ESSectionItem, ESSectionPanel, ESSeries, ESSetting, ESShortform, ESTaxonomy, ESVideo, ESWorkout, FederatedSession, ForgottenPasswordRequest, ForgottenPasswordResponse, IdArg, LongForm, MediaItem, Page, PaymentPlansResponse, Promo, RegisterRequest, RegisterResponse, ResetPasswordAuthRequest, ResetPasswordAuthResponse, ResetPasswordRequest, ResetPasswordResponse, Schedule, Season, Section, SectionItem, SectionPanel, Series, SocialTokens, Taxonomy, UpdateUserInfoRequest, UpdateUserRequest, User, UserDetails, UserPayload, UserSubRequest, UserSubResponse, VerifyUserAttributesRequest, VerifyUserAttributesResponse, VerifyUserRequest, VerifyUserResendRequest, Video, Workout, addToCart, applyCoupon, applyTax, authApi, authSlice, cartSlice, contentApi, createUnwrappingBaseQuery, emptyCart, formatAuthSession, formatChallengeDays, formatChallenges, formatConfig, formatFaqs, formatFedaratedSession, formatGuests, formatLongform, formatMediaItem, formatPages, formatPress, formatPromos, formatSchedule, formatSeasons, formatSecondsToISO8601Duration, formatSectionItems, formatSectionPanels, formatSections, formatSeries, formatSettings, formatShortform, formatSocialAuthSession, formatTaxonomies, formatUserPayload, formatVideos, formatWorkout, getPlatform, getUserSession, isAuthenticated, isReactNative, isVerifying, isWeb, logout, onlyUnique, ordersApi, paymentApi, removeFromCart, removePromoCode, resetCreating, resetTaxRate, runOnPlatform, selectAccessToken, selectCartCount, selectCartItems, selectCartItemsIds, selectCartNetTotal, selectCartStatus, selectCartTaxAmount, selectCartTaxRate, selectCartTotal, selectCurrentUser, selectCurrentUserRefreshToken, selectCurrentUserSub, selectMediaInCart, selectPromoCode, selectRefreshToken, selectSubscription, selectSubscriptionPrice, selectUserSubscriptionStatus, selectUserTokens, setCredentials, setPromoCode, setTaxRate, toCamelCaseObject, toggleCart, updateCart, updateSubscription, useForgottenPasswordMutation, useGetUserInfoQuery, useLazyGetUserInfoQuery, useLazyVerifyUserAttributesQuery, useLazyVerifyUserQuery, useLazyVerifyUserResendQuery, useRegisterMutation, useResetPasswordAuthMutation, useResetPasswordMutation, useUpdateUserInfoMutation, useUpdateUserMutation, useVerifyUserAttributesQuery, useVerifyUserQuery, useVerifyUserResendQuery };
|
|
2521
|
+
export type { ApiResponse, Platform };
|