import { ModuleMetadata, Type } from '@nestjs/common'; import type { SessionInterface } from '@shopify/shopify-api'; import type { IncomingMessage, ServerResponse } from 'http'; export enum AccessMode { Online = 'online', Offline = 'offline', } export interface ShopifyAuthModuleOptions { basePath?: string; returnHeaders?: boolean; useGlobalPrefix?: boolean; afterAuthHandler?: ShopifyAuthAfterHandler; } export interface ShopifyAuthOptionsFactory { createShopifyAuthOptions(): | Promise | ShopifyAuthModuleOptions; } export type ShopifySessionRequest = T & { shopifySession?: SessionInterface | undefined; }; export interface ShopifyAuthAfterHandler< T extends IncomingMessage = IncomingMessage, R extends ServerResponse = ServerResponse > { afterAuth(req: T, res: R, session: SessionInterface): Promise; } export interface ShopifyAuthModuleAsyncOptions extends Pick { useExisting?: Type; useClass?: Type; /* eslint-disable @typescript-eslint/no-explicit-any */ useFactory?: ( ...args: any[] ) => Promise | ShopifyAuthModuleOptions; inject?: any[]; /* eslint-enable @typescript-eslint/no-explicit-any */ }