@kasuvia/sdk 0.0.5 → 0.0.6
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/hooks/index.d.mts +45 -4
- package/dist/hooks/index.d.ts +45 -4
- package/dist/index-C1chUA3P.d.mts +30 -0
- package/dist/index-C1chUA3P.d.ts +30 -0
- package/dist/{index-Dowl5224.d.mts → index-D9ojrziq.d.mts} +1 -1
- package/dist/{index-CzVMyUs4.d.mts → index-ac_Jx9NI.d.mts} +1 -1
- package/dist/{index-CzVMyUs4.d.ts → index-ac_Jx9NI.d.ts} +1 -1
- package/dist/{index-CxNLI4nw.d.ts → index-hgK4j47a.d.ts} +1 -1
- package/dist/index.d.mts +5 -6
- package/dist/index.d.ts +5 -6
- package/dist/index.js +0 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -13
- package/dist/index.mjs.map +1 -1
- package/dist/services/index.d.mts +2 -2
- package/dist/services/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/index.ts +3 -5
- package/dist/sdk-context-BuarJbeb.d.ts +0 -75
- package/dist/sdk-context-Db8kf1Tv.d.mts +0 -75
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { C as Country,
|
|
4
|
-
export { S as SdkContextValue, b as SdkProvider, c as SdkProviderProps, r as resolveHookArgs, u as useSdkContext } from '../sdk-context-Db8kf1Tv.mjs';
|
|
2
|
+
import { c as CartResponse, b as CartItem, y as Product, G as SdkConfig, F as FindOrderParams, V as SupportedLang, p as Currency, t as ListParams, d as CmsEntry, n as CreateCmsEntryParams, Y as UpdateCmsEntryParams, L as ListCmsEntriesParams } from '../index-ac_Jx9NI.mjs';
|
|
3
|
+
import { C as Country, S as State } from '../index-C1chUA3P.mjs';
|
|
5
4
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -427,4 +426,46 @@ interface UseDeleteCmsEntryReturn {
|
|
|
427
426
|
}
|
|
428
427
|
declare function useDeleteCmsEntry(config?: SdkConfig, accessToken?: string | null, modelSlug?: string): UseDeleteCmsEntryReturn;
|
|
429
428
|
|
|
430
|
-
|
|
429
|
+
/**
|
|
430
|
+
* SdkContext
|
|
431
|
+
*
|
|
432
|
+
* Provides SdkConfig and the current access token to all SDK hooks
|
|
433
|
+
* in the component tree, so individual hooks do not require explicit
|
|
434
|
+
* config/accessToken parameters when called from client components.
|
|
435
|
+
*
|
|
436
|
+
* Usage in storefront:
|
|
437
|
+
* // In your AuthProvider or root layout:
|
|
438
|
+
* <SdkProvider config={sdkConfig} accessToken={accessToken}>
|
|
439
|
+
* {children}
|
|
440
|
+
* </SdkProvider>
|
|
441
|
+
*
|
|
442
|
+
* // In any client component:
|
|
443
|
+
* const { items, addItem } = useCart() // no args needed
|
|
444
|
+
*/
|
|
445
|
+
|
|
446
|
+
interface SdkContextValue {
|
|
447
|
+
config: SdkConfig;
|
|
448
|
+
accessToken: string | null;
|
|
449
|
+
}
|
|
450
|
+
interface SdkProviderProps {
|
|
451
|
+
config: SdkConfig;
|
|
452
|
+
accessToken: string | null;
|
|
453
|
+
children: ReactNode;
|
|
454
|
+
}
|
|
455
|
+
declare function SdkProvider({ config, accessToken, children }: SdkProviderProps): React.JSX.Element;
|
|
456
|
+
/**
|
|
457
|
+
* Returns the SdkContext value, or null if no SdkProvider is present.
|
|
458
|
+
* SDK hooks use this internally to fall back to context when explicit
|
|
459
|
+
* parameters are not provided.
|
|
460
|
+
*/
|
|
461
|
+
declare function useSdkContext(): SdkContextValue | null;
|
|
462
|
+
/**
|
|
463
|
+
* Resolves config and accessToken from explicit arguments or SdkContext.
|
|
464
|
+
* Throws if neither source is available.
|
|
465
|
+
*/
|
|
466
|
+
declare function resolveHookArgs(explicitConfig: SdkConfig | undefined, explicitToken: string | null | undefined, ctx: SdkContextValue | null): {
|
|
467
|
+
config: SdkConfig;
|
|
468
|
+
accessToken: string | null;
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
export { type CartContextValue, CartCtx, CartProvider, type SdkContextValue, SdkProvider, type SdkProviderProps, type UseCartReturn, type UseCmsEntriesReturn, type UseCmsEntryReturn, type UseCreateCmsEntryReturn, type UseDeleteCmsEntryReturn, type UseOrderStreamOptions, type UseUpdateCmsEntryReturn, collectionKeys, getCountries, getStates, getSupportedCurrenciesList, getSupportedLanguagesList, productKeys, resolveHookArgs, useAcceptQuote, useAddToWishlist, useAppointment, useAppointments, useApproveDeliverable, useAuthUser, useAvailableSlots, useBespokeAvailability, useBookAppointment, useCancelAppointment, useCancelOrder, useCart, useCheckInWishlist, useCmsEntries, useCmsEntry, useConsultation, useConsultationStream, useConsultations, useCountries, useCreateCmsEntry, useCreateConsultation, useCreateDVA, useCreateOrder, useCurrencies, useDeleteCmsEntry, useDeliverables, useFeaturedProducts, useFindOrder, useGoogleTranslate, useInitiatePayment, useIsMobile, useIsMounted, useLatestProducts, useLogin, useLogout, useLowStockProducts, useNewProducts, useOnSaleProducts, useOrder, useOrderStream, useOrderTracking, useOrders, useOrdersList, usePollTransactionStatus, usePopularProducts, useProduct, useRecommendedProducts, useRegister, useRejectQuote, useRemoveFromWishlist, useRemoveProductFromWishlist, useRequestRevision, useSdkContext, useSendMessage, useStates, useStorefrontCollection, useStorefrontCollections, useStorefrontProducts, useSupportedLanguages, useTransactionStatus, useUpdateCmsEntry, useUpdateProfile, useVerifyTransaction, useWishlist, wishlistKeys };
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { C as Country,
|
|
4
|
-
export { S as SdkContextValue, b as SdkProvider, c as SdkProviderProps, r as resolveHookArgs, u as useSdkContext } from '../sdk-context-BuarJbeb.js';
|
|
2
|
+
import { c as CartResponse, b as CartItem, y as Product, G as SdkConfig, F as FindOrderParams, V as SupportedLang, p as Currency, t as ListParams, d as CmsEntry, n as CreateCmsEntryParams, Y as UpdateCmsEntryParams, L as ListCmsEntriesParams } from '../index-ac_Jx9NI.js';
|
|
3
|
+
import { C as Country, S as State } from '../index-C1chUA3P.js';
|
|
5
4
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -427,4 +426,46 @@ interface UseDeleteCmsEntryReturn {
|
|
|
427
426
|
}
|
|
428
427
|
declare function useDeleteCmsEntry(config?: SdkConfig, accessToken?: string | null, modelSlug?: string): UseDeleteCmsEntryReturn;
|
|
429
428
|
|
|
430
|
-
|
|
429
|
+
/**
|
|
430
|
+
* SdkContext
|
|
431
|
+
*
|
|
432
|
+
* Provides SdkConfig and the current access token to all SDK hooks
|
|
433
|
+
* in the component tree, so individual hooks do not require explicit
|
|
434
|
+
* config/accessToken parameters when called from client components.
|
|
435
|
+
*
|
|
436
|
+
* Usage in storefront:
|
|
437
|
+
* // In your AuthProvider or root layout:
|
|
438
|
+
* <SdkProvider config={sdkConfig} accessToken={accessToken}>
|
|
439
|
+
* {children}
|
|
440
|
+
* </SdkProvider>
|
|
441
|
+
*
|
|
442
|
+
* // In any client component:
|
|
443
|
+
* const { items, addItem } = useCart() // no args needed
|
|
444
|
+
*/
|
|
445
|
+
|
|
446
|
+
interface SdkContextValue {
|
|
447
|
+
config: SdkConfig;
|
|
448
|
+
accessToken: string | null;
|
|
449
|
+
}
|
|
450
|
+
interface SdkProviderProps {
|
|
451
|
+
config: SdkConfig;
|
|
452
|
+
accessToken: string | null;
|
|
453
|
+
children: ReactNode;
|
|
454
|
+
}
|
|
455
|
+
declare function SdkProvider({ config, accessToken, children }: SdkProviderProps): React.JSX.Element;
|
|
456
|
+
/**
|
|
457
|
+
* Returns the SdkContext value, or null if no SdkProvider is present.
|
|
458
|
+
* SDK hooks use this internally to fall back to context when explicit
|
|
459
|
+
* parameters are not provided.
|
|
460
|
+
*/
|
|
461
|
+
declare function useSdkContext(): SdkContextValue | null;
|
|
462
|
+
/**
|
|
463
|
+
* Resolves config and accessToken from explicit arguments or SdkContext.
|
|
464
|
+
* Throws if neither source is available.
|
|
465
|
+
*/
|
|
466
|
+
declare function resolveHookArgs(explicitConfig: SdkConfig | undefined, explicitToken: string | null | undefined, ctx: SdkContextValue | null): {
|
|
467
|
+
config: SdkConfig;
|
|
468
|
+
accessToken: string | null;
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
export { type CartContextValue, CartCtx, CartProvider, type SdkContextValue, SdkProvider, type SdkProviderProps, type UseCartReturn, type UseCmsEntriesReturn, type UseCmsEntryReturn, type UseCreateCmsEntryReturn, type UseDeleteCmsEntryReturn, type UseOrderStreamOptions, type UseUpdateCmsEntryReturn, collectionKeys, getCountries, getStates, getSupportedCurrenciesList, getSupportedLanguagesList, productKeys, resolveHookArgs, useAcceptQuote, useAddToWishlist, useAppointment, useAppointments, useApproveDeliverable, useAuthUser, useAvailableSlots, useBespokeAvailability, useBookAppointment, useCancelAppointment, useCancelOrder, useCart, useCheckInWishlist, useCmsEntries, useCmsEntry, useConsultation, useConsultationStream, useConsultations, useCountries, useCreateCmsEntry, useCreateConsultation, useCreateDVA, useCreateOrder, useCurrencies, useDeleteCmsEntry, useDeliverables, useFeaturedProducts, useFindOrder, useGoogleTranslate, useInitiatePayment, useIsMobile, useIsMounted, useLatestProducts, useLogin, useLogout, useLowStockProducts, useNewProducts, useOnSaleProducts, useOrder, useOrderStream, useOrderTracking, useOrders, useOrdersList, usePollTransactionStatus, usePopularProducts, useProduct, useRecommendedProducts, useRegister, useRejectQuote, useRemoveFromWishlist, useRemoveProductFromWishlist, useRequestRevision, useSdkContext, useSendMessage, useStates, useStorefrontCollection, useStorefrontCollections, useStorefrontProducts, useSupportedLanguages, useTransactionStatus, useUpdateCmsEntry, useUpdateProfile, useVerifyTransaction, useWishlist, wishlistKeys };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type Theme = "light" | "dark";
|
|
2
|
+
type LangCode = "en" | "ha" | "yo" | "ig" | "fr";
|
|
3
|
+
interface AppState {
|
|
4
|
+
theme: Theme;
|
|
5
|
+
lang: LangCode;
|
|
6
|
+
currency: string;
|
|
7
|
+
}
|
|
8
|
+
interface AppContextValue extends AppState {
|
|
9
|
+
setTheme: (t: Theme) => void;
|
|
10
|
+
setLang: (l: LangCode) => void;
|
|
11
|
+
setCurrency: (c: string) => void;
|
|
12
|
+
formatPrice: (amount: number, fromCurrency?: string) => string;
|
|
13
|
+
resetAppState: () => void;
|
|
14
|
+
t: (text: string) => string;
|
|
15
|
+
translate: (text: string) => Promise<string>;
|
|
16
|
+
}
|
|
17
|
+
interface Country {
|
|
18
|
+
name: string;
|
|
19
|
+
code: string;
|
|
20
|
+
dial_code: string;
|
|
21
|
+
min_age: number;
|
|
22
|
+
}
|
|
23
|
+
interface State {
|
|
24
|
+
name: string;
|
|
25
|
+
code: string;
|
|
26
|
+
full_iso_code: string;
|
|
27
|
+
type: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type { AppContextValue as A, Country as C, LangCode as L, State as S, Theme as T, AppState as a };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type Theme = "light" | "dark";
|
|
2
|
+
type LangCode = "en" | "ha" | "yo" | "ig" | "fr";
|
|
3
|
+
interface AppState {
|
|
4
|
+
theme: Theme;
|
|
5
|
+
lang: LangCode;
|
|
6
|
+
currency: string;
|
|
7
|
+
}
|
|
8
|
+
interface AppContextValue extends AppState {
|
|
9
|
+
setTheme: (t: Theme) => void;
|
|
10
|
+
setLang: (l: LangCode) => void;
|
|
11
|
+
setCurrency: (c: string) => void;
|
|
12
|
+
formatPrice: (amount: number, fromCurrency?: string) => string;
|
|
13
|
+
resetAppState: () => void;
|
|
14
|
+
t: (text: string) => string;
|
|
15
|
+
translate: (text: string) => Promise<string>;
|
|
16
|
+
}
|
|
17
|
+
interface Country {
|
|
18
|
+
name: string;
|
|
19
|
+
code: string;
|
|
20
|
+
dial_code: string;
|
|
21
|
+
min_age: number;
|
|
22
|
+
}
|
|
23
|
+
interface State {
|
|
24
|
+
name: string;
|
|
25
|
+
code: string;
|
|
26
|
+
full_iso_code: string;
|
|
27
|
+
type: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type { AppContextValue as A, Country as C, LangCode as L, State as S, Theme as T, AppState as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as ServiceLocationType,
|
|
1
|
+
import { H as ServiceLocationType, G as SdkConfig, c as CartResponse, b as CartItem, O as Order, o as CreateOrderParams, F as FindOrderParams, t as ListParams, P as PaginatedResponse, y as Product, l as Collection, _ as WishlistItem, Z as WishlistCheckResponse, $ as WishlistListResponse, r as DVACreateRequest, s as DVADetails, X as TransactionVerifyResponse, w as PaymentInitiateRequest, x as PaymentInitiateResponse, m as ConversionQuote, E as ProductVariant, T as ShippingRatesResponse, W as SupportedLanguagesResponse, U as SupportedCurrenciesResponse, n as CreateCmsEntryParams, d as CmsEntry, L as ListCmsEntriesParams, e as CmsEntryListResponse, Y as UpdateCmsEntryParams } from './index-ac_Jx9NI.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Simplified customer auth types for kasuvia-storefront.
|
|
@@ -489,4 +489,4 @@ interface UpdateCmsEntryParams {
|
|
|
489
489
|
data: Record<string, any>;
|
|
490
490
|
}
|
|
491
491
|
|
|
492
|
-
export { type WishlistListResponse as $, type Address as A, type BackendLanguage as B, type CheckoutCustomer as C, type DeliveryAddress as D, type
|
|
492
|
+
export { type WishlistListResponse as $, type Address as A, type BackendLanguage as B, type CheckoutCustomer as C, type DeliveryAddress as D, type ProductVariant as E, type FindOrderParams as F, type SdkConfig as G, type ServiceLocationType as H, type Inventory as I, ServiceLocationTypeEnum as J, type ServiceRecurringInterval as K, type ListCmsEntriesParams as L, ServiceRecurringIntervalEnum as M, type ServiceType as N, type Order as O, type PaginatedResponse as P, ServiceTypeEnum as Q, type ShippingRate as R, type ShippingLocation as S, type ShippingRatesResponse as T, type SupportedCurrenciesResponse as U, type SupportedLang as V, type SupportedLanguagesResponse as W, type TransactionVerifyResponse as X, type UpdateCmsEntryParams as Y, type WishlistCheckResponse as Z, type WishlistItem as _, type BespokeStageKey as a, type CartItem as b, type CartResponse as c, type CmsEntry as d, type CmsEntryListResponse as e, type CmsField as f, type CmsIcon as g, type CmsIconListResponse as h, type CmsModel as i, type CmsModelPermissions as j, type CmsModelPublicApiPermissions as k, type Collection as l, type ConversionQuote as m, type CreateCmsEntryParams as n, type CreateOrderParams as o, type Currency as p, type CustomField as q, type DVACreateRequest as r, type DVADetails as s, type ListParams as t, type OrderItem as u, type OrderStatus as v, type PaymentInitiateRequest as w, type PaymentInitiateResponse as x, type Product as y, type ProductType as z };
|
|
@@ -489,4 +489,4 @@ interface UpdateCmsEntryParams {
|
|
|
489
489
|
data: Record<string, any>;
|
|
490
490
|
}
|
|
491
491
|
|
|
492
|
-
export { type WishlistListResponse as $, type Address as A, type BackendLanguage as B, type CheckoutCustomer as C, type DeliveryAddress as D, type
|
|
492
|
+
export { type WishlistListResponse as $, type Address as A, type BackendLanguage as B, type CheckoutCustomer as C, type DeliveryAddress as D, type ProductVariant as E, type FindOrderParams as F, type SdkConfig as G, type ServiceLocationType as H, type Inventory as I, ServiceLocationTypeEnum as J, type ServiceRecurringInterval as K, type ListCmsEntriesParams as L, ServiceRecurringIntervalEnum as M, type ServiceType as N, type Order as O, type PaginatedResponse as P, ServiceTypeEnum as Q, type ShippingRate as R, type ShippingLocation as S, type ShippingRatesResponse as T, type SupportedCurrenciesResponse as U, type SupportedLang as V, type SupportedLanguagesResponse as W, type TransactionVerifyResponse as X, type UpdateCmsEntryParams as Y, type WishlistCheckResponse as Z, type WishlistItem as _, type BespokeStageKey as a, type CartItem as b, type CartResponse as c, type CmsEntry as d, type CmsEntryListResponse as e, type CmsField as f, type CmsIcon as g, type CmsIconListResponse as h, type CmsModel as i, type CmsModelPermissions as j, type CmsModelPublicApiPermissions as k, type Collection as l, type ConversionQuote as m, type CreateCmsEntryParams as n, type CreateOrderParams as o, type Currency as p, type CustomField as q, type DVACreateRequest as r, type DVADetails as s, type ListParams as t, type OrderItem as u, type OrderStatus as v, type PaymentInitiateRequest as w, type PaymentInitiateResponse as x, type Product as y, type ProductType as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as ServiceLocationType,
|
|
1
|
+
import { H as ServiceLocationType, G as SdkConfig, c as CartResponse, b as CartItem, O as Order, o as CreateOrderParams, F as FindOrderParams, t as ListParams, P as PaginatedResponse, y as Product, l as Collection, _ as WishlistItem, Z as WishlistCheckResponse, $ as WishlistListResponse, r as DVACreateRequest, s as DVADetails, X as TransactionVerifyResponse, w as PaymentInitiateRequest, x as PaymentInitiateResponse, m as ConversionQuote, E as ProductVariant, T as ShippingRatesResponse, W as SupportedLanguagesResponse, U as SupportedCurrenciesResponse, n as CreateCmsEntryParams, d as CmsEntry, L as ListCmsEntriesParams, e as CmsEntryListResponse, Y as UpdateCmsEntryParams } from './index-ac_Jx9NI.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Simplified customer auth types for kasuvia-storefront.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { C as CheckoutCustomer,
|
|
2
|
-
export { A as Address, B as BackendLanguage,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { A as
|
|
6
|
-
import 'react';
|
|
1
|
+
import { C as CheckoutCustomer, S as ShippingLocation, D as DeliveryAddress, O as Order } from './index-ac_Jx9NI.mjs';
|
|
2
|
+
export { A as Address, B as BackendLanguage, a as BespokeStageKey, b as CartItem, c as CartResponse, d as CmsEntry, e as CmsEntryListResponse, f as CmsField, g as CmsIcon, h as CmsIconListResponse, i as CmsModel, j as CmsModelPermissions, k as CmsModelPublicApiPermissions, l as Collection, m as ConversionQuote, n as CreateCmsEntryParams, o as CreateOrderParams, p as Currency, q as CustomField, r as DVACreateRequest, s as DVADetails, F as FindOrderParams, I as Inventory, L as ListCmsEntriesParams, t as ListParams, u as OrderItem, v as OrderStatus, P as PaginatedResponse, w as PaymentInitiateRequest, x as PaymentInitiateResponse, y as Product, z as ProductType, E as ProductVariant, G as SdkConfig, H as ServiceLocationType, J as ServiceLocationTypeEnum, K as ServiceRecurringInterval, M as ServiceRecurringIntervalEnum, N as ServiceType, Q as ServiceTypeEnum, R as ShippingRate, T as ShippingRatesResponse, U as SupportedCurrenciesResponse, V as SupportedLang, W as SupportedLanguagesResponse, X as TransactionVerifyResponse, Y as UpdateCmsEntryParams, Z as WishlistCheckResponse, _ as WishlistItem, $ as WishlistListResponse } from './index-ac_Jx9NI.mjs';
|
|
3
|
+
import { C as CustomerUser } from './index-D9ojrziq.mjs';
|
|
4
|
+
export { A as AppointmentStatus, a as AuthContextValue, b as AuthUserResponse, c as AvailableSlot, d as AvatarObject, B as BespokeAvailability, e as BusinessConfig, f as BusinessContext, g as CartItemPayload, h as Consultation, i as ConsultationCreatePayload, j as ConsultationMessage, k as ConsultationMessagePayload, l as ConsultationProductType, m as ConsultationQuoteAcceptPayload, n as ConsultationStatus, o as ContactFormData, p as CustomerAuthResponse, q as CustomerLoginPayload, r as CustomerProfileFields, s as CustomerRegisterPayload, D as DeliverableApprovalPayload, t as DeliverableStatus, u as DeliverableStatusType, L as LogoutPayload, N as NotificationPreferences, O as OTPVerifyPayload, R as RateAddress, v as RefreshTokenResponse, w as ResendOTPPayload, S as ServiceAppointment, x as ServiceAppointmentCreatePayload, y as ServiceDeliverable, z as ShippingRatesRequest, U as UpdateProfilePayload, E as acceptQuote, F as addToCart, G as addToGuestCart, H as addToWishlist, I as approveDeliverable, J as bespokeService, K as bookAppointment, M as cancelAppointment, P as cancelOrder, Q as checkAvailability, T as checkInWishlist, V as clearCart, W as clearGuestCart, X as clearTokens, Y as configService, Z as consultationService, _ as createCmsEntry, $ as createConsultation, a0 as createDedicatedAccount, a1 as createOrder, a2 as deleteCmsEntry, a3 as findOrder, a4 as findOrderByToken, a5 as getAppointment, a6 as getAppointments, a7 as getAuthUser, a8 as getAvailableSlots, a9 as getBusinessConfig, aa as getCart, ab as getCmsEntry, ac as getConsultation, ad as getConsultations, ae as getDeliverables, af as getFeaturedProducts, ag as getGuestCart, ah as getGuestCartCount, ai as getGuestCartProductType, aj as getGuestCartSubtotal, ak as getLatestProducts, al as getLowStockProducts, am as getMe, an as getNewProducts, ao as getOnSaleProducts, ap as getOrders, aq as getPopularProducts, ar as getRecommendedProducts, as as getSellerShippingAddress, at as getShippingRates, au as getStoredTokens, av as getStorefrontCollectionBySlug, aw as getStorefrontCollections, ax as getStorefrontProductBySlug, ay as getStorefrontProducts, az as getSupportedCurrencies, aA as getSupportedLanguages, aB as getTransactionStatus, aC as getWishlist, aD as googleTranslate, aE as initiatePayment, aF as listCmsEntries, aG as loginCustomer, aH as logisticsService, aI as logout, aJ as mapAuthUserToCustomer, aK as mergeGuestCart, aL as mergeGuestCartIfPresent, aM as notificationsService, aN as paymentService, aO as refreshToken, aP as registerCustomer, aQ as rejectQuote, aR as removeFromCart, aS as removeFromGuestCart, aT as removeFromWishlist, aU as removeProductFromWishlist, aV as requestQuote, aW as requestRevision, aX as sendContactConfirmation, aY as sendContactEmail, aZ as sendMessage, a_ as serviceBookingService, a$ as silentRefresh, b0 as storeTokens, b1 as trackOrder, b2 as updateCartItem, b3 as updateCmsEntry, b4 as updateGuestCartItemQuantity, b5 as updateProfile, b6 as validateShippingAddress, b7 as verifySocialToken, b8 as verifyTransaction } from './index-D9ojrziq.mjs';
|
|
5
|
+
export { A as AppContextValue, a as AppState, C as Country, L as LangCode, S as State, T as Theme } from './index-C1chUA3P.mjs';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* SDK Constants
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { C as CheckoutCustomer,
|
|
2
|
-
export { A as Address, B as BackendLanguage,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { A as
|
|
6
|
-
import 'react';
|
|
1
|
+
import { C as CheckoutCustomer, S as ShippingLocation, D as DeliveryAddress, O as Order } from './index-ac_Jx9NI.js';
|
|
2
|
+
export { A as Address, B as BackendLanguage, a as BespokeStageKey, b as CartItem, c as CartResponse, d as CmsEntry, e as CmsEntryListResponse, f as CmsField, g as CmsIcon, h as CmsIconListResponse, i as CmsModel, j as CmsModelPermissions, k as CmsModelPublicApiPermissions, l as Collection, m as ConversionQuote, n as CreateCmsEntryParams, o as CreateOrderParams, p as Currency, q as CustomField, r as DVACreateRequest, s as DVADetails, F as FindOrderParams, I as Inventory, L as ListCmsEntriesParams, t as ListParams, u as OrderItem, v as OrderStatus, P as PaginatedResponse, w as PaymentInitiateRequest, x as PaymentInitiateResponse, y as Product, z as ProductType, E as ProductVariant, G as SdkConfig, H as ServiceLocationType, J as ServiceLocationTypeEnum, K as ServiceRecurringInterval, M as ServiceRecurringIntervalEnum, N as ServiceType, Q as ServiceTypeEnum, R as ShippingRate, T as ShippingRatesResponse, U as SupportedCurrenciesResponse, V as SupportedLang, W as SupportedLanguagesResponse, X as TransactionVerifyResponse, Y as UpdateCmsEntryParams, Z as WishlistCheckResponse, _ as WishlistItem, $ as WishlistListResponse } from './index-ac_Jx9NI.js';
|
|
3
|
+
import { C as CustomerUser } from './index-hgK4j47a.js';
|
|
4
|
+
export { A as AppointmentStatus, a as AuthContextValue, b as AuthUserResponse, c as AvailableSlot, d as AvatarObject, B as BespokeAvailability, e as BusinessConfig, f as BusinessContext, g as CartItemPayload, h as Consultation, i as ConsultationCreatePayload, j as ConsultationMessage, k as ConsultationMessagePayload, l as ConsultationProductType, m as ConsultationQuoteAcceptPayload, n as ConsultationStatus, o as ContactFormData, p as CustomerAuthResponse, q as CustomerLoginPayload, r as CustomerProfileFields, s as CustomerRegisterPayload, D as DeliverableApprovalPayload, t as DeliverableStatus, u as DeliverableStatusType, L as LogoutPayload, N as NotificationPreferences, O as OTPVerifyPayload, R as RateAddress, v as RefreshTokenResponse, w as ResendOTPPayload, S as ServiceAppointment, x as ServiceAppointmentCreatePayload, y as ServiceDeliverable, z as ShippingRatesRequest, U as UpdateProfilePayload, E as acceptQuote, F as addToCart, G as addToGuestCart, H as addToWishlist, I as approveDeliverable, J as bespokeService, K as bookAppointment, M as cancelAppointment, P as cancelOrder, Q as checkAvailability, T as checkInWishlist, V as clearCart, W as clearGuestCart, X as clearTokens, Y as configService, Z as consultationService, _ as createCmsEntry, $ as createConsultation, a0 as createDedicatedAccount, a1 as createOrder, a2 as deleteCmsEntry, a3 as findOrder, a4 as findOrderByToken, a5 as getAppointment, a6 as getAppointments, a7 as getAuthUser, a8 as getAvailableSlots, a9 as getBusinessConfig, aa as getCart, ab as getCmsEntry, ac as getConsultation, ad as getConsultations, ae as getDeliverables, af as getFeaturedProducts, ag as getGuestCart, ah as getGuestCartCount, ai as getGuestCartProductType, aj as getGuestCartSubtotal, ak as getLatestProducts, al as getLowStockProducts, am as getMe, an as getNewProducts, ao as getOnSaleProducts, ap as getOrders, aq as getPopularProducts, ar as getRecommendedProducts, as as getSellerShippingAddress, at as getShippingRates, au as getStoredTokens, av as getStorefrontCollectionBySlug, aw as getStorefrontCollections, ax as getStorefrontProductBySlug, ay as getStorefrontProducts, az as getSupportedCurrencies, aA as getSupportedLanguages, aB as getTransactionStatus, aC as getWishlist, aD as googleTranslate, aE as initiatePayment, aF as listCmsEntries, aG as loginCustomer, aH as logisticsService, aI as logout, aJ as mapAuthUserToCustomer, aK as mergeGuestCart, aL as mergeGuestCartIfPresent, aM as notificationsService, aN as paymentService, aO as refreshToken, aP as registerCustomer, aQ as rejectQuote, aR as removeFromCart, aS as removeFromGuestCart, aT as removeFromWishlist, aU as removeProductFromWishlist, aV as requestQuote, aW as requestRevision, aX as sendContactConfirmation, aY as sendContactEmail, aZ as sendMessage, a_ as serviceBookingService, a$ as silentRefresh, b0 as storeTokens, b1 as trackOrder, b2 as updateCartItem, b3 as updateCmsEntry, b4 as updateGuestCartItemQuantity, b5 as updateProfile, b6 as validateShippingAddress, b7 as verifySocialToken, b8 as verifyTransaction } from './index-hgK4j47a.js';
|
|
5
|
+
export { A as AppContextValue, a as AppState, C as Country, L as LangCode, S as State, T as Theme } from './index-C1chUA3P.js';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* SDK Constants
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,6 @@ var index_exports = {};
|
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
InvalidBaseURLError: () => InvalidBaseURLError,
|
|
24
24
|
STORAGE_KEYS: () => STORAGE_KEYS,
|
|
25
|
-
SdkProvider: () => SdkProvider,
|
|
26
25
|
ServiceLocationTypeEnum: () => ServiceLocationTypeEnum,
|
|
27
26
|
ServiceRecurringIntervalEnum: () => ServiceRecurringIntervalEnum,
|
|
28
27
|
ServiceTypeEnum: () => ServiceTypeEnum,
|
|
@@ -129,7 +128,6 @@ __export(index_exports, {
|
|
|
129
128
|
updateCmsEntry: () => updateCmsEntry,
|
|
130
129
|
updateGuestCartItemQuantity: () => updateGuestCartItemQuantity,
|
|
131
130
|
updateProfile: () => updateProfile,
|
|
132
|
-
useSdkContext: () => useSdkContext,
|
|
133
131
|
validateConfirmPassword: () => validateConfirmPassword,
|
|
134
132
|
validateEmail: () => validateEmail,
|
|
135
133
|
validateMessage: () => validateMessage,
|
|
@@ -142,17 +140,6 @@ __export(index_exports, {
|
|
|
142
140
|
});
|
|
143
141
|
module.exports = __toCommonJS(index_exports);
|
|
144
142
|
|
|
145
|
-
// src/context/sdk-context.tsx
|
|
146
|
-
var import_react = require("react");
|
|
147
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
148
|
-
var SdkContext = (0, import_react.createContext)(null);
|
|
149
|
-
function SdkProvider({ config, accessToken, children }) {
|
|
150
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SdkContext.Provider, { value: { config, accessToken }, children });
|
|
151
|
-
}
|
|
152
|
-
function useSdkContext() {
|
|
153
|
-
return (0, import_react.useContext)(SdkContext);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
143
|
// src/constants.ts
|
|
157
144
|
var STORAGE_KEYS = {
|
|
158
145
|
ACCESS_TOKEN: "kasuvia_access_token",
|
|
@@ -2682,7 +2669,6 @@ function validateMessage(message) {
|
|
|
2682
2669
|
0 && (module.exports = {
|
|
2683
2670
|
InvalidBaseURLError,
|
|
2684
2671
|
STORAGE_KEYS,
|
|
2685
|
-
SdkProvider,
|
|
2686
2672
|
ServiceLocationTypeEnum,
|
|
2687
2673
|
ServiceRecurringIntervalEnum,
|
|
2688
2674
|
ServiceTypeEnum,
|
|
@@ -2789,7 +2775,6 @@ function validateMessage(message) {
|
|
|
2789
2775
|
updateCmsEntry,
|
|
2790
2776
|
updateGuestCartItemQuantity,
|
|
2791
2777
|
updateProfile,
|
|
2792
|
-
useSdkContext,
|
|
2793
2778
|
validateConfirmPassword,
|
|
2794
2779
|
validateEmail,
|
|
2795
2780
|
validateMessage,
|