@medusajs/types
Advanced tools
Comparing version 1.10.2-snapshot-20230814163039 to 1.10.2-snapshot-20230814182758
@@ -1,2 +0,2 @@ | ||
export type AddressDTO = { | ||
export declare type AddressDTO = { | ||
id?: string; | ||
@@ -3,0 +3,0 @@ address_1: string; |
@@ -1,2 +0,2 @@ | ||
export type CartDTO = { | ||
export declare type CartDTO = { | ||
id?: string; | ||
@@ -3,0 +3,0 @@ email?: string; |
@@ -7,6 +7,6 @@ import { FindManyOptions, FindOneOptions, FindOperator, FindOptionsSelect, FindOptionsWhere, OrderByCondition } from "typeorm"; | ||
*/ | ||
export type WithRequiredProperty<T, K extends keyof T> = T & { | ||
export declare type WithRequiredProperty<T, K extends keyof T> = T & { | ||
[Property in K]-?: T[Property]; | ||
}; | ||
export type PartialPick<T, K extends keyof T> = { | ||
export declare type PartialPick<T, K extends keyof T> = { | ||
[P in K]?: T[P]; | ||
@@ -22,3 +22,3 @@ }; | ||
} | ||
export type Writable<T> = { | ||
export declare type Writable<T> = { | ||
-readonly [key in keyof T]: T[key] | FindOperator<T[key]> | FindOperator<T[key][]> | FindOperator<string[]>; | ||
@@ -36,3 +36,3 @@ }; | ||
} | ||
export type ExtendedFindConfig<TEntity> = (Omit<FindOneOptions<TEntity>, "where" | "relations" | "select"> | Omit<FindManyOptions<TEntity>, "where" | "relations" | "select">) & { | ||
export declare type ExtendedFindConfig<TEntity> = (Omit<FindOneOptions<TEntity>, "where" | "relations" | "select"> | Omit<FindManyOptions<TEntity>, "where" | "relations" | "select">) & { | ||
select?: FindOptionsSelect<TEntity>; | ||
@@ -45,12 +45,12 @@ relations?: FindOptionsRelations<TEntity>; | ||
}; | ||
export type QuerySelector<TEntity> = Selector<TEntity> & { | ||
export declare type QuerySelector<TEntity> = Selector<TEntity> & { | ||
q?: string; | ||
}; | ||
export type TreeQuerySelector<TEntity> = QuerySelector<TEntity> & { | ||
export declare type TreeQuerySelector<TEntity> = QuerySelector<TEntity> & { | ||
include_descendants_tree?: boolean; | ||
}; | ||
export type Selector<TEntity> = { | ||
export declare type Selector<TEntity> = { | ||
[key in keyof TEntity]?: TEntity[key] | TEntity[key][] | DateComparisonOperator | StringComparisonOperator | NumericalComparisonOperator | FindOperator<TEntity[key][] | string | string[]>; | ||
}; | ||
export type TotalField = "shipping_total" | "discount_total" | "tax_total" | "refunded_total" | "total" | "subtotal" | "refundable_amount" | "gift_card_total" | "gift_card_tax_total"; | ||
export declare type TotalField = "shipping_total" | "discount_total" | "tax_total" | "refunded_total" | "total" | "subtotal" | "refundable_amount" | "gift_card_total" | "gift_card_tax_total"; | ||
export interface CustomFindOptions<TModel, InKeys extends keyof TModel> { | ||
@@ -65,3 +65,3 @@ select?: FindManyOptions<TModel>["select"]; | ||
} | ||
export type QueryConfig<TEntity extends BaseEntity> = { | ||
export declare type QueryConfig<TEntity extends BaseEntity> = { | ||
defaultFields?: (keyof TEntity | string)[]; | ||
@@ -74,3 +74,3 @@ defaultRelations?: string[]; | ||
}; | ||
export type RequestQueryFields = { | ||
export declare type RequestQueryFields = { | ||
expand?: string; | ||
@@ -82,3 +82,3 @@ fields?: string; | ||
}; | ||
export type PaginatedResponse = { | ||
export declare type PaginatedResponse = { | ||
limit: number; | ||
@@ -88,3 +88,3 @@ offset: number; | ||
}; | ||
export type DeleteResponse = { | ||
export declare type DeleteResponse = { | ||
id: string; | ||
@@ -91,0 +91,0 @@ object: string; |
import { RedisOptions } from "ioredis"; | ||
import { LoggerOptions } from "typeorm"; | ||
import { ExternalModuleDeclaration, InternalModuleDeclaration } from "../modules-sdk"; | ||
type SessionOptions = { | ||
declare type SessionOptions = { | ||
name?: string; | ||
@@ -12,3 +12,3 @@ resave?: boolean; | ||
}; | ||
export type HttpCompressionOptions = { | ||
export declare type HttpCompressionOptions = { | ||
enabled?: boolean; | ||
@@ -19,3 +19,3 @@ level?: number; | ||
}; | ||
export type ProjectConfigOptions = { | ||
export declare type ProjectConfigOptions = { | ||
redis_url?: string; | ||
@@ -41,3 +41,3 @@ redis_prefix?: string; | ||
}; | ||
export type ConfigModule = { | ||
export declare type ConfigModule = { | ||
projectConfig: ProjectConfigOptions; | ||
@@ -44,0 +44,0 @@ featureFlags: Record<string, boolean | string>; |
import { AwilixContainer } from "awilix"; | ||
export type MedusaContainer = AwilixContainer & { | ||
export declare type MedusaContainer = AwilixContainer & { | ||
registerAdd: <T>(name: string, registration: T) => MedusaContainer; | ||
createScope: () => MedusaContainer; | ||
}; |
@@ -16,3 +16,3 @@ import { Dictionary, FilterQuery, Order } from "./utils"; | ||
} | ||
export type FindOptions<T = any> = { | ||
export declare type FindOptions<T = any> = { | ||
where: FilterQuery<T>; | ||
@@ -19,0 +19,0 @@ options?: OptionsQuery<T, any>; |
/// <reference types="node" /> | ||
export type Dictionary<T = any> = { | ||
export declare type Dictionary<T = any> = { | ||
[k: string]: T; | ||
}; | ||
type Query<T> = T extends object ? T extends Scalar ? never : FilterQuery<T> : FilterValue<T>; | ||
type ExpandScalar<T> = null | (T extends string ? string | RegExp : T extends Date ? Date | string : T); | ||
type Scalar = boolean | number | string | bigint | symbol | Date | RegExp | Buffer | { | ||
declare type Query<T> = T extends object ? T extends Scalar ? never : FilterQuery<T> : FilterValue<T>; | ||
declare type ExpandScalar<T> = null | (T extends string ? string | RegExp : T extends Date ? Date | string : T); | ||
declare type Scalar = boolean | number | string | bigint | symbol | Date | RegExp | Buffer | { | ||
toHexString(): string; | ||
}; | ||
type ReadonlyPrimary<T> = T extends any[] ? Readonly<T> : T; | ||
declare type ReadonlyPrimary<T> = T extends any[] ? Readonly<T> : T; | ||
declare const PrimaryKeyType: unique symbol; | ||
type Primary<T> = T extends { | ||
declare type Primary<T> = T extends { | ||
[PrimaryKeyType]?: infer PK; | ||
@@ -21,3 +21,3 @@ } ? ReadonlyPrimary<PK> : T extends { | ||
} ? ReadonlyPrimary<PK> : never; | ||
export type OperatorMap<T> = { | ||
export declare type OperatorMap<T> = { | ||
$and?: Query<T>[]; | ||
@@ -43,6 +43,6 @@ $or?: Query<T>[]; | ||
}; | ||
type FilterValue2<T> = T | ExpandScalar<T> | Primary<T>; | ||
type FilterValue<T> = OperatorMap<FilterValue2<T>> | FilterValue2<T> | FilterValue2<T>[] | null; | ||
type PrevLimit = [never, 1, 2, 3]; | ||
export type FilterQuery<T = any, Prev extends number = 3> = Prev extends never ? never : { | ||
declare type FilterValue2<T> = T | ExpandScalar<T> | Primary<T>; | ||
declare type FilterValue<T> = OperatorMap<FilterValue2<T>> | FilterValue2<T> | FilterValue2<T>[] | null; | ||
declare type PrevLimit = [never, 1, 2, 3]; | ||
export declare type FilterQuery<T = any, Prev extends number = 3> = Prev extends never ? never : { | ||
[Key in keyof T]?: T[Key] extends boolean | number | string | bigint | symbol | Date ? T[Key] | OperatorMap<T[Key]> : T[Key] extends infer U ? U extends { | ||
@@ -52,5 +52,5 @@ [x: number]: infer V; | ||
}; | ||
export type Order<T> = { | ||
export declare type Order<T> = { | ||
[key in keyof T]?: "ASC" | "DESC" | Order<T[key] extends Array<any> ? T[key][0] : T[key]>; | ||
}; | ||
export {}; |
@@ -1,11 +0,11 @@ | ||
export type Subscriber<T = unknown> = (data: T, eventName: string) => Promise<void>; | ||
export type SubscriberContext = { | ||
export declare type Subscriber<T = unknown> = (data: T, eventName: string) => Promise<void>; | ||
export declare type SubscriberContext = { | ||
subscriberId: string; | ||
}; | ||
export type SubscriberDescriptor = { | ||
export declare type SubscriberDescriptor = { | ||
id: string; | ||
subscriber: Subscriber; | ||
}; | ||
export type EventHandler<T = unknown> = (data: T, eventName: string) => Promise<void>; | ||
export type EmitData<T = unknown> = { | ||
export declare type EventHandler<T = unknown> = (data: T, eventName: string) => Promise<void>; | ||
export declare type EmitData<T = unknown> = { | ||
eventName: string; | ||
@@ -12,0 +12,0 @@ data: T; |
@@ -21,7 +21,7 @@ export interface IFlagRouter { | ||
*/ | ||
export type FeatureFlagsResponse = { | ||
export declare type FeatureFlagsResponse = { | ||
key: string; | ||
value: boolean | Record<string, boolean>; | ||
}[]; | ||
export type FlagSettings = { | ||
export declare type FlagSettings = { | ||
key: string; | ||
@@ -28,0 +28,0 @@ description: string; |
@@ -64,3 +64,3 @@ import { NumericalComparisonOperator, StringComparisonOperator } from "../common"; | ||
*/ | ||
export type InventoryItemDTO = { | ||
export declare type InventoryItemDTO = { | ||
id: string; | ||
@@ -131,3 +131,3 @@ sku?: string | null; | ||
*/ | ||
export type ReservationItemDTO = { | ||
export declare type ReservationItemDTO = { | ||
id: string; | ||
@@ -184,3 +184,3 @@ location_id: string; | ||
*/ | ||
export type InventoryLevelDTO = { | ||
export declare type InventoryLevelDTO = { | ||
id: string; | ||
@@ -197,3 +197,3 @@ inventory_item_id: string; | ||
}; | ||
export type FilterableReservationItemProps = { | ||
export declare type FilterableReservationItemProps = { | ||
id?: string | string[]; | ||
@@ -208,3 +208,3 @@ type?: string | string[]; | ||
}; | ||
export type FilterableInventoryItemProps = { | ||
export declare type FilterableInventoryItemProps = { | ||
id?: string | string[]; | ||
@@ -218,3 +218,3 @@ location_id?: string | string[]; | ||
}; | ||
export type CreateInventoryItemInput = { | ||
export declare type CreateInventoryItemInput = { | ||
sku?: string; | ||
@@ -235,3 +235,3 @@ origin_country?: string; | ||
}; | ||
export type CreateReservationItemInput = { | ||
export declare type CreateReservationItemInput = { | ||
line_item_id?: string; | ||
@@ -246,3 +246,3 @@ inventory_item_id: string; | ||
}; | ||
export type FilterableInventoryLevelProps = { | ||
export declare type FilterableInventoryLevelProps = { | ||
inventory_item_id?: string | string[]; | ||
@@ -254,3 +254,3 @@ location_id?: string | string[]; | ||
}; | ||
export type CreateInventoryLevelInput = { | ||
export declare type CreateInventoryLevelInput = { | ||
inventory_item_id: string; | ||
@@ -262,11 +262,11 @@ location_id: string; | ||
}; | ||
export type UpdateInventoryLevelInput = { | ||
export declare type UpdateInventoryLevelInput = { | ||
stocked_quantity?: number; | ||
incoming_quantity?: number; | ||
}; | ||
export type BulkUpdateInventoryLevelInput = { | ||
export declare type BulkUpdateInventoryLevelInput = { | ||
inventory_item_id: string; | ||
location_id: string; | ||
} & UpdateInventoryLevelInput; | ||
export type UpdateReservationItemInput = { | ||
export declare type UpdateReservationItemInput = { | ||
quantity?: number; | ||
@@ -277,3 +277,3 @@ location_id?: string; | ||
}; | ||
export type ReserveQuantityContext = { | ||
export declare type ReserveQuantityContext = { | ||
locationId?: string; | ||
@@ -280,0 +280,0 @@ lineItemId?: string; |
@@ -1,2 +0,2 @@ | ||
export type JoinerRelationship = { | ||
export declare type JoinerRelationship = { | ||
alias: string; | ||
@@ -3,0 +3,0 @@ foreignKey: string; |
@@ -5,6 +5,6 @@ import { JoinerServiceConfig } from "../joiner"; | ||
import { RepositoryService } from "../dal"; | ||
export type Constructor<T> = new (...args: any[]) => T; | ||
export declare type Constructor<T> = new (...args: any[]) => T; | ||
export * from "../common/medusa-container"; | ||
export type LogLevel = "query" | "schema" | "error" | "warn" | "info" | "log" | "migration"; | ||
export type LoggerOptions = boolean | "all" | LogLevel[]; | ||
export declare type LogLevel = "query" | "schema" | "error" | "warn" | "info" | "log" | "migration"; | ||
export declare type LoggerOptions = boolean | "all" | LogLevel[]; | ||
export declare enum MODULE_SCOPE { | ||
@@ -18,3 +18,3 @@ INTERNAL = "internal", | ||
} | ||
export type InternalModuleDeclaration = { | ||
export declare type InternalModuleDeclaration = { | ||
scope: MODULE_SCOPE.INTERNAL; | ||
@@ -28,3 +28,3 @@ resources: MODULE_RESOURCE_TYPE; | ||
}; | ||
export type ExternalModuleDeclaration = { | ||
export declare type ExternalModuleDeclaration = { | ||
scope: MODULE_SCOPE.EXTERNAL; | ||
@@ -39,3 +39,3 @@ server?: { | ||
}; | ||
export type ModuleResolution = { | ||
export declare type ModuleResolution = { | ||
resolutionPath: string | false; | ||
@@ -48,3 +48,3 @@ definition: ModuleDefinition; | ||
}; | ||
export type ModuleDefinition = { | ||
export declare type ModuleDefinition = { | ||
key: string; | ||
@@ -60,7 +60,7 @@ registrationName: string; | ||
}; | ||
export type LoadedModule = unknown & { | ||
export declare type LoadedModule = unknown & { | ||
__joinerConfig: JoinerServiceConfig; | ||
__definition: ModuleDefinition; | ||
}; | ||
export type LoaderOptions<TOptions = Record<string, unknown>> = { | ||
export declare type LoaderOptions<TOptions = Record<string, unknown>> = { | ||
container: MedusaContainer; | ||
@@ -70,8 +70,8 @@ options?: TOptions; | ||
}; | ||
export type ModuleLoaderFunction = (options: LoaderOptions, moduleDeclaration?: InternalModuleDeclaration) => Promise<void>; | ||
export type ModulesResponse = { | ||
export declare type ModuleLoaderFunction = (options: LoaderOptions, moduleDeclaration?: InternalModuleDeclaration) => Promise<void>; | ||
export declare type ModulesResponse = { | ||
module: string; | ||
resolution: string | false; | ||
}[]; | ||
export type ModuleExports = { | ||
export declare type ModuleExports = { | ||
service: Constructor<any>; | ||
@@ -96,3 +96,3 @@ loaders?: ModuleLoaderFunction[]; | ||
} | ||
export type ModuleServiceInitializeCustomDataLayerOptions = { | ||
export declare type ModuleServiceInitializeCustomDataLayerOptions = { | ||
manager?: any; | ||
@@ -99,0 +99,0 @@ repositories?: { |
export * from "./interface"; | ||
export * from "./settings"; | ||
export type IndexSettings = { | ||
export declare type IndexSettings = { | ||
/** | ||
@@ -5,0 +5,0 @@ * Settings specific to the provider. E.g. `searchableAttributes`. |
@@ -1,2 +0,2 @@ | ||
export type IndexSettings = { | ||
export declare type IndexSettings = { | ||
/** | ||
@@ -3,0 +3,0 @@ * Settings specific to the provider. E.g. `searchableAttributes`. |
import { EntityManager } from "typeorm"; | ||
export type SharedContext = { | ||
export declare type SharedContext = { | ||
transactionManager?: EntityManager; | ||
manager?: EntityManager; | ||
}; | ||
export type Context<TManager = unknown> = { | ||
export declare type Context<TManager = unknown> = { | ||
transactionManager?: TManager; | ||
@@ -8,0 +8,0 @@ manager?: TManager; |
@@ -66,3 +66,3 @@ import { StringComparisonOperator } from "../common/common"; | ||
*/ | ||
export type StockLocationAddressDTO = { | ||
export declare type StockLocationAddressDTO = { | ||
id?: string; | ||
@@ -128,3 +128,3 @@ address_1: string; | ||
*/ | ||
export type StockLocationDTO = { | ||
export declare type StockLocationDTO = { | ||
id: string; | ||
@@ -148,6 +148,6 @@ name: string; | ||
*/ | ||
export type StockLocationExpandedDTO = StockLocationDTO & { | ||
export declare type StockLocationExpandedDTO = StockLocationDTO & { | ||
sales_channels?: any[]; | ||
}; | ||
export type FilterableStockLocationProps = { | ||
export declare type FilterableStockLocationProps = { | ||
id?: string | string[]; | ||
@@ -198,3 +198,3 @@ name?: string | string[] | StringComparisonOperator; | ||
*/ | ||
export type StockLocationAddressInput = { | ||
export declare type StockLocationAddressInput = { | ||
address_1: string; | ||
@@ -233,3 +233,3 @@ address_2?: string; | ||
*/ | ||
export type CreateStockLocationInput = { | ||
export declare type CreateStockLocationInput = { | ||
name: string; | ||
@@ -262,3 +262,3 @@ address_id?: string; | ||
*/ | ||
export type UpdateStockLocationInput = { | ||
export declare type UpdateStockLocationInput = { | ||
name?: string; | ||
@@ -265,0 +265,0 @@ address_id?: string; |
{ | ||
"name": "@medusajs/types", | ||
"version": "1.10.2-snapshot-20230814163039", | ||
"version": "1.10.2-snapshot-20230814182758", | ||
"description": "Medusa Types definition", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
101450