UNPKG

@shopify/shopify-app-express

Version:

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

28 lines 1.92 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 } from './config-types'; type DefaultedConfigs<Params extends Partial<ApiConfigParams> | undefined> = ApiConfigParams & Params; type ConfigInterfaceFromParams<Params extends AppConfigParams> = AppConfigInterface<NonNullable<DefaultedConfigs<Params['api']>['restResources']>, 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