UNPKG

@shopify/shopify-app-express

Version:

Shopify Express Middleware - to simplify the building of Shopify Apps with Express

29 lines 2.08 kB
import '@shopify/shopify-api/adapters/node'; import { ConfigParams as ApiConfigParams, Shopify, ShopifyRestResources } from '@shopify/shopify-api'; import { MemorySessionStorage } from '@shopify/shopify-app-session-storage-memory'; import { AppConfigInterface, AppConfigParams } from './config-types'; import { AuthMiddleware } from './auth/types'; import { ProcessWebhooksMiddleware } from './webhooks/types'; import { ValidateAuthenticatedSessionMiddleware, CspHeadersMiddleware, EnsureInstalledMiddleware, RedirectToShopifyOrAppRootMiddleware } from './middlewares/types'; import { RedirectOutOfAppFunction } from './types'; export * from './types'; export * from './auth/types'; export * from './middlewares/types'; export * from './webhooks/types'; export type { AppConfigParams, ExpressApiConfigParams } from './config-types'; export { ApiVersion } from '@shopify/shopify-api'; type DefaultedConfigs<Params extends Partial<ApiConfigParams> | undefined> = ApiConfigParams & Params; type ConfigInterfaceFromParams<Params extends AppConfigParams | Omit<AppConfigParams, 'api'>> = AppConfigInterface<Params extends AppConfigParams ? NonNullable<DefaultedConfigs<Params['api']>['restResources']> : ShopifyRestResources, Params['sessionStorage'] extends undefined ? MemorySessionStorage : NonNullable<Params['sessionStorage']>>; export interface ShopifyApp<Params extends AppConfigParams = AppConfigParams> { config: ConfigInterfaceFromParams<Params>; api: Shopify<DefaultedConfigs<Params['api']>, DefaultedConfigs<Params['api']>['restResources'] & ShopifyRestResources>; auth: AuthMiddleware; processWebhooks: ProcessWebhooksMiddleware; validateAuthenticatedSession: ValidateAuthenticatedSessionMiddleware; cspHeaders: CspHeadersMiddleware; ensureInstalledOnShop: EnsureInstalledMiddleware; redirectToShopifyOrAppRoot: RedirectToShopifyOrAppRootMiddleware; redirectOutOfApp: RedirectOutOfAppFunction; } export declare function shopifyApp<Params extends AppConfigParams>(config: Params): ShopifyApp<Params>; //# sourceMappingURL=index.d.ts.map