UNPKG

@medusajs/medusa

Version:

Building blocks for digital commerce

61 lines 2.42 kB
import { FindConfig, RequestQueryFields, Logger as coreLogger, MedusaContainer as coreMedusaContainer } from "@medusajs/framework/types"; declare global { namespace Express { interface Request { user?: { customer_id?: string; userId?: string; }; scope: MedusaContainer; validatedQuery: RequestQueryFields & Record<string, unknown>; validatedBody: unknown; /** * TODO: shouldn't this correspond to returnable fields instead of allowed fields? also it is used by the cleanResponseData util */ allowedProperties: string[]; /** * An object containing the select, relation, skip, take and order to be used with medusa internal services */ listConfig: FindConfig<unknown>; /** * An object containing the select, relation to be used with medusa internal services */ retrieveConfig: FindConfig<unknown>; /** * An object containing fields and variables to be used with the remoteQuery */ queryConfig: { fields: string[]; pagination: { order?: Record<string, string>; skip: number; take?: number; }; }; /** * @deprecated. Instead use "req.queryConfig" */ remoteQueryConfig: Request["queryConfig"]; /** * An object containing the fields that are filterable e.g `{ id: Any<String> }` */ filterableFields: Record<string, unknown>; includes?: Record<string, boolean>; /** * An array of fields and relations that are allowed to be queried, this can be set by the * consumer as part of a middleware and it will take precedence over the defaultAllowedFields set * by the api */ allowed?: string[]; errors: string[]; requestId?: string; } } } export type ClassConstructor<T> = { new (...args: unknown[]): T; }; export type MedusaContainer = coreMedusaContainer; export type Logger = coreLogger; export type Constructor<T> = new (...args: any[]) => T; //# sourceMappingURL=global.d.ts.map