import "reflect-metadata"; import { FindManyOptions, FindOneOptions, FindOperator, OrderByCondition } from "typeorm"; import { BaseEntity } from "../interfaces"; import { ClassConstructor } from "./global"; /** * Utility type used to remove some optional attributes (coming from K) from a type T */ export declare type WithRequiredProperty = T & { [Property in K]-?: T[Property]; }; export declare type PartialPick = { [P in K]?: T[P]; }; export declare type Writable = { -readonly [key in keyof T]: T[key] | FindOperator | FindOperator | FindOperator; }; export declare type ExtendedFindConfig = FindConfig & (FindOneOptions | FindManyOptions) & { where: Partial>; withDeleted?: boolean; relations?: string[]; }; export declare type QuerySelector = Selector & { q?: string; }; export declare type Selector = { [key in keyof TEntity]?: TEntity[key] | TEntity[key][] | DateComparisonOperator | StringComparisonOperator | NumericalComparisonOperator | FindOperator; }; 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 FindConfig { select?: (keyof Entity)[]; skip?: number; take?: number; relations?: string[]; order?: Record; } export interface CustomFindOptions { select?: FindManyOptions["select"]; where?: FindManyOptions["where"] & { [P in InKeys]?: TModel[P][]; }; order?: OrderByCondition; skip?: number; take?: number; } export declare type QueryConfig = { defaultFields?: (keyof TEntity | string)[]; defaultRelations?: string[]; allowedFields?: string[]; allowedRelations?: string[]; defaultLimit?: number; isList?: boolean; }; export declare type RequestQueryFields = { expand?: string; fields?: string; offset?: number; limit?: number; order?: string; }; export declare type PaginatedResponse = { limit: number; offset: number; count: number; }; export declare type DeleteResponse = { id: string; object: string; deleted: boolean; }; export declare class EmptyQueryParams { } export declare class DateComparisonOperator { lt?: Date; gt?: Date; gte?: Date; lte?: Date; } export declare class StringComparisonOperator { lt?: string; gt?: string; gte?: string; lte?: string; } export declare class NumericalComparisonOperator { lt?: number; gt?: number; gte?: number; lte?: number; } export declare class AddressPayload { first_name?: string; last_name?: string; phone?: string; metadata?: Record; company?: string; address_1?: string; address_2?: string; city?: string; country_code?: string; province?: string; postal_code?: string; } export declare class AddressCreatePayload { first_name: string; last_name: string; phone: string; metadata: object; company: string; address_1: string; address_2: string; city: string; country_code: string; province: string; postal_code: string; } export declare class FindParams { expand?: string; fields?: string; } export declare class FindPaginationParams { offset?: number; limit?: number; } export declare function extendedFindParamsMixin({ limit, offset, }?: { limit?: number; offset?: number; }): ClassConstructor;