chore(types): index module type (#9473)
This commit is contained in:
committed by
GitHub
parent
67e08dc989
commit
cc77ca1413
@@ -2,9 +2,9 @@ import {
|
||||
RemoteQueryEntryPoints,
|
||||
RemoteQueryFilters,
|
||||
RemoteQueryGraph,
|
||||
RemoteQueryInput,
|
||||
RemoteQueryObjectConfig,
|
||||
} from "@medusajs/types"
|
||||
import { IndexOrderBy } from "@medusajs/types/dist/index/query-config/query-input-config-order-by"
|
||||
import { QueryContext, QueryFilter, isObject } from "@medusajs/utils"
|
||||
import { parseAndAssignFilters } from "./parse-filters"
|
||||
|
||||
@@ -34,11 +34,7 @@ export function toRemoteQuery<const TEntity extends string>(
|
||||
entity: TEntity | keyof RemoteQueryEntryPoints
|
||||
fields: RemoteQueryObjectConfig<TEntity>["fields"]
|
||||
filters?: RemoteQueryFilters<TEntity>
|
||||
pagination?: {
|
||||
skip?: number
|
||||
take?: number
|
||||
order?: IndexOrderBy<TEntity>
|
||||
}
|
||||
pagination?: Partial<RemoteQueryInput<TEntity>["pagination"]>
|
||||
context?: Record<string, any>
|
||||
},
|
||||
entitiesMap: Map<string, any>
|
||||
|
||||
@@ -7,11 +7,13 @@ export * as CommonTypes from "./common"
|
||||
export * as CurrencyTypes from "./currency"
|
||||
export * as CustomerTypes from "./customer"
|
||||
export * as DAL from "./dal"
|
||||
export * as DmlTypes from "./dml"
|
||||
export * as EventBusTypes from "./event-bus"
|
||||
export * as FeatureFlagTypes from "./feature-flag"
|
||||
export * as FileTypes from "./file"
|
||||
export * as FulfillmentTypes from "./fulfillment"
|
||||
export * as HttpTypes from "./http"
|
||||
export * as IndexTypes from "./index-data/index"
|
||||
export * as InventoryTypes from "./inventory"
|
||||
export * as LoggerTypes from "./logger"
|
||||
export * as ModulesSdkTypes from "./modules-sdk"
|
||||
@@ -30,5 +32,3 @@ export * as TransactionBaseTypes from "./transaction-base"
|
||||
export * as UserTypes from "./user"
|
||||
export * as WorkflowTypes from "./workflow"
|
||||
export * as WorkflowsSdkTypes from "./workflows-sdk"
|
||||
export * as DmlTypes from "./dml"
|
||||
export * as IndexTypes from "./index/index"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { expectTypeOf } from "expect-type"
|
||||
import "../__fixtures__/index-service-entry-points"
|
||||
import { OperatorMap } from "../operator-map"
|
||||
import { IndexOperatorMap as OperatorMap } from "../index-operator-map"
|
||||
import { IndexQueryConfig, OrderBy } from "../query-config"
|
||||
|
||||
describe("IndexQueryConfig", () => {
|
||||
@@ -1,4 +1,4 @@
|
||||
export type OperatorMap<T> = {
|
||||
export type IndexOperatorMap<T> = {
|
||||
$eq: T
|
||||
$lt: T
|
||||
$lte: T
|
||||
@@ -1,6 +1,5 @@
|
||||
export * from "./service"
|
||||
export * from "./common"
|
||||
export * from "./index-service-entry-points"
|
||||
export * from "./query-config"
|
||||
export * from "./operator-map"
|
||||
export * from "./common"
|
||||
export * from "./service"
|
||||
export * from "./sotrage-provider"
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Prettify } from "../../common"
|
||||
import { IndexOperatorMap as OperatorMap } from "../index-operator-map"
|
||||
import { IndexServiceEntryPoints } from "../index-service-entry-points"
|
||||
import { OperatorMap } from "../operator-map"
|
||||
import {
|
||||
CleanupObject,
|
||||
Depth,
|
||||
@@ -1,7 +1,7 @@
|
||||
import { RemoteQueryInput } from "../../modules-sdk/remote-query-object-from-string"
|
||||
import { IndexServiceEntryPoints } from "../index-service-entry-points"
|
||||
import { ObjectToIndexFields } from "./query-input-config-fields"
|
||||
import { IndexFilters } from "./query-input-config-filters"
|
||||
import { IndexOrderBy } from "./query-input-config-order-by"
|
||||
import { IndexServiceEntryPoints } from "../index-service-entry-points"
|
||||
|
||||
export type IndexQueryConfig<TEntry extends string> = {
|
||||
fields: ObjectToIndexFields<
|
||||
@@ -13,11 +13,7 @@ export type IndexQueryConfig<TEntry extends string> = {
|
||||
>[]
|
||||
filters?: IndexFilters<TEntry>
|
||||
joinFilters?: IndexFilters<TEntry>
|
||||
pagination?: {
|
||||
skip?: number
|
||||
take?: number
|
||||
order?: IndexOrderBy<TEntry>
|
||||
}
|
||||
pagination?: Partial<RemoteQueryInput<TEntry>["pagination"]>
|
||||
keepFilteredEntities?: boolean
|
||||
}
|
||||
|
||||
@@ -9,12 +9,14 @@ export * from "./common"
|
||||
export * from "./currency"
|
||||
export * from "./customer"
|
||||
export * from "./dal"
|
||||
export * from "./dml"
|
||||
export * from "./event-bus"
|
||||
export * from "./feature-flag"
|
||||
export * from "./file"
|
||||
export * from "./file-service"
|
||||
export * from "./fulfillment"
|
||||
export * from "./http"
|
||||
export * from "./index-data"
|
||||
export * from "./inventory"
|
||||
export * from "./joiner"
|
||||
export * from "./link-modules"
|
||||
@@ -40,5 +42,3 @@ export * from "./user"
|
||||
export * from "./workflow"
|
||||
export * from "./workflows"
|
||||
export * from "./workflows-sdk"
|
||||
export * from "./dml"
|
||||
export * from "./index"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IndexOrderBy } from "../index/query-config/query-input-config-order-by"
|
||||
import { IndexOrderBy } from "../index-data/query-config/query-input-config-order-by"
|
||||
import { ObjectToRemoteQueryFields } from "./object-to-remote-query-fields"
|
||||
import { RemoteQueryEntryPoints } from "./remote-query-entry-points"
|
||||
import { RemoteQueryFilters } from "./to-remote-query"
|
||||
|
||||
Reference in New Issue
Block a user