@kasuvia/sdk 0.0.5 → 0.0.7
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/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs.map +1 -1
- 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 +10 -7
- package/dist/index.d.ts +10 -7
- package/dist/index.js +6 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -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/dist/services/index.js.map +1 -1
- package/dist/services/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +5 -0
- package/src/index.ts +4 -6
- package/src/services/auth.service.ts +0 -1
- package/dist/sdk-context-BuarJbeb.d.ts +0 -75
- package/dist/sdk-context-Db8kf1Tv.d.mts +0 -75
|
@@ -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
|
|
@@ -17,6 +16,10 @@ declare const STORAGE_KEYS: {
|
|
|
17
16
|
readonly ORDERS_LINKED: "kasuvia_orders_linked";
|
|
18
17
|
readonly STOREFRONT_STATE: "storefront_state_v3";
|
|
19
18
|
};
|
|
19
|
+
declare const PAYMENT_URLS: {
|
|
20
|
+
readonly MONNIFY: "https://sdk.monnify.com/plugin/monnify.js";
|
|
21
|
+
readonly FLUTTERWAVE: "https://checkout.flutterwave.com/v3.js";
|
|
22
|
+
};
|
|
20
23
|
|
|
21
24
|
/**
|
|
22
25
|
* Bespoke slot booking types for customer-facing storefront
|
|
@@ -235,4 +238,4 @@ declare function validateRequired(value: string, fieldName: string): string | nu
|
|
|
235
238
|
declare function validateConfirmPassword(password: string, confirmPassword: string): string | null;
|
|
236
239
|
declare function validateMessage(message: string): string | null;
|
|
237
240
|
|
|
238
|
-
export { type BespokeCapacityConfig, type BespokeSlotBooking, CheckoutCustomer, CustomerUser, DeliveryAddress, InvalidBaseURLError, type MediaAsset, type MediaAssetUpdatePayload, type MediaUploadParams, Order, STORAGE_KEYS, ShippingLocation, type SlotBookingStatus, type StorageStats, buildDeliveryAddress, buildFullName, enrichCompletedOrder, getCacheTier, getCheckoutCustomerName, getCustomerDisplayName, getErrorMessage, getStorefrontUrl, localStore, logger, sanitizeBaseUrl, sessionStore, setEnvironmentMode, setLoggerEnvironmentMode, splitFullName, validateConfirmPassword, validateEmail, validateMessage, validateName, validatePassword, validateRequired };
|
|
241
|
+
export { type BespokeCapacityConfig, type BespokeSlotBooking, CheckoutCustomer, CustomerUser, DeliveryAddress, InvalidBaseURLError, type MediaAsset, type MediaAssetUpdatePayload, type MediaUploadParams, Order, PAYMENT_URLS, STORAGE_KEYS, ShippingLocation, type SlotBookingStatus, type StorageStats, buildDeliveryAddress, buildFullName, enrichCompletedOrder, getCacheTier, getCheckoutCustomerName, getCustomerDisplayName, getErrorMessage, getStorefrontUrl, localStore, logger, sanitizeBaseUrl, sessionStore, setEnvironmentMode, setLoggerEnvironmentMode, splitFullName, validateConfirmPassword, validateEmail, validateMessage, validateName, validatePassword, validateRequired };
|
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
|
|
@@ -17,6 +16,10 @@ declare const STORAGE_KEYS: {
|
|
|
17
16
|
readonly ORDERS_LINKED: "kasuvia_orders_linked";
|
|
18
17
|
readonly STOREFRONT_STATE: "storefront_state_v3";
|
|
19
18
|
};
|
|
19
|
+
declare const PAYMENT_URLS: {
|
|
20
|
+
readonly MONNIFY: "https://sdk.monnify.com/plugin/monnify.js";
|
|
21
|
+
readonly FLUTTERWAVE: "https://checkout.flutterwave.com/v3.js";
|
|
22
|
+
};
|
|
20
23
|
|
|
21
24
|
/**
|
|
22
25
|
* Bespoke slot booking types for customer-facing storefront
|
|
@@ -235,4 +238,4 @@ declare function validateRequired(value: string, fieldName: string): string | nu
|
|
|
235
238
|
declare function validateConfirmPassword(password: string, confirmPassword: string): string | null;
|
|
236
239
|
declare function validateMessage(message: string): string | null;
|
|
237
240
|
|
|
238
|
-
export { type BespokeCapacityConfig, type BespokeSlotBooking, CheckoutCustomer, CustomerUser, DeliveryAddress, InvalidBaseURLError, type MediaAsset, type MediaAssetUpdatePayload, type MediaUploadParams, Order, STORAGE_KEYS, ShippingLocation, type SlotBookingStatus, type StorageStats, buildDeliveryAddress, buildFullName, enrichCompletedOrder, getCacheTier, getCheckoutCustomerName, getCustomerDisplayName, getErrorMessage, getStorefrontUrl, localStore, logger, sanitizeBaseUrl, sessionStore, setEnvironmentMode, setLoggerEnvironmentMode, splitFullName, validateConfirmPassword, validateEmail, validateMessage, validateName, validatePassword, validateRequired };
|
|
241
|
+
export { type BespokeCapacityConfig, type BespokeSlotBooking, CheckoutCustomer, CustomerUser, DeliveryAddress, InvalidBaseURLError, type MediaAsset, type MediaAssetUpdatePayload, type MediaUploadParams, Order, PAYMENT_URLS, STORAGE_KEYS, ShippingLocation, type SlotBookingStatus, type StorageStats, buildDeliveryAddress, buildFullName, enrichCompletedOrder, getCacheTier, getCheckoutCustomerName, getCustomerDisplayName, getErrorMessage, getStorefrontUrl, localStore, logger, sanitizeBaseUrl, sessionStore, setEnvironmentMode, setLoggerEnvironmentMode, splitFullName, validateConfirmPassword, validateEmail, validateMessage, validateName, validatePassword, validateRequired };
|
package/dist/index.js
CHANGED
|
@@ -21,8 +21,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
InvalidBaseURLError: () => InvalidBaseURLError,
|
|
24
|
+
PAYMENT_URLS: () => PAYMENT_URLS,
|
|
24
25
|
STORAGE_KEYS: () => STORAGE_KEYS,
|
|
25
|
-
SdkProvider: () => SdkProvider,
|
|
26
26
|
ServiceLocationTypeEnum: () => ServiceLocationTypeEnum,
|
|
27
27
|
ServiceRecurringIntervalEnum: () => ServiceRecurringIntervalEnum,
|
|
28
28
|
ServiceTypeEnum: () => ServiceTypeEnum,
|
|
@@ -129,7 +129,6 @@ __export(index_exports, {
|
|
|
129
129
|
updateCmsEntry: () => updateCmsEntry,
|
|
130
130
|
updateGuestCartItemQuantity: () => updateGuestCartItemQuantity,
|
|
131
131
|
updateProfile: () => updateProfile,
|
|
132
|
-
useSdkContext: () => useSdkContext,
|
|
133
132
|
validateConfirmPassword: () => validateConfirmPassword,
|
|
134
133
|
validateEmail: () => validateEmail,
|
|
135
134
|
validateMessage: () => validateMessage,
|
|
@@ -142,17 +141,6 @@ __export(index_exports, {
|
|
|
142
141
|
});
|
|
143
142
|
module.exports = __toCommonJS(index_exports);
|
|
144
143
|
|
|
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
144
|
// src/constants.ts
|
|
157
145
|
var STORAGE_KEYS = {
|
|
158
146
|
ACCESS_TOKEN: "kasuvia_access_token",
|
|
@@ -161,6 +149,10 @@ var STORAGE_KEYS = {
|
|
|
161
149
|
ORDERS_LINKED: "kasuvia_orders_linked",
|
|
162
150
|
STOREFRONT_STATE: "storefront_state_v3"
|
|
163
151
|
};
|
|
152
|
+
var PAYMENT_URLS = {
|
|
153
|
+
MONNIFY: "https://sdk.monnify.com/plugin/monnify.js",
|
|
154
|
+
FLUTTERWAVE: "https://checkout.flutterwave.com/v3.js"
|
|
155
|
+
};
|
|
164
156
|
|
|
165
157
|
// src/types/store/index.ts
|
|
166
158
|
var ServiceTypeEnum = /* @__PURE__ */ ((ServiceTypeEnum2) => {
|
|
@@ -2681,8 +2673,8 @@ function validateMessage(message) {
|
|
|
2681
2673
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2682
2674
|
0 && (module.exports = {
|
|
2683
2675
|
InvalidBaseURLError,
|
|
2676
|
+
PAYMENT_URLS,
|
|
2684
2677
|
STORAGE_KEYS,
|
|
2685
|
-
SdkProvider,
|
|
2686
2678
|
ServiceLocationTypeEnum,
|
|
2687
2679
|
ServiceRecurringIntervalEnum,
|
|
2688
2680
|
ServiceTypeEnum,
|
|
@@ -2789,7 +2781,6 @@ function validateMessage(message) {
|
|
|
2789
2781
|
updateCmsEntry,
|
|
2790
2782
|
updateGuestCartItemQuantity,
|
|
2791
2783
|
updateProfile,
|
|
2792
|
-
useSdkContext,
|
|
2793
2784
|
validateConfirmPassword,
|
|
2794
2785
|
validateEmail,
|
|
2795
2786
|
validateMessage,
|