UNPKG

@scayle/storefront-nuxt

Version:

Nuxt integration for the SCAYLE Commerce Engine and Storefront API

120 lines (114 loc) 8.7 kB
import * as fishery from 'fishery'; import { Factory } from 'fishery'; import { StorefrontRuntimeConfigType } from '../../dist/runtime/utils/zodSchema.js'; import { ShopConfig } from '../../dist/runtime/types/module.js'; import * as hookable from 'hookable'; import * as _scayle_storefront_core from '@scayle/storefront-core'; import { RpcContext, StorefrontAPIClient, Log, RuntimeConfiguration, ContextWithoutSession, ContextWithSession } from '@scayle/storefront-core'; import { RouteLocationNormalizedLoadedGeneric } from 'vue-router'; export * from '@scayle/storefront-core/test/factories'; interface ModuleOptionsFactoryParams { shops: ShopConfig[]; } declare const moduleRuntimeOptionsFactory: Factory<StorefrontRuntimeConfigType, ModuleOptionsFactoryParams, StorefrontRuntimeConfigType, fishery.DeepPartialObject<StorefrontRuntimeConfigType>>; declare const moduleOptionsFactory: Factory<{ rpcDir?: string | undefined; rpcMethodNames?: string[] | undefined; rpcMethodOverrides?: ("getProductById" | "getProductsByIds" | "getProductsByReferenceKeys" | "getProductsCount" | "fetchAllFiltersForCategory" | "getFilters" | "getProductsByCategory" | "oauthForgetPassword" | "oauthGuestLogin" | "oauthLogin" | "oauthRegister" | "oauthRevokeToken" | "refreshAccessToken" | "updatePasswordByHash" | "addItemToBasket" | "addItemsToBasket" | "getBasket" | "removeItemFromBasket" | "clearBasket" | "mergeBaskets" | "updateBasketItem" | "getApplicablePromotionsByCode" | "updatePromotions" | "getBrands" | "getBrandById" | "getRootCategories" | "getCategoryByPath" | "getCategoriesByPath" | "getCategoryById" | "getCategoryTree" | "getCampaign" | "getCampaignKey" | "getOrderDataByCbd" | "getSearchSuggestions" | "resolveSearch" | "getShopConfiguration" | "getUser" | "fetchUser" | "refreshUser" | "getAccessToken" | "getWishlist" | "addItemToWishlist" | "removeItemFromWishlist" | "clearWishlist" | "getOrderById" | "getOrderCustomData" | "getShopUserAddresses" | "updateShopUser" | "updatePassword" | "getCheckoutToken" | "getVariantById" | "fetchAllNavigationTrees" | "fetchNavigationTreeById" | "fetchNavigationTreeByName" | "getPromotions" | "getCurrentPromotions" | "getPromotionsByIds" | "getExternalIdpRedirect" | "handleIDPLoginCallback")[] | undefined; apiBasePath?: string | undefined; }, any, { rpcDir?: string | undefined; rpcMethodNames?: string[] | undefined; rpcMethodOverrides?: ("getProductById" | "getProductsByIds" | "getProductsByReferenceKeys" | "getProductsCount" | "fetchAllFiltersForCategory" | "getFilters" | "getProductsByCategory" | "oauthForgetPassword" | "oauthGuestLogin" | "oauthLogin" | "oauthRegister" | "oauthRevokeToken" | "refreshAccessToken" | "updatePasswordByHash" | "addItemToBasket" | "addItemsToBasket" | "getBasket" | "removeItemFromBasket" | "clearBasket" | "mergeBaskets" | "updateBasketItem" | "getApplicablePromotionsByCode" | "updatePromotions" | "getBrands" | "getBrandById" | "getRootCategories" | "getCategoryByPath" | "getCategoriesByPath" | "getCategoryById" | "getCategoryTree" | "getCampaign" | "getCampaignKey" | "getOrderDataByCbd" | "getSearchSuggestions" | "resolveSearch" | "getShopConfiguration" | "getUser" | "fetchUser" | "refreshUser" | "getAccessToken" | "getWishlist" | "addItemToWishlist" | "removeItemFromWishlist" | "clearWishlist" | "getOrderById" | "getOrderCustomData" | "getShopUserAddresses" | "updateShopUser" | "updatePassword" | "getCheckoutToken" | "getVariantById" | "fetchAllNavigationTrees" | "fetchNavigationTreeById" | "fetchNavigationTreeByName" | "getPromotions" | "getCurrentPromotions" | "getPromotionsByIds" | "getExternalIdpRedirect" | "handleIDPLoginCallback")[] | undefined; apiBasePath?: string | undefined; }, fishery.DeepPartialObject<{ rpcDir?: string | undefined; rpcMethodNames?: string[] | undefined; rpcMethodOverrides?: ("getProductById" | "getProductsByIds" | "getProductsByReferenceKeys" | "getProductsCount" | "fetchAllFiltersForCategory" | "getFilters" | "getProductsByCategory" | "oauthForgetPassword" | "oauthGuestLogin" | "oauthLogin" | "oauthRegister" | "oauthRevokeToken" | "refreshAccessToken" | "updatePasswordByHash" | "addItemToBasket" | "addItemsToBasket" | "getBasket" | "removeItemFromBasket" | "clearBasket" | "mergeBaskets" | "updateBasketItem" | "getApplicablePromotionsByCode" | "updatePromotions" | "getBrands" | "getBrandById" | "getRootCategories" | "getCategoryByPath" | "getCategoriesByPath" | "getCategoryById" | "getCategoryTree" | "getCampaign" | "getCampaignKey" | "getOrderDataByCbd" | "getSearchSuggestions" | "resolveSearch" | "getShopConfiguration" | "getUser" | "fetchUser" | "refreshUser" | "getAccessToken" | "getWishlist" | "addItemToWishlist" | "removeItemFromWishlist" | "clearWishlist" | "getOrderById" | "getOrderCustomData" | "getShopUserAddresses" | "updateShopUser" | "updatePassword" | "getCheckoutToken" | "getVariantById" | "fetchAllNavigationTrees" | "fetchNavigationTreeById" | "fetchNavigationTreeByName" | "getPromotions" | "getCurrentPromotions" | "getPromotionsByIds" | "getExternalIdpRedirect" | "handleIDPLoginCallback")[] | undefined; apiBasePath?: string | undefined; }>>; declare const shopConfigFactory: Factory<ShopConfig, any, ShopConfig, fishery.DeepPartialObject<ShopConfig>>; interface RpcContextFactoryParams { isLoggedIn: boolean; } declare const rpcContextFactory: Factory<RpcContext, RpcContextFactoryParams, RpcContext, fishery.DeepPartialObject<{ locale: string; checkout: { url: string; token: string; secret: string; user: string; accessHeader?: string; cbdExpiration?: number; }; sapiClient: StorefrontAPIClient; cached: _scayle_storefront_core.CachedType; shopId: number; domain?: string; withParams?: _scayle_storefront_core.WithParams; campaignKey?: string; destroySessionsForUserId: (userId: number, sessionsToKeep?: string[]) => Promise<void>; generateBasketKeyForUserId: (userId: string) => Promise<string>; generateWishlistKeyForUserId: (userId: string) => Promise<string>; routerBasePath?: string; ip?: string | undefined; originalIp?: string; log: Log; auth: { resetPasswordUrl?: string; }; oauth?: { clientId: string; apiHost: string; clientSecret: string; }; runtimeConfiguration: RuntimeConfiguration; idp?: _scayle_storefront_core.IDPConfig; headers: Headers; internalAccessHeader?: string; callHook?: hookable.Hookable<_scayle_storefront_core.StorefrontHooks>["callHook"]; callHookParallel?: hookable.Hookable<_scayle_storefront_core.StorefrontHooks>["callHookParallel"]; callHookWith?: hookable.Hookable<_scayle_storefront_core.StorefrontHooks>["callHookWith"]; callRpc?: _scayle_storefront_core.RpcMethodCall; } & _scayle_storefront_core.AdditionalRpcContext & ContextWithoutSession> | fishery.DeepPartialObject<{ locale: string; checkout: { url: string; token: string; secret: string; user: string; accessHeader?: string; cbdExpiration?: number; }; sapiClient: StorefrontAPIClient; cached: _scayle_storefront_core.CachedType; shopId: number; domain?: string; withParams?: _scayle_storefront_core.WithParams; campaignKey?: string; destroySessionsForUserId: (userId: number, sessionsToKeep?: string[]) => Promise<void>; generateBasketKeyForUserId: (userId: string) => Promise<string>; generateWishlistKeyForUserId: (userId: string) => Promise<string>; routerBasePath?: string; ip?: string | undefined; originalIp?: string; log: Log; auth: { resetPasswordUrl?: string; }; oauth?: { clientId: string; apiHost: string; clientSecret: string; }; runtimeConfiguration: RuntimeConfiguration; idp?: _scayle_storefront_core.IDPConfig; headers: Headers; internalAccessHeader?: string; callHook?: hookable.Hookable<_scayle_storefront_core.StorefrontHooks>["callHook"]; callHookParallel?: hookable.Hookable<_scayle_storefront_core.StorefrontHooks>["callHookParallel"]; callHookWith?: hookable.Hookable<_scayle_storefront_core.StorefrontHooks>["callHookWith"]; callRpc?: _scayle_storefront_core.RpcMethodCall; } & _scayle_storefront_core.AdditionalRpcContext & ContextWithSession>>; declare const routeFactory: Factory<RouteLocationNormalizedLoadedGeneric, any, RouteLocationNormalizedLoadedGeneric, fishery.DeepPartialObject<RouteLocationNormalizedLoadedGeneric>>; export { moduleOptionsFactory, moduleRuntimeOptionsFactory, routeFactory, rpcContextFactory, shopConfigFactory };