feat: make AbstractModuleService create method type-safe (#11216)
This commit is contained in:
1 parent
6cd8249a2c
commit
016e332e9b
23 files changed
+677
-35
No files matched your search
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/api-key": patch
|
||||||
|
"@medusajs/auth": patch
|
||||||
|
"@medusajs/cart": patch
|
||||||
|
"@medusajs/customer": patch
|
||||||
|
"@medusajs/fulfillment": patch
|
||||||
|
"@medusajs/inventory": patch
|
||||||
|
"@medusajs/notification": patch
|
||||||
|
"@medusajs/order": patch
|
||||||
|
"@medusajs/payment": patch
|
||||||
|
"@medusajs/pricing": patch
|
||||||
|
"@medusajs/product": patch
|
||||||
|
"@medusajs/promotion": patch
|
||||||
|
"@medusajs/region": patch
|
||||||
|
"@medusajs/sales-channel": patch
|
||||||
|
"@medusajs/stock-location": patch
|
||||||
|
"@medusajs/store": patch
|
||||||
|
"@medusajs/tax": patch
|
||||||
|
"@medusajs/user": patch
|
||||||
|
"@medusajs/utils": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
feat: make AbstractModuleService create method type-safe
|
||||||
@@ -0,0 +1,275 @@
|
|||||||
|
import { expectTypeOf } from "expect-type"
|
||||||
|
import { model } from "../../dml"
|
||||||
|
import { MedusaService } from "../medusa-service"
|
||||||
|
import { InferTypeOf } from "@medusajs/types"
|
||||||
|
|
||||||
|
const Blog = model.define("Blog", {
|
||||||
|
id: model.text(),
|
||||||
|
title: model.text(),
|
||||||
|
description: model.text().nullable(),
|
||||||
|
})
|
||||||
|
|
||||||
|
type BlogDTO = {
|
||||||
|
id: number
|
||||||
|
title: string
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateBlogDTO = {
|
||||||
|
title: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
const baseRepoMock = {
|
||||||
|
serialize: jest.fn().mockImplementation((item) => item),
|
||||||
|
transaction: (task) => task("transactionManager"),
|
||||||
|
getFreshManager: jest.fn().mockReturnThis(),
|
||||||
|
}
|
||||||
|
|
||||||
|
const containerMock = {
|
||||||
|
baseRepository: baseRepoMock,
|
||||||
|
mainModelMockRepository: baseRepoMock,
|
||||||
|
otherModelMock1Repository: baseRepoMock,
|
||||||
|
otherModelMock2Repository: baseRepoMock,
|
||||||
|
mainModelMockService: {
|
||||||
|
retrieve: jest.fn().mockResolvedValue({ id: "1", name: "Item" }),
|
||||||
|
list: jest.fn().mockResolvedValue([{ id: "1", name: "Item" }]),
|
||||||
|
delete: jest.fn().mockResolvedValue(undefined),
|
||||||
|
softDelete: jest.fn().mockResolvedValue([[], {}]),
|
||||||
|
restore: jest.fn().mockResolvedValue([[], {}]),
|
||||||
|
},
|
||||||
|
otherModelMock1Service: {
|
||||||
|
retrieve: jest.fn().mockResolvedValue({ id: "1", name: "Item" }),
|
||||||
|
list: jest.fn().mockResolvedValue([{ id: "1", name: "Item" }]),
|
||||||
|
delete: jest.fn().mockResolvedValue(undefined),
|
||||||
|
softDelete: jest.fn().mockResolvedValue([[], {}]),
|
||||||
|
restore: jest.fn().mockResolvedValue([[], {}]),
|
||||||
|
},
|
||||||
|
otherModelMock2Service: {
|
||||||
|
retrieve: jest.fn().mockResolvedValue({ id: "1", name: "Item" }),
|
||||||
|
list: jest.fn().mockResolvedValue([{ id: "1", name: "Item" }]),
|
||||||
|
delete: jest.fn().mockResolvedValue(undefined),
|
||||||
|
softDelete: jest.fn().mockResolvedValue([[], {}]),
|
||||||
|
restore: jest.fn().mockResolvedValue([[], {}]),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
describe("Medusa Service typings", () => {
|
||||||
|
describe("create<Service>", () => {
|
||||||
|
test("type-hint model properties", () => {
|
||||||
|
class BlogService extends MedusaService({ Blog }) {}
|
||||||
|
const blogService = new BlogService(containerMock)
|
||||||
|
|
||||||
|
expectTypeOf(blogService.createBlogs).parameters.toEqualTypeOf<
|
||||||
|
| [
|
||||||
|
Partial<{
|
||||||
|
id: string | undefined
|
||||||
|
title: string | undefined
|
||||||
|
description: string | null | undefined
|
||||||
|
}>,
|
||||||
|
...rest: any[]
|
||||||
|
]
|
||||||
|
| [
|
||||||
|
Partial<{
|
||||||
|
id: string | undefined
|
||||||
|
title: string | undefined
|
||||||
|
description: string | null | undefined
|
||||||
|
}>[],
|
||||||
|
...rest: any[]
|
||||||
|
]
|
||||||
|
>()
|
||||||
|
expectTypeOf(blogService.createBlogs).returns.toEqualTypeOf<
|
||||||
|
Promise<InferTypeOf<typeof Blog>> | Promise<InferTypeOf<typeof Blog>[]>
|
||||||
|
>()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("type-hint DTO properties", () => {
|
||||||
|
class BlogService extends MedusaService<{ Blog: { dto: BlogDTO } }>({
|
||||||
|
Blog,
|
||||||
|
}) {}
|
||||||
|
const blogService = new BlogService(containerMock)
|
||||||
|
|
||||||
|
expectTypeOf(blogService.createBlogs).parameters.toEqualTypeOf<
|
||||||
|
| [Partial<BlogDTO>, ...rest: any[]]
|
||||||
|
| [Partial<BlogDTO>[], ...rest: any[]]
|
||||||
|
>()
|
||||||
|
expectTypeOf(blogService.createBlogs).returns.toEqualTypeOf<
|
||||||
|
Promise<BlogDTO> | Promise<BlogDTO[]>
|
||||||
|
>()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("type-hint force overridden properties", () => {
|
||||||
|
class BlogService extends MedusaService<{ Blog: { dto: BlogDTO } }>({
|
||||||
|
Blog,
|
||||||
|
}) {
|
||||||
|
// @ts-expect-error
|
||||||
|
async createBlogs(_: CreateBlogDTO): Promise<BlogDTO> {
|
||||||
|
return {} as BlogDTO
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const blogService = new BlogService(containerMock)
|
||||||
|
|
||||||
|
expectTypeOf(blogService.createBlogs).parameters.toEqualTypeOf<
|
||||||
|
[CreateBlogDTO]
|
||||||
|
>()
|
||||||
|
expectTypeOf(blogService.createBlogs).returns.toEqualTypeOf<
|
||||||
|
Promise<BlogDTO>
|
||||||
|
>()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("define custom DTO for inputs", () => {
|
||||||
|
class BlogService extends MedusaService<{
|
||||||
|
Blog: { dto: BlogDTO; inputDto: Omit<BlogDTO, "id"> }
|
||||||
|
}>({
|
||||||
|
Blog,
|
||||||
|
}) {}
|
||||||
|
const blogService = new BlogService(containerMock)
|
||||||
|
|
||||||
|
expectTypeOf(blogService.createBlogs).parameters.toEqualTypeOf<
|
||||||
|
| [Partial<{ title: string | undefined }>, ...rest: any[]]
|
||||||
|
| [Partial<{ title: string | undefined }>[], ...rest: any[]]
|
||||||
|
>()
|
||||||
|
expectTypeOf(blogService.createBlogs).returns.toEqualTypeOf<
|
||||||
|
Promise<BlogDTO> | Promise<BlogDTO[]>
|
||||||
|
>()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe("update<Service>", () => {
|
||||||
|
test("type-hint model properties", () => {
|
||||||
|
class BlogService extends MedusaService({ Blog }) {}
|
||||||
|
const blogService = new BlogService(containerMock)
|
||||||
|
|
||||||
|
expectTypeOf(blogService.updateBlogs).parameters.toEqualTypeOf<
|
||||||
|
| [
|
||||||
|
Partial<{
|
||||||
|
id: string | undefined
|
||||||
|
title: string | undefined
|
||||||
|
description: string | null | undefined
|
||||||
|
}>,
|
||||||
|
...rest: any[]
|
||||||
|
]
|
||||||
|
| [
|
||||||
|
(
|
||||||
|
| Partial<{
|
||||||
|
id: string | undefined
|
||||||
|
title: string | undefined
|
||||||
|
description: string | null | undefined
|
||||||
|
}>[]
|
||||||
|
| {
|
||||||
|
selector: Record<string, any>
|
||||||
|
data:
|
||||||
|
| Partial<{
|
||||||
|
id: string | undefined
|
||||||
|
title: string | undefined
|
||||||
|
description: string | null | undefined
|
||||||
|
}>
|
||||||
|
| Partial<{
|
||||||
|
id: string | undefined
|
||||||
|
title: string | undefined
|
||||||
|
description: string | null | undefined
|
||||||
|
}>[]
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
selector: Record<string, any>
|
||||||
|
data:
|
||||||
|
| Partial<{
|
||||||
|
id: string | undefined
|
||||||
|
title: string | undefined
|
||||||
|
description: string | null | undefined
|
||||||
|
}>
|
||||||
|
| Partial<{
|
||||||
|
id: string | undefined
|
||||||
|
title: string | undefined
|
||||||
|
description: string | null | undefined
|
||||||
|
}>[]
|
||||||
|
}[]
|
||||||
|
),
|
||||||
|
...rest: any[]
|
||||||
|
]
|
||||||
|
>()
|
||||||
|
expectTypeOf(blogService.updateBlogs).returns.toEqualTypeOf<
|
||||||
|
Promise<InferTypeOf<typeof Blog>> | Promise<InferTypeOf<typeof Blog>[]>
|
||||||
|
>()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("type-hint DTO properties", () => {
|
||||||
|
class BlogService extends MedusaService<{ Blog: { dto: BlogDTO } }>({
|
||||||
|
Blog,
|
||||||
|
}) {}
|
||||||
|
const blogService = new BlogService(containerMock)
|
||||||
|
|
||||||
|
expectTypeOf(blogService.updateBlogs).parameters.toEqualTypeOf<
|
||||||
|
| [Partial<BlogDTO>, ...rest: any[]]
|
||||||
|
| [
|
||||||
|
(
|
||||||
|
| Partial<BlogDTO>[]
|
||||||
|
| {
|
||||||
|
selector: Record<string, any>
|
||||||
|
data: Partial<BlogDTO> | Partial<BlogDTO>[]
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
selector: Record<string, any>
|
||||||
|
data: Partial<BlogDTO> | Partial<BlogDTO>[]
|
||||||
|
}[]
|
||||||
|
),
|
||||||
|
...rest: any[]
|
||||||
|
]
|
||||||
|
>()
|
||||||
|
expectTypeOf(blogService.updateBlogs).returns.toEqualTypeOf<
|
||||||
|
Promise<BlogDTO> | Promise<BlogDTO[]>
|
||||||
|
>()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("type-hint force overridden properties", () => {
|
||||||
|
class BlogService extends MedusaService<{ Blog: { dto: BlogDTO } }>({
|
||||||
|
Blog,
|
||||||
|
}) {
|
||||||
|
// @ts-expect-error
|
||||||
|
async updateBlogs(_: string, __: CreateBlogDTO): Promise<BlogDTO> {
|
||||||
|
return {} as BlogDTO
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const blogService = new BlogService(containerMock)
|
||||||
|
|
||||||
|
expectTypeOf(blogService.updateBlogs).parameters.toEqualTypeOf<
|
||||||
|
[id: string, data: CreateBlogDTO]
|
||||||
|
>()
|
||||||
|
expectTypeOf(blogService.updateBlogs).returns.toEqualTypeOf<
|
||||||
|
Promise<BlogDTO>
|
||||||
|
>()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("define custom DTO for inputs", () => {
|
||||||
|
class BlogService extends MedusaService<{
|
||||||
|
Blog: { dto: BlogDTO; inputDto: Omit<BlogDTO, "id"> }
|
||||||
|
}>({
|
||||||
|
Blog,
|
||||||
|
}) {}
|
||||||
|
const blogService = new BlogService(containerMock)
|
||||||
|
|
||||||
|
expectTypeOf(blogService.updateBlogs).parameters.toEqualTypeOf<
|
||||||
|
| [Partial<{ title: string | undefined }>, ...rest: any[]]
|
||||||
|
| [
|
||||||
|
(
|
||||||
|
| Partial<{ title: string | undefined }>[]
|
||||||
|
| {
|
||||||
|
selector: Record<string, any>
|
||||||
|
data:
|
||||||
|
| Partial<{ title: string | undefined }>
|
||||||
|
| Partial<{ title: string | undefined }>[]
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
selector: Record<string, any>
|
||||||
|
data:
|
||||||
|
| Partial<{ title: string | undefined }>
|
||||||
|
| Partial<{ title: string | undefined }>[]
|
||||||
|
}[]
|
||||||
|
),
|
||||||
|
...rest: any[]
|
||||||
|
]
|
||||||
|
>()
|
||||||
|
expectTypeOf(blogService.createBlogs).returns.toEqualTypeOf<
|
||||||
|
Promise<BlogDTO> | Promise<BlogDTO[]>
|
||||||
|
>()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
IDmlEntity,
|
IDmlEntity,
|
||||||
InferEntityType,
|
InferEntityType,
|
||||||
Pluralize,
|
Pluralize,
|
||||||
|
Prettify,
|
||||||
RestoreReturn,
|
RestoreReturn,
|
||||||
SoftDeleteReturn,
|
SoftDeleteReturn,
|
||||||
} from "@medusajs/types"
|
} from "@medusajs/types"
|
||||||
@@ -29,6 +30,13 @@ export type ModelDTOConfig = {
|
|||||||
|
|
||||||
export type ModelsConfigTemplate = { [key: string]: ModelDTOConfig }
|
export type ModelsConfigTemplate = { [key: string]: ModelDTOConfig }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We do not want the DML DTO to accept auto-managed timestamps
|
||||||
|
* as part of the input for the "create" and the "update"
|
||||||
|
* methods
|
||||||
|
*/
|
||||||
|
type DMLDTOExcludeProperties = "created_at" | "updated_at" | "deleted_at"
|
||||||
|
|
||||||
export type ModelConfigurationsToConfigTemplate<T extends ModelEntries> = {
|
export type ModelConfigurationsToConfigTemplate<T extends ModelEntries> = {
|
||||||
[Key in keyof T]: {
|
[Key in keyof T]: {
|
||||||
dto: T[Key] extends DmlEntity<any, any>
|
dto: T[Key] extends DmlEntity<any, any>
|
||||||
@@ -36,6 +44,11 @@ export type ModelConfigurationsToConfigTemplate<T extends ModelEntries> = {
|
|||||||
: T[Key] extends Constructor<any>
|
: T[Key] extends Constructor<any>
|
||||||
? InstanceType<T[Key]>
|
? InstanceType<T[Key]>
|
||||||
: any
|
: any
|
||||||
|
inputDto: T[Key] extends DmlEntity<any, any>
|
||||||
|
? Omit<InferEntityType<T[Key]>, DMLDTOExcludeProperties>
|
||||||
|
: T[Key] extends Constructor<any>
|
||||||
|
? InstanceType<T[Key]>
|
||||||
|
: any
|
||||||
model: T[Key] extends { model: infer MODEL }
|
model: T[Key] extends { model: infer MODEL }
|
||||||
? MODEL
|
? MODEL
|
||||||
: T[Key] extends IDmlEntity<any, any>
|
: T[Key] extends IDmlEntity<any, any>
|
||||||
@@ -83,6 +96,16 @@ export type ModelEntries<Keys = string> = Record<
|
|||||||
| { name?: string; singular?: string; plural?: string }
|
| { name?: string; singular?: string; plural?: string }
|
||||||
>
|
>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the input DTO for the servide
|
||||||
|
*/
|
||||||
|
type GetServiceInput<ModelConfig extends { dto: any; inputDto?: any }> =
|
||||||
|
Partial<
|
||||||
|
[undefined] extends ModelConfig["inputDto"]
|
||||||
|
? ModelConfig["dto"]
|
||||||
|
: ModelConfig["inputDto"]
|
||||||
|
>
|
||||||
|
|
||||||
export type ExtractKeysFromConfig<ModelsConfig> = ModelsConfig extends {
|
export type ExtractKeysFromConfig<ModelsConfig> = ModelsConfig extends {
|
||||||
__empty: any
|
__empty: any
|
||||||
}
|
}
|
||||||
@@ -90,7 +113,7 @@ export type ExtractKeysFromConfig<ModelsConfig> = ModelsConfig extends {
|
|||||||
: keyof ModelsConfig
|
: keyof ModelsConfig
|
||||||
|
|
||||||
export type AbstractModuleService<
|
export type AbstractModuleService<
|
||||||
TModelsDtoConfig extends Record<string, any>
|
TModelsDtoConfig extends Record<string, { dto: any; inputDto?: any }>
|
||||||
> = {
|
> = {
|
||||||
[TModelName in keyof TModelsDtoConfig as `retrieve${ExtractSingularName<
|
[TModelName in keyof TModelsDtoConfig as `retrieve${ExtractSingularName<
|
||||||
TModelsDtoConfig,
|
TModelsDtoConfig,
|
||||||
@@ -155,14 +178,41 @@ export type AbstractModuleService<
|
|||||||
TModelsDtoConfig,
|
TModelsDtoConfig,
|
||||||
TModelName
|
TModelName
|
||||||
>}`]: {
|
>}`]: {
|
||||||
(...args: any[]): Promise<any>
|
(
|
||||||
|
data: Prettify<GetServiceInput<TModelsDtoConfig[TModelName]>>,
|
||||||
|
...rest: any[]
|
||||||
|
): Promise<TModelsDtoConfig[TModelName]["dto"]>
|
||||||
|
(
|
||||||
|
data: Prettify<GetServiceInput<TModelsDtoConfig[TModelName]>>[],
|
||||||
|
...rest: any[]
|
||||||
|
): Promise<TModelsDtoConfig[TModelName]["dto"][]>
|
||||||
}
|
}
|
||||||
} & {
|
} & {
|
||||||
[TModelName in keyof TModelsDtoConfig as `update${ExtractPluralName<
|
[TModelName in keyof TModelsDtoConfig as `update${ExtractPluralName<
|
||||||
TModelsDtoConfig,
|
TModelsDtoConfig,
|
||||||
TModelName
|
TModelName
|
||||||
>}`]: {
|
>}`]: {
|
||||||
(...args: any[]): Promise<any>
|
(
|
||||||
|
data: Prettify<GetServiceInput<TModelsDtoConfig[TModelName]>>,
|
||||||
|
...rest: any[]
|
||||||
|
): Promise<TModelsDtoConfig[TModelName]["dto"]>
|
||||||
|
(
|
||||||
|
dataOrOptions:
|
||||||
|
| Prettify<GetServiceInput<TModelsDtoConfig[TModelName]>>[]
|
||||||
|
| {
|
||||||
|
selector: Record<string, any>
|
||||||
|
data:
|
||||||
|
| Prettify<GetServiceInput<TModelsDtoConfig[TModelName]>>
|
||||||
|
| Prettify<GetServiceInput<TModelsDtoConfig[TModelName]>>[]
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
selector: Record<string, any>
|
||||||
|
data:
|
||||||
|
| Prettify<GetServiceInput<TModelsDtoConfig[TModelName]>>
|
||||||
|
| Prettify<GetServiceInput<TModelsDtoConfig[TModelName]>>[]
|
||||||
|
}[],
|
||||||
|
...rest: any[]
|
||||||
|
): Promise<TModelsDtoConfig[TModelName]["dto"][]>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ const eventBaseNames: [
|
|||||||
"product",
|
"product",
|
||||||
"productVariant",
|
"productVariant",
|
||||||
"productOption",
|
"productOption",
|
||||||
|
"productOptionValue",
|
||||||
"productType",
|
"productType",
|
||||||
"productTag",
|
"productTag",
|
||||||
"productCategory",
|
"productCategory",
|
||||||
@@ -13,10 +14,11 @@ const eventBaseNames: [
|
|||||||
"product",
|
"product",
|
||||||
"productVariant",
|
"productVariant",
|
||||||
"productOption",
|
"productOption",
|
||||||
|
"productOptionValue",
|
||||||
"productType",
|
"productType",
|
||||||
"productTag",
|
"productTag",
|
||||||
"productCategory",
|
"productCategory",
|
||||||
"productCollection"
|
"productCollection",
|
||||||
]
|
]
|
||||||
|
|
||||||
export const ProductEvents = buildEventNamesFromEntityName(
|
export const ProductEvents = buildEventNamesFromEntityName(
|
||||||
|
|||||||
@@ -104,12 +104,14 @@ export class ApiKeyModuleService
|
|||||||
data: ApiKeyTypes.CreateApiKeyDTO[],
|
data: ApiKeyTypes.CreateApiKeyDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ApiKeyTypes.ApiKeyDTO[]>
|
): Promise<ApiKeyTypes.ApiKeyDTO[]>
|
||||||
|
//@ts-expect-error
|
||||||
createApiKeys(
|
createApiKeys(
|
||||||
data: ApiKeyTypes.CreateApiKeyDTO,
|
data: ApiKeyTypes.CreateApiKeyDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ApiKeyTypes.ApiKeyDTO>
|
): Promise<ApiKeyTypes.ApiKeyDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
//@ts-expect-error
|
||||||
async createApiKeys(
|
async createApiKeys(
|
||||||
data: ApiKeyTypes.CreateApiKeyDTO | ApiKeyTypes.CreateApiKeyDTO[],
|
data: ApiKeyTypes.CreateApiKeyDTO | ApiKeyTypes.CreateApiKeyDTO[],
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -243,6 +245,7 @@ export class ApiKeyModuleService
|
|||||||
data: ApiKeyTypes.UpdateApiKeyDTO,
|
data: ApiKeyTypes.UpdateApiKeyDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ApiKeyTypes.ApiKeyDTO>
|
): Promise<ApiKeyTypes.ApiKeyDTO>
|
||||||
|
//@ts-expect-error
|
||||||
async updateApiKeys(
|
async updateApiKeys(
|
||||||
selector: FilterableApiKeyProps,
|
selector: FilterableApiKeyProps,
|
||||||
data: ApiKeyTypes.UpdateApiKeyDTO,
|
data: ApiKeyTypes.UpdateApiKeyDTO,
|
||||||
@@ -250,6 +253,7 @@ export class ApiKeyModuleService
|
|||||||
): Promise<ApiKeyTypes.ApiKeyDTO[]>
|
): Promise<ApiKeyTypes.ApiKeyDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
//@ts-expect-error
|
||||||
async updateApiKeys(
|
async updateApiKeys(
|
||||||
idOrSelector: string | FilterableApiKeyProps,
|
idOrSelector: string | FilterableApiKeyProps,
|
||||||
data: ApiKeyTypes.UpdateApiKeyDTO,
|
data: ApiKeyTypes.UpdateApiKeyDTO,
|
||||||
|
|||||||
@@ -106,12 +106,14 @@ export default class AuthModuleService
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<AuthTypes.AuthIdentityDTO[]>
|
): Promise<AuthTypes.AuthIdentityDTO[]>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
updateAuthIdentities(
|
updateAuthIdentities(
|
||||||
data: AuthTypes.UpdateAuthIdentityDTO,
|
data: AuthTypes.UpdateAuthIdentityDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<AuthTypes.AuthIdentityDTO>
|
): Promise<AuthTypes.AuthIdentityDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateAuthIdentities(
|
async updateAuthIdentities(
|
||||||
data: AuthTypes.UpdateAuthIdentityDTO | AuthTypes.UpdateAuthIdentityDTO[],
|
data: AuthTypes.UpdateAuthIdentityDTO | AuthTypes.UpdateAuthIdentityDTO[],
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -151,12 +153,14 @@ export default class AuthModuleService
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<AuthTypes.ProviderIdentityDTO[]>
|
): Promise<AuthTypes.ProviderIdentityDTO[]>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
createProviderIdentities(
|
createProviderIdentities(
|
||||||
data: AuthTypes.CreateProviderIdentityDTO,
|
data: AuthTypes.CreateProviderIdentityDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<AuthTypes.ProviderIdentityDTO>
|
): Promise<AuthTypes.ProviderIdentityDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createProviderIdentities(
|
async createProviderIdentities(
|
||||||
data:
|
data:
|
||||||
| AuthTypes.CreateProviderIdentityDTO[]
|
| AuthTypes.CreateProviderIdentityDTO[]
|
||||||
@@ -179,12 +183,14 @@ export default class AuthModuleService
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<AuthTypes.ProviderIdentityDTO[]>
|
): Promise<AuthTypes.ProviderIdentityDTO[]>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
updateProviderIdentities(
|
updateProviderIdentities(
|
||||||
data: AuthTypes.UpdateProviderIdentityDTO,
|
data: AuthTypes.UpdateProviderIdentityDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<AuthTypes.ProviderIdentityDTO>
|
): Promise<AuthTypes.ProviderIdentityDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateProviderIdentities(
|
async updateProviderIdentities(
|
||||||
data:
|
data:
|
||||||
| AuthTypes.UpdateProviderIdentityDTO
|
| AuthTypes.UpdateProviderIdentityDTO
|
||||||
|
|||||||
@@ -258,12 +258,14 @@ export default class CartModuleService
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CartTypes.CartDTO[]>
|
): Promise<CartTypes.CartDTO[]>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
async createCarts(
|
async createCarts(
|
||||||
data: CartTypes.CreateCartDTO,
|
data: CartTypes.CreateCartDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CartTypes.CartDTO>
|
): Promise<CartTypes.CartDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createCarts(
|
async createCarts(
|
||||||
data: CartTypes.CreateCartDTO[] | CartTypes.CreateCartDTO,
|
data: CartTypes.CreateCartDTO[] | CartTypes.CreateCartDTO,
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -320,11 +322,13 @@ export default class CartModuleService
|
|||||||
async updateCarts(
|
async updateCarts(
|
||||||
data: CartTypes.UpdateCartDTO[]
|
data: CartTypes.UpdateCartDTO[]
|
||||||
): Promise<CartTypes.CartDTO[]>
|
): Promise<CartTypes.CartDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async updateCarts(
|
async updateCarts(
|
||||||
cartId: string,
|
cartId: string,
|
||||||
data: CartTypes.UpdateCartDataDTO,
|
data: CartTypes.UpdateCartDataDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CartTypes.CartDTO>
|
): Promise<CartTypes.CartDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async updateCarts(
|
async updateCarts(
|
||||||
selector: Partial<CartTypes.CartDTO>,
|
selector: Partial<CartTypes.CartDTO>,
|
||||||
data: CartTypes.UpdateCartDataDTO,
|
data: CartTypes.UpdateCartDataDTO,
|
||||||
@@ -332,6 +336,7 @@ export default class CartModuleService
|
|||||||
): Promise<CartTypes.CartDTO[]>
|
): Promise<CartTypes.CartDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateCarts(
|
async updateCarts(
|
||||||
dataOrIdOrSelector:
|
dataOrIdOrSelector:
|
||||||
| CartTypes.UpdateCartDTO[]
|
| CartTypes.UpdateCartDTO[]
|
||||||
@@ -393,6 +398,18 @@ export default class CartModuleService
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
|
async updateShippingMethods(
|
||||||
|
data: CartTypes.UpdateShippingMethodDTO[],
|
||||||
|
sharedContext?: Context
|
||||||
|
): Promise<CartTypes.CartShippingMethodDTO[]> {
|
||||||
|
return super.updateShippingMethods(
|
||||||
|
data as unknown as CartTypes.CartShippingMethodDTO[],
|
||||||
|
sharedContext
|
||||||
|
) as unknown as Promise<CartTypes.CartShippingMethodDTO[]>
|
||||||
|
}
|
||||||
|
|
||||||
addLineItems(
|
addLineItems(
|
||||||
data: CartTypes.CreateLineItemForCartDTO
|
data: CartTypes.CreateLineItemForCartDTO
|
||||||
): Promise<CartTypes.CartLineItemDTO[]>
|
): Promise<CartTypes.CartLineItemDTO[]>
|
||||||
@@ -468,11 +485,13 @@ export default class CartModuleService
|
|||||||
updateLineItems(
|
updateLineItems(
|
||||||
data: CartTypes.UpdateLineItemWithSelectorDTO[]
|
data: CartTypes.UpdateLineItemWithSelectorDTO[]
|
||||||
): Promise<CartTypes.CartLineItemDTO[]>
|
): Promise<CartTypes.CartLineItemDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
updateLineItems(
|
updateLineItems(
|
||||||
selector: Partial<CartTypes.CartLineItemDTO>,
|
selector: Partial<CartTypes.CartLineItemDTO>,
|
||||||
data: CartTypes.UpdateLineItemDTO,
|
data: CartTypes.UpdateLineItemDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CartTypes.CartLineItemDTO[]>
|
): Promise<CartTypes.CartLineItemDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
updateLineItems(
|
updateLineItems(
|
||||||
lineItemId: string,
|
lineItemId: string,
|
||||||
data: Partial<CartTypes.UpdateLineItemDTO>,
|
data: Partial<CartTypes.UpdateLineItemDTO>,
|
||||||
@@ -480,6 +499,7 @@ export default class CartModuleService
|
|||||||
): Promise<CartTypes.CartLineItemDTO>
|
): Promise<CartTypes.CartLineItemDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateLineItems(
|
async updateLineItems(
|
||||||
lineItemIdOrDataOrSelector:
|
lineItemIdOrDataOrSelector:
|
||||||
| string
|
| string
|
||||||
@@ -562,12 +582,14 @@ export default class CartModuleService
|
|||||||
data: CartTypes.CreateAddressDTO,
|
data: CartTypes.CreateAddressDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CartTypes.CartAddressDTO>
|
): Promise<CartTypes.CartAddressDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async createAddresses(
|
async createAddresses(
|
||||||
data: CartTypes.CreateAddressDTO[],
|
data: CartTypes.CreateAddressDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CartTypes.CartAddressDTO[]>
|
): Promise<CartTypes.CartAddressDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createAddresses(
|
async createAddresses(
|
||||||
data: CartTypes.CreateAddressDTO[] | CartTypes.CreateAddressDTO,
|
data: CartTypes.CreateAddressDTO[] | CartTypes.CreateAddressDTO,
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -599,12 +621,14 @@ export default class CartModuleService
|
|||||||
data: CartTypes.UpdateAddressDTO,
|
data: CartTypes.UpdateAddressDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CartTypes.CartAddressDTO>
|
): Promise<CartTypes.CartAddressDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async updateAddresses(
|
async updateAddresses(
|
||||||
data: CartTypes.UpdateAddressDTO[],
|
data: CartTypes.UpdateAddressDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CartTypes.CartAddressDTO[]>
|
): Promise<CartTypes.CartAddressDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateAddresses(
|
async updateAddresses(
|
||||||
data: CartTypes.UpdateAddressDTO[] | CartTypes.UpdateAddressDTO,
|
data: CartTypes.UpdateAddressDTO[] | CartTypes.UpdateAddressDTO,
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
|
|||||||
@@ -162,11 +162,13 @@ export default class CustomerModuleService
|
|||||||
data: CustomerTypes.CustomerUpdatableFields,
|
data: CustomerTypes.CustomerUpdatableFields,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CustomerTypes.CustomerDTO>
|
): Promise<CustomerTypes.CustomerDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updateCustomers(
|
updateCustomers(
|
||||||
customerIds: string[],
|
customerIds: string[],
|
||||||
data: CustomerTypes.CustomerUpdatableFields,
|
data: CustomerTypes.CustomerUpdatableFields,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CustomerTypes.CustomerDTO[]>
|
): Promise<CustomerTypes.CustomerDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
updateCustomers(
|
updateCustomers(
|
||||||
selector: CustomerTypes.FilterableCustomerProps,
|
selector: CustomerTypes.FilterableCustomerProps,
|
||||||
data: CustomerTypes.CustomerUpdatableFields,
|
data: CustomerTypes.CustomerUpdatableFields,
|
||||||
@@ -174,6 +176,7 @@ export default class CustomerModuleService
|
|||||||
): Promise<CustomerTypes.CustomerDTO[]>
|
): Promise<CustomerTypes.CustomerDTO[]>
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateCustomers(
|
async updateCustomers(
|
||||||
idsOrSelector: string | string[] | CustomerTypes.FilterableCustomerProps,
|
idsOrSelector: string | string[] | CustomerTypes.FilterableCustomerProps,
|
||||||
data: CustomerTypes.CustomerUpdatableFields,
|
data: CustomerTypes.CustomerUpdatableFields,
|
||||||
@@ -224,12 +227,14 @@ export default class CustomerModuleService
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CustomerTypes.CustomerGroupDTO>
|
): Promise<CustomerTypes.CustomerGroupDTO>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
async createCustomerGroups(
|
async createCustomerGroups(
|
||||||
dataOrArrayOfData: CustomerTypes.CreateCustomerGroupDTO[],
|
dataOrArrayOfData: CustomerTypes.CreateCustomerGroupDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CustomerTypes.CustomerGroupDTO[]>
|
): Promise<CustomerTypes.CustomerGroupDTO[]>
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createCustomerGroups(
|
async createCustomerGroups(
|
||||||
dataOrArrayOfData:
|
dataOrArrayOfData:
|
||||||
| CustomerTypes.CreateCustomerGroupDTO
|
| CustomerTypes.CreateCustomerGroupDTO
|
||||||
@@ -254,11 +259,13 @@ export default class CustomerModuleService
|
|||||||
data: CustomerTypes.CustomerGroupUpdatableFields,
|
data: CustomerTypes.CustomerGroupUpdatableFields,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CustomerTypes.CustomerGroupDTO>
|
): Promise<CustomerTypes.CustomerGroupDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async updateCustomerGroups(
|
async updateCustomerGroups(
|
||||||
groupIds: string[],
|
groupIds: string[],
|
||||||
data: CustomerTypes.CustomerGroupUpdatableFields,
|
data: CustomerTypes.CustomerGroupUpdatableFields,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CustomerTypes.CustomerGroupDTO[]>
|
): Promise<CustomerTypes.CustomerGroupDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async updateCustomerGroups(
|
async updateCustomerGroups(
|
||||||
selector: CustomerTypes.FilterableCustomerGroupProps,
|
selector: CustomerTypes.FilterableCustomerGroupProps,
|
||||||
data: CustomerTypes.CustomerGroupUpdatableFields,
|
data: CustomerTypes.CustomerGroupUpdatableFields,
|
||||||
@@ -266,6 +273,7 @@ export default class CustomerModuleService
|
|||||||
): Promise<CustomerTypes.CustomerGroupDTO[]>
|
): Promise<CustomerTypes.CustomerGroupDTO[]>
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateCustomerGroups(
|
async updateCustomerGroups(
|
||||||
groupIdOrSelector:
|
groupIdOrSelector:
|
||||||
| string
|
| string
|
||||||
@@ -350,12 +358,14 @@ export default class CustomerModuleService
|
|||||||
addresses: CustomerTypes.CreateCustomerAddressDTO[],
|
addresses: CustomerTypes.CreateCustomerAddressDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CustomerTypes.CustomerAddressDTO[]>
|
): Promise<CustomerTypes.CustomerAddressDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async createCustomerAddresses(
|
async createCustomerAddresses(
|
||||||
address: CustomerTypes.CreateCustomerAddressDTO,
|
address: CustomerTypes.CreateCustomerAddressDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CustomerTypes.CustomerAddressDTO>
|
): Promise<CustomerTypes.CustomerAddressDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createCustomerAddresses(
|
async createCustomerAddresses(
|
||||||
data:
|
data:
|
||||||
| CustomerTypes.CreateCustomerAddressDTO
|
| CustomerTypes.CreateCustomerAddressDTO
|
||||||
@@ -396,11 +406,13 @@ export default class CustomerModuleService
|
|||||||
data: CustomerTypes.UpdateCustomerAddressDTO,
|
data: CustomerTypes.UpdateCustomerAddressDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CustomerTypes.CustomerAddressDTO>
|
): Promise<CustomerTypes.CustomerAddressDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async updateCustomerAddresses(
|
async updateCustomerAddresses(
|
||||||
addressIds: string[],
|
addressIds: string[],
|
||||||
data: CustomerTypes.UpdateCustomerAddressDTO,
|
data: CustomerTypes.UpdateCustomerAddressDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<CustomerTypes.CustomerAddressDTO[]>
|
): Promise<CustomerTypes.CustomerAddressDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async updateCustomerAddresses(
|
async updateCustomerAddresses(
|
||||||
selector: CustomerTypes.FilterableCustomerAddressProps,
|
selector: CustomerTypes.FilterableCustomerAddressProps,
|
||||||
data: CustomerTypes.UpdateCustomerAddressDTO,
|
data: CustomerTypes.UpdateCustomerAddressDTO,
|
||||||
@@ -408,6 +420,7 @@ export default class CustomerModuleService
|
|||||||
): Promise<CustomerTypes.CustomerAddressDTO[]>
|
): Promise<CustomerTypes.CustomerAddressDTO[]>
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateCustomerAddresses(
|
async updateCustomerAddresses(
|
||||||
addressIdOrSelector:
|
addressIdOrSelector:
|
||||||
| string
|
| string
|
||||||
|
|||||||
@@ -279,6 +279,7 @@ export default class FulfillmentModuleService
|
|||||||
data: FulfillmentTypes.CreateFulfillmentSetDTO[],
|
data: FulfillmentTypes.CreateFulfillmentSetDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<FulfillmentTypes.FulfillmentSetDTO[]>
|
): Promise<FulfillmentTypes.FulfillmentSetDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createFulfillmentSets(
|
createFulfillmentSets(
|
||||||
data: FulfillmentTypes.CreateFulfillmentSetDTO,
|
data: FulfillmentTypes.CreateFulfillmentSetDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -286,6 +287,7 @@ export default class FulfillmentModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createFulfillmentSets(
|
async createFulfillmentSets(
|
||||||
data:
|
data:
|
||||||
| FulfillmentTypes.CreateFulfillmentSetDTO
|
| FulfillmentTypes.CreateFulfillmentSetDTO
|
||||||
@@ -349,6 +351,7 @@ export default class FulfillmentModuleService
|
|||||||
data: FulfillmentTypes.CreateServiceZoneDTO[],
|
data: FulfillmentTypes.CreateServiceZoneDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<FulfillmentTypes.ServiceZoneDTO[]>
|
): Promise<FulfillmentTypes.ServiceZoneDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createServiceZones(
|
createServiceZones(
|
||||||
data: FulfillmentTypes.CreateServiceZoneDTO,
|
data: FulfillmentTypes.CreateServiceZoneDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -356,6 +359,7 @@ export default class FulfillmentModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createServiceZones(
|
async createServiceZones(
|
||||||
data:
|
data:
|
||||||
| FulfillmentTypes.CreateServiceZoneDTO[]
|
| FulfillmentTypes.CreateServiceZoneDTO[]
|
||||||
@@ -413,6 +417,7 @@ export default class FulfillmentModuleService
|
|||||||
data: FulfillmentTypes.CreateShippingOptionDTO[],
|
data: FulfillmentTypes.CreateShippingOptionDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<FulfillmentTypes.ShippingOptionDTO[]>
|
): Promise<FulfillmentTypes.ShippingOptionDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createShippingOptions(
|
createShippingOptions(
|
||||||
data: FulfillmentTypes.CreateShippingOptionDTO,
|
data: FulfillmentTypes.CreateShippingOptionDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -420,6 +425,7 @@ export default class FulfillmentModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createShippingOptions(
|
async createShippingOptions(
|
||||||
data:
|
data:
|
||||||
| FulfillmentTypes.CreateShippingOptionDTO[]
|
| FulfillmentTypes.CreateShippingOptionDTO[]
|
||||||
@@ -474,6 +480,7 @@ export default class FulfillmentModuleService
|
|||||||
data: FulfillmentTypes.CreateShippingProfileDTO[],
|
data: FulfillmentTypes.CreateShippingProfileDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<FulfillmentTypes.ShippingProfileDTO[]>
|
): Promise<FulfillmentTypes.ShippingProfileDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createShippingProfiles(
|
createShippingProfiles(
|
||||||
data: FulfillmentTypes.CreateShippingProfileDTO,
|
data: FulfillmentTypes.CreateShippingProfileDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -481,6 +488,7 @@ export default class FulfillmentModuleService
|
|||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createShippingProfiles(
|
async createShippingProfiles(
|
||||||
data:
|
data:
|
||||||
| FulfillmentTypes.CreateShippingProfileDTO[]
|
| FulfillmentTypes.CreateShippingProfileDTO[]
|
||||||
@@ -523,11 +531,12 @@ export default class FulfillmentModuleService
|
|||||||
return await this.shippingProfileService_.create(data_, sharedContext)
|
return await this.shippingProfileService_.create(data_, sharedContext)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
createGeoZones(
|
createGeoZones(
|
||||||
data: FulfillmentTypes.CreateGeoZoneDTO[],
|
data: FulfillmentTypes.CreateGeoZoneDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<FulfillmentTypes.GeoZoneDTO[]>
|
): Promise<FulfillmentTypes.GeoZoneDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createGeoZones(
|
createGeoZones(
|
||||||
data: FulfillmentTypes.CreateGeoZoneDTO,
|
data: FulfillmentTypes.CreateGeoZoneDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -535,6 +544,7 @@ export default class FulfillmentModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createGeoZones(
|
async createGeoZones(
|
||||||
data:
|
data:
|
||||||
| FulfillmentTypes.CreateGeoZoneDTO
|
| FulfillmentTypes.CreateGeoZoneDTO
|
||||||
@@ -560,11 +570,12 @@ export default class FulfillmentModuleService
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
async createShippingOptionRules(
|
async createShippingOptionRules(
|
||||||
data: FulfillmentTypes.CreateShippingOptionRuleDTO[],
|
data: FulfillmentTypes.CreateShippingOptionRuleDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<FulfillmentTypes.ShippingOptionRuleDTO[]>
|
): Promise<FulfillmentTypes.ShippingOptionRuleDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async createShippingOptionRules(
|
async createShippingOptionRules(
|
||||||
data: FulfillmentTypes.CreateShippingOptionRuleDTO,
|
data: FulfillmentTypes.CreateShippingOptionRuleDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -572,6 +583,7 @@ export default class FulfillmentModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createShippingOptionRules(
|
async createShippingOptionRules(
|
||||||
data:
|
data:
|
||||||
| FulfillmentTypes.CreateShippingOptionRuleDTO[]
|
| FulfillmentTypes.CreateShippingOptionRuleDTO[]
|
||||||
@@ -756,6 +768,7 @@ export default class FulfillmentModuleService
|
|||||||
data: FulfillmentTypes.UpdateFulfillmentSetDTO[],
|
data: FulfillmentTypes.UpdateFulfillmentSetDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<FulfillmentTypes.FulfillmentSetDTO[]>
|
): Promise<FulfillmentTypes.FulfillmentSetDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
updateFulfillmentSets(
|
updateFulfillmentSets(
|
||||||
data: FulfillmentTypes.UpdateFulfillmentSetDTO,
|
data: FulfillmentTypes.UpdateFulfillmentSetDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -763,6 +776,7 @@ export default class FulfillmentModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateFulfillmentSets(
|
async updateFulfillmentSets(
|
||||||
data: UpdateFulfillmentSetDTO[] | UpdateFulfillmentSetDTO,
|
data: UpdateFulfillmentSetDTO[] | UpdateFulfillmentSetDTO,
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -995,6 +1009,7 @@ export default class FulfillmentModuleService
|
|||||||
data: FulfillmentTypes.UpdateServiceZoneDTO,
|
data: FulfillmentTypes.UpdateServiceZoneDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<FulfillmentTypes.ServiceZoneDTO>
|
): Promise<FulfillmentTypes.ServiceZoneDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updateServiceZones(
|
updateServiceZones(
|
||||||
selector: FulfillmentTypes.FilterableServiceZoneProps,
|
selector: FulfillmentTypes.FilterableServiceZoneProps,
|
||||||
data: FulfillmentTypes.UpdateServiceZoneDTO,
|
data: FulfillmentTypes.UpdateServiceZoneDTO,
|
||||||
@@ -1003,6 +1018,7 @@ export default class FulfillmentModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateServiceZones(
|
async updateServiceZones(
|
||||||
idOrSelector: string | FulfillmentTypes.FilterableServiceZoneProps,
|
idOrSelector: string | FulfillmentTypes.FilterableServiceZoneProps,
|
||||||
data: FulfillmentTypes.UpdateServiceZoneDTO,
|
data: FulfillmentTypes.UpdateServiceZoneDTO,
|
||||||
@@ -1299,6 +1315,7 @@ export default class FulfillmentModuleService
|
|||||||
data: FulfillmentTypes.UpdateShippingOptionDTO,
|
data: FulfillmentTypes.UpdateShippingOptionDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<FulfillmentTypes.ShippingOptionDTO>
|
): Promise<FulfillmentTypes.ShippingOptionDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updateShippingOptions(
|
updateShippingOptions(
|
||||||
selector: FulfillmentTypes.FilterableShippingOptionProps,
|
selector: FulfillmentTypes.FilterableShippingOptionProps,
|
||||||
data: FulfillmentTypes.UpdateShippingOptionDTO,
|
data: FulfillmentTypes.UpdateShippingOptionDTO,
|
||||||
@@ -1307,6 +1324,7 @@ export default class FulfillmentModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateShippingOptions(
|
async updateShippingOptions(
|
||||||
idOrSelector: string | FulfillmentTypes.FilterableShippingOptionProps,
|
idOrSelector: string | FulfillmentTypes.FilterableShippingOptionProps,
|
||||||
data: FulfillmentTypes.UpdateShippingOptionDTO,
|
data: FulfillmentTypes.UpdateShippingOptionDTO,
|
||||||
@@ -1624,12 +1642,13 @@ export default class FulfillmentModuleService
|
|||||||
return [...created, ...updated]
|
return [...created, ...updated]
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
updateShippingProfiles(
|
updateShippingProfiles(
|
||||||
selector: FulfillmentTypes.FilterableShippingProfileProps,
|
selector: FulfillmentTypes.FilterableShippingProfileProps,
|
||||||
data: FulfillmentTypes.UpdateShippingProfileDTO,
|
data: FulfillmentTypes.UpdateShippingProfileDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<FulfillmentTypes.ShippingProfileDTO[]>
|
): Promise<FulfillmentTypes.ShippingProfileDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
updateShippingProfiles(
|
updateShippingProfiles(
|
||||||
id: string,
|
id: string,
|
||||||
data: FulfillmentTypes.UpdateShippingProfileDTO,
|
data: FulfillmentTypes.UpdateShippingProfileDTO,
|
||||||
@@ -1637,6 +1656,7 @@ export default class FulfillmentModuleService
|
|||||||
): Promise<FulfillmentTypes.ShippingProfileDTO>
|
): Promise<FulfillmentTypes.ShippingProfileDTO>
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateShippingProfiles(
|
async updateShippingProfiles(
|
||||||
idOrSelector: string | FulfillmentTypes.FilterableShippingProfileProps,
|
idOrSelector: string | FulfillmentTypes.FilterableShippingProfileProps,
|
||||||
data: FulfillmentTypes.UpdateShippingProfileDTO,
|
data: FulfillmentTypes.UpdateShippingProfileDTO,
|
||||||
@@ -1728,11 +1748,12 @@ export default class FulfillmentModuleService
|
|||||||
return Array.isArray(data) ? allProfiles : allProfiles[0]
|
return Array.isArray(data) ? allProfiles : allProfiles[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
updateGeoZones(
|
updateGeoZones(
|
||||||
data: FulfillmentTypes.UpdateGeoZoneDTO[],
|
data: FulfillmentTypes.UpdateGeoZoneDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<FulfillmentTypes.GeoZoneDTO[]>
|
): Promise<FulfillmentTypes.GeoZoneDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
updateGeoZones(
|
updateGeoZones(
|
||||||
data: FulfillmentTypes.UpdateGeoZoneDTO,
|
data: FulfillmentTypes.UpdateGeoZoneDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -1740,6 +1761,7 @@ export default class FulfillmentModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateGeoZones(
|
async updateGeoZones(
|
||||||
data:
|
data:
|
||||||
| FulfillmentTypes.UpdateGeoZoneDTO
|
| FulfillmentTypes.UpdateGeoZoneDTO
|
||||||
@@ -1771,11 +1793,12 @@ export default class FulfillmentModuleService
|
|||||||
return Array.isArray(data) ? serialized : serialized[0]
|
return Array.isArray(data) ? serialized : serialized[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
updateShippingOptionRules(
|
updateShippingOptionRules(
|
||||||
data: FulfillmentTypes.UpdateShippingOptionRuleDTO[],
|
data: FulfillmentTypes.UpdateShippingOptionRuleDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<FulfillmentTypes.ShippingOptionRuleDTO[]>
|
): Promise<FulfillmentTypes.ShippingOptionRuleDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
updateShippingOptionRules(
|
updateShippingOptionRules(
|
||||||
data: FulfillmentTypes.UpdateShippingOptionRuleDTO,
|
data: FulfillmentTypes.UpdateShippingOptionRuleDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -1783,6 +1806,7 @@ export default class FulfillmentModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateShippingOptionRules(
|
async updateShippingOptionRules(
|
||||||
data:
|
data:
|
||||||
| FulfillmentTypes.UpdateShippingOptionRuleDTO[]
|
| FulfillmentTypes.UpdateShippingOptionRuleDTO[]
|
||||||
|
|||||||
@@ -222,11 +222,12 @@ export default class InventoryModuleService
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
async createReservationItems(
|
async createReservationItems(
|
||||||
input: InventoryTypes.CreateReservationItemInput[],
|
input: InventoryTypes.CreateReservationItemInput[],
|
||||||
context?: Context
|
context?: Context
|
||||||
): Promise<InventoryTypes.ReservationItemDTO[]>
|
): Promise<InventoryTypes.ReservationItemDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async createReservationItems(
|
async createReservationItems(
|
||||||
input: InventoryTypes.CreateReservationItemInput,
|
input: InventoryTypes.CreateReservationItemInput,
|
||||||
context?: Context
|
context?: Context
|
||||||
@@ -234,6 +235,7 @@ export default class InventoryModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createReservationItems(
|
async createReservationItems(
|
||||||
input:
|
input:
|
||||||
| InventoryTypes.CreateReservationItemInput[]
|
| InventoryTypes.CreateReservationItemInput[]
|
||||||
@@ -380,6 +382,7 @@ export default class InventoryModuleService
|
|||||||
input: InventoryTypes.CreateInventoryLevelInput,
|
input: InventoryTypes.CreateInventoryLevelInput,
|
||||||
context?: Context
|
context?: Context
|
||||||
): Promise<InventoryTypes.InventoryLevelDTO>
|
): Promise<InventoryTypes.InventoryLevelDTO>
|
||||||
|
// @ts-expect-error
|
||||||
createInventoryLevels(
|
createInventoryLevels(
|
||||||
input: InventoryTypes.CreateInventoryLevelInput[],
|
input: InventoryTypes.CreateInventoryLevelInput[],
|
||||||
context?: Context
|
context?: Context
|
||||||
@@ -387,6 +390,7 @@ export default class InventoryModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createInventoryLevels(
|
async createInventoryLevels(
|
||||||
input:
|
input:
|
||||||
| InventoryTypes.CreateInventoryLevelInput[]
|
| InventoryTypes.CreateInventoryLevelInput[]
|
||||||
@@ -434,6 +438,7 @@ export default class InventoryModuleService
|
|||||||
input: InventoryTypes.UpdateInventoryItemInput[],
|
input: InventoryTypes.UpdateInventoryItemInput[],
|
||||||
context?: Context
|
context?: Context
|
||||||
): Promise<InventoryTypes.InventoryItemDTO[]>
|
): Promise<InventoryTypes.InventoryItemDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
updateInventoryItems(
|
updateInventoryItems(
|
||||||
input: InventoryTypes.UpdateInventoryItemInput,
|
input: InventoryTypes.UpdateInventoryItemInput,
|
||||||
context?: Context
|
context?: Context
|
||||||
@@ -441,6 +446,7 @@ export default class InventoryModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateInventoryItems(
|
async updateInventoryItems(
|
||||||
input:
|
input:
|
||||||
| InventoryTypes.UpdateInventoryItemInput
|
| InventoryTypes.UpdateInventoryItemInput
|
||||||
@@ -549,6 +555,7 @@ export default class InventoryModuleService
|
|||||||
updates: InventoryTypes.UpdateInventoryLevelInput[],
|
updates: InventoryTypes.UpdateInventoryLevelInput[],
|
||||||
context?: Context
|
context?: Context
|
||||||
): Promise<InventoryTypes.InventoryLevelDTO[]>
|
): Promise<InventoryTypes.InventoryLevelDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async updateInventoryLevels(
|
async updateInventoryLevels(
|
||||||
updates: InventoryTypes.UpdateInventoryLevelInput,
|
updates: InventoryTypes.UpdateInventoryLevelInput,
|
||||||
context?: Context
|
context?: Context
|
||||||
@@ -556,6 +563,7 @@ export default class InventoryModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateInventoryLevels(
|
async updateInventoryLevels(
|
||||||
updates:
|
updates:
|
||||||
| InventoryTypes.UpdateInventoryLevelInput[]
|
| InventoryTypes.UpdateInventoryLevelInput[]
|
||||||
@@ -628,11 +636,12 @@ export default class InventoryModuleService
|
|||||||
* @param context
|
* @param context
|
||||||
* @return The updated inventory level
|
* @return The updated inventory level
|
||||||
*/
|
*/
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
async updateReservationItems(
|
async updateReservationItems(
|
||||||
input: InventoryTypes.UpdateReservationItemInput[],
|
input: InventoryTypes.UpdateReservationItemInput[],
|
||||||
context?: Context
|
context?: Context
|
||||||
): Promise<InventoryTypes.ReservationItemDTO[]>
|
): Promise<InventoryTypes.ReservationItemDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async updateReservationItems(
|
async updateReservationItems(
|
||||||
input: InventoryTypes.UpdateReservationItemInput,
|
input: InventoryTypes.UpdateReservationItemInput,
|
||||||
context?: Context
|
context?: Context
|
||||||
@@ -640,6 +649,7 @@ export default class InventoryModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateReservationItems(
|
async updateReservationItems(
|
||||||
input:
|
input:
|
||||||
| InventoryTypes.UpdateReservationItemInput
|
| InventoryTypes.UpdateReservationItemInput
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ export default class NotificationModuleService
|
|||||||
data: NotificationTypes.CreateNotificationDTO[],
|
data: NotificationTypes.CreateNotificationDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<NotificationTypes.NotificationDTO[]>
|
): Promise<NotificationTypes.NotificationDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createNotifications(
|
createNotifications(
|
||||||
data: NotificationTypes.CreateNotificationDTO,
|
data: NotificationTypes.CreateNotificationDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -70,6 +71,7 @@ export default class NotificationModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createNotifications(
|
async createNotifications(
|
||||||
data:
|
data:
|
||||||
| NotificationTypes.CreateNotificationDTO
|
| NotificationTypes.CreateNotificationDTO
|
||||||
|
|||||||
@@ -663,13 +663,14 @@ export default class OrderModuleService
|
|||||||
data: OrderTypes.CreateOrderDTO[],
|
data: OrderTypes.CreateOrderDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<OrderTypes.OrderDTO[]>
|
): Promise<OrderTypes.OrderDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async createOrders(
|
async createOrders(
|
||||||
data: OrderTypes.CreateOrderDTO,
|
data: OrderTypes.CreateOrderDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<OrderTypes.OrderDTO>
|
): Promise<OrderTypes.OrderDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createOrders(
|
async createOrders(
|
||||||
data: OrderTypes.CreateOrderDTO[] | OrderTypes.CreateOrderDTO,
|
data: OrderTypes.CreateOrderDTO[] | OrderTypes.CreateOrderDTO,
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -814,11 +815,13 @@ export default class OrderModuleService
|
|||||||
async updateOrders(
|
async updateOrders(
|
||||||
data: OrderTypes.UpdateOrderDTO[]
|
data: OrderTypes.UpdateOrderDTO[]
|
||||||
): Promise<OrderTypes.OrderDTO[]>
|
): Promise<OrderTypes.OrderDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async updateOrders(
|
async updateOrders(
|
||||||
orderId: string,
|
orderId: string,
|
||||||
data: OrderTypes.UpdateOrderDTO,
|
data: OrderTypes.UpdateOrderDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<OrderTypes.OrderDTO>
|
): Promise<OrderTypes.OrderDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async updateOrders(
|
async updateOrders(
|
||||||
selector: Partial<OrderTypes.FilterableOrderProps>,
|
selector: Partial<OrderTypes.FilterableOrderProps>,
|
||||||
data: OrderTypes.UpdateOrderDTO,
|
data: OrderTypes.UpdateOrderDTO,
|
||||||
@@ -826,6 +829,7 @@ export default class OrderModuleService
|
|||||||
): Promise<OrderTypes.OrderDTO[]>
|
): Promise<OrderTypes.OrderDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateOrders(
|
async updateOrders(
|
||||||
dataOrIdOrSelector:
|
dataOrIdOrSelector:
|
||||||
| OrderTypes.UpdateOrderDTO[]
|
| OrderTypes.UpdateOrderDTO[]
|
||||||
@@ -891,9 +895,11 @@ export default class OrderModuleService
|
|||||||
createOrderLineItems(
|
createOrderLineItems(
|
||||||
data: OrderTypes.CreateOrderLineItemForOrderDTO
|
data: OrderTypes.CreateOrderLineItemForOrderDTO
|
||||||
): Promise<OrderTypes.OrderLineItemDTO[]>
|
): Promise<OrderTypes.OrderLineItemDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createOrderLineItems(
|
createOrderLineItems(
|
||||||
data: OrderTypes.CreateOrderLineItemForOrderDTO[]
|
data: OrderTypes.CreateOrderLineItemForOrderDTO[]
|
||||||
): Promise<OrderTypes.OrderLineItemDTO[]>
|
): Promise<OrderTypes.OrderLineItemDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createOrderLineItems(
|
createOrderLineItems(
|
||||||
orderId: string,
|
orderId: string,
|
||||||
items: OrderTypes.CreateOrderLineItemDTO[],
|
items: OrderTypes.CreateOrderLineItemDTO[],
|
||||||
@@ -901,6 +907,7 @@ export default class OrderModuleService
|
|||||||
): Promise<OrderTypes.OrderLineItemDTO[]>
|
): Promise<OrderTypes.OrderLineItemDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderLineItems(
|
async createOrderLineItems(
|
||||||
orderIdOrData:
|
orderIdOrData:
|
||||||
| string
|
| string
|
||||||
@@ -1012,11 +1019,13 @@ export default class OrderModuleService
|
|||||||
updateOrderLineItems(
|
updateOrderLineItems(
|
||||||
data: OrderTypes.UpdateOrderLineItemWithSelectorDTO[]
|
data: OrderTypes.UpdateOrderLineItemWithSelectorDTO[]
|
||||||
): Promise<OrderTypes.OrderLineItemDTO[]>
|
): Promise<OrderTypes.OrderLineItemDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
updateOrderLineItems(
|
updateOrderLineItems(
|
||||||
selector: Partial<OrderTypes.FilterableOrderLineItemProps>,
|
selector: Partial<OrderTypes.FilterableOrderLineItemProps>,
|
||||||
data: OrderTypes.UpdateOrderLineItemDTO,
|
data: OrderTypes.UpdateOrderLineItemDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<OrderTypes.OrderLineItemDTO[]>
|
): Promise<OrderTypes.OrderLineItemDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
updateOrderLineItems(
|
updateOrderLineItems(
|
||||||
lineItemId: string,
|
lineItemId: string,
|
||||||
data: Partial<OrderTypes.UpdateOrderLineItemDTO>,
|
data: Partial<OrderTypes.UpdateOrderLineItemDTO>,
|
||||||
@@ -1024,6 +1033,7 @@ export default class OrderModuleService
|
|||||||
): Promise<OrderTypes.OrderLineItemDTO>
|
): Promise<OrderTypes.OrderLineItemDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateOrderLineItems(
|
async updateOrderLineItems(
|
||||||
lineItemIdOrDataOrSelector:
|
lineItemIdOrDataOrSelector:
|
||||||
| string
|
| string
|
||||||
@@ -1229,13 +1239,15 @@ export default class OrderModuleService
|
|||||||
return await this.orderItemService_.update(toUpdate, sharedContext)
|
return await this.orderItemService_.update(toUpdate, sharedContext)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
async createOrderShippingMethods(
|
async createOrderShippingMethods(
|
||||||
data: OrderTypes.CreateOrderShippingMethodDTO
|
data: OrderTypes.CreateOrderShippingMethodDTO
|
||||||
): Promise<OrderTypes.OrderShippingMethodDTO>
|
): Promise<OrderTypes.OrderShippingMethodDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderShippingMethods(
|
async createOrderShippingMethods(
|
||||||
data: OrderTypes.CreateOrderShippingMethodDTO[]
|
data: OrderTypes.CreateOrderShippingMethodDTO[]
|
||||||
): Promise<OrderTypes.OrderShippingMethodDTO[]>
|
): Promise<OrderTypes.OrderShippingMethodDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderShippingMethods(
|
async createOrderShippingMethods(
|
||||||
orderId: string,
|
orderId: string,
|
||||||
methods: OrderTypes.CreateOrderShippingMethodDTO[],
|
methods: OrderTypes.CreateOrderShippingMethodDTO[],
|
||||||
@@ -1243,6 +1255,7 @@ export default class OrderModuleService
|
|||||||
): Promise<OrderTypes.OrderShippingMethodDTO[]>
|
): Promise<OrderTypes.OrderShippingMethodDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderShippingMethods(
|
async createOrderShippingMethods(
|
||||||
orderIdOrData:
|
orderIdOrData:
|
||||||
| string
|
| string
|
||||||
@@ -1394,9 +1407,11 @@ export default class OrderModuleService
|
|||||||
async createOrderLineItemAdjustments(
|
async createOrderLineItemAdjustments(
|
||||||
adjustments: OrderTypes.CreateOrderLineItemAdjustmentDTO[]
|
adjustments: OrderTypes.CreateOrderLineItemAdjustmentDTO[]
|
||||||
): Promise<OrderTypes.OrderLineItemAdjustmentDTO[]>
|
): Promise<OrderTypes.OrderLineItemAdjustmentDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderLineItemAdjustments(
|
async createOrderLineItemAdjustments(
|
||||||
adjustment: OrderTypes.CreateOrderLineItemAdjustmentDTO
|
adjustment: OrderTypes.CreateOrderLineItemAdjustmentDTO
|
||||||
): Promise<OrderTypes.OrderLineItemAdjustmentDTO[]>
|
): Promise<OrderTypes.OrderLineItemAdjustmentDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderLineItemAdjustments(
|
async createOrderLineItemAdjustments(
|
||||||
orderId: string,
|
orderId: string,
|
||||||
adjustments: OrderTypes.CreateOrderLineItemAdjustmentDTO[],
|
adjustments: OrderTypes.CreateOrderLineItemAdjustmentDTO[],
|
||||||
@@ -1404,6 +1419,7 @@ export default class OrderModuleService
|
|||||||
): Promise<OrderTypes.OrderLineItemAdjustmentDTO[]>
|
): Promise<OrderTypes.OrderLineItemAdjustmentDTO[]>
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderLineItemAdjustments(
|
async createOrderLineItemAdjustments(
|
||||||
orderIdOrData:
|
orderIdOrData:
|
||||||
| string
|
| string
|
||||||
@@ -1564,9 +1580,11 @@ export default class OrderModuleService
|
|||||||
async createOrderShippingMethodAdjustments(
|
async createOrderShippingMethodAdjustments(
|
||||||
adjustments: OrderTypes.CreateOrderShippingMethodAdjustmentDTO[]
|
adjustments: OrderTypes.CreateOrderShippingMethodAdjustmentDTO[]
|
||||||
): Promise<OrderTypes.OrderShippingMethodAdjustmentDTO[]>
|
): Promise<OrderTypes.OrderShippingMethodAdjustmentDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderShippingMethodAdjustments(
|
async createOrderShippingMethodAdjustments(
|
||||||
adjustment: OrderTypes.CreateOrderShippingMethodAdjustmentDTO
|
adjustment: OrderTypes.CreateOrderShippingMethodAdjustmentDTO
|
||||||
): Promise<OrderTypes.OrderShippingMethodAdjustmentDTO>
|
): Promise<OrderTypes.OrderShippingMethodAdjustmentDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderShippingMethodAdjustments(
|
async createOrderShippingMethodAdjustments(
|
||||||
orderId: string,
|
orderId: string,
|
||||||
adjustments: OrderTypes.CreateOrderShippingMethodAdjustmentDTO[],
|
adjustments: OrderTypes.CreateOrderShippingMethodAdjustmentDTO[],
|
||||||
@@ -1574,6 +1592,7 @@ export default class OrderModuleService
|
|||||||
): Promise<OrderTypes.OrderShippingMethodAdjustmentDTO[]>
|
): Promise<OrderTypes.OrderShippingMethodAdjustmentDTO[]>
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderShippingMethodAdjustments(
|
async createOrderShippingMethodAdjustments(
|
||||||
orderIdOrData:
|
orderIdOrData:
|
||||||
| string
|
| string
|
||||||
@@ -1643,9 +1662,11 @@ export default class OrderModuleService
|
|||||||
createOrderLineItemTaxLines(
|
createOrderLineItemTaxLines(
|
||||||
taxLines: OrderTypes.CreateOrderLineItemTaxLineDTO[]
|
taxLines: OrderTypes.CreateOrderLineItemTaxLineDTO[]
|
||||||
): Promise<OrderTypes.OrderLineItemTaxLineDTO[]>
|
): Promise<OrderTypes.OrderLineItemTaxLineDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createOrderLineItemTaxLines(
|
createOrderLineItemTaxLines(
|
||||||
taxLine: OrderTypes.CreateOrderLineItemTaxLineDTO
|
taxLine: OrderTypes.CreateOrderLineItemTaxLineDTO
|
||||||
): Promise<OrderTypes.OrderLineItemTaxLineDTO>
|
): Promise<OrderTypes.OrderLineItemTaxLineDTO>
|
||||||
|
// @ts-expect-error
|
||||||
createOrderLineItemTaxLines(
|
createOrderLineItemTaxLines(
|
||||||
orderId: string,
|
orderId: string,
|
||||||
taxLines:
|
taxLines:
|
||||||
@@ -1655,6 +1676,7 @@ export default class OrderModuleService
|
|||||||
): Promise<OrderTypes.OrderLineItemTaxLineDTO[]>
|
): Promise<OrderTypes.OrderLineItemTaxLineDTO[]>
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderLineItemTaxLines(
|
async createOrderLineItemTaxLines(
|
||||||
orderIdOrData:
|
orderIdOrData:
|
||||||
| string
|
| string
|
||||||
@@ -1754,9 +1776,11 @@ export default class OrderModuleService
|
|||||||
createOrderShippingMethodTaxLines(
|
createOrderShippingMethodTaxLines(
|
||||||
taxLines: OrderTypes.CreateOrderShippingMethodTaxLineDTO[]
|
taxLines: OrderTypes.CreateOrderShippingMethodTaxLineDTO[]
|
||||||
): Promise<OrderTypes.OrderShippingMethodTaxLineDTO[]>
|
): Promise<OrderTypes.OrderShippingMethodTaxLineDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createOrderShippingMethodTaxLines(
|
createOrderShippingMethodTaxLines(
|
||||||
taxLine: OrderTypes.CreateOrderShippingMethodTaxLineDTO
|
taxLine: OrderTypes.CreateOrderShippingMethodTaxLineDTO
|
||||||
): Promise<OrderTypes.OrderShippingMethodTaxLineDTO>
|
): Promise<OrderTypes.OrderShippingMethodTaxLineDTO>
|
||||||
|
// @ts-expect-error
|
||||||
createOrderShippingMethodTaxLines(
|
createOrderShippingMethodTaxLines(
|
||||||
orderId: string,
|
orderId: string,
|
||||||
taxLines:
|
taxLines:
|
||||||
@@ -1766,6 +1790,7 @@ export default class OrderModuleService
|
|||||||
): Promise<OrderTypes.OrderShippingMethodTaxLineDTO[]>
|
): Promise<OrderTypes.OrderShippingMethodTaxLineDTO[]>
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderShippingMethodTaxLines(
|
async createOrderShippingMethodTaxLines(
|
||||||
orderIdOrData:
|
orderIdOrData:
|
||||||
| string
|
| string
|
||||||
@@ -1870,12 +1895,14 @@ export default class OrderModuleService
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<OrderTypes.ReturnDTO>
|
): Promise<OrderTypes.ReturnDTO>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
async createReturns(
|
async createReturns(
|
||||||
data: OrderTypes.CreateOrderReturnDTO[],
|
data: OrderTypes.CreateOrderReturnDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<OrderTypes.ReturnDTO[]>
|
): Promise<OrderTypes.ReturnDTO[]>
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createReturns(
|
async createReturns(
|
||||||
data: OrderTypes.CreateOrderReturnDTO | OrderTypes.CreateOrderReturnDTO[],
|
data: OrderTypes.CreateOrderReturnDTO | OrderTypes.CreateOrderReturnDTO[],
|
||||||
@MedusaContext() sharedContext?: Context
|
@MedusaContext() sharedContext?: Context
|
||||||
@@ -1900,12 +1927,14 @@ export default class OrderModuleService
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<OrderTypes.OrderClaimDTO>
|
): Promise<OrderTypes.OrderClaimDTO>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderClaims(
|
async createOrderClaims(
|
||||||
data: OrderTypes.CreateOrderClaimDTO[],
|
data: OrderTypes.CreateOrderClaimDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<OrderTypes.OrderClaimDTO[]>
|
): Promise<OrderTypes.OrderClaimDTO[]>
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderClaims(
|
async createOrderClaims(
|
||||||
data: OrderTypes.CreateOrderClaimDTO | OrderTypes.CreateOrderClaimDTO[],
|
data: OrderTypes.CreateOrderClaimDTO | OrderTypes.CreateOrderClaimDTO[],
|
||||||
@MedusaContext() sharedContext?: Context
|
@MedusaContext() sharedContext?: Context
|
||||||
@@ -1930,12 +1959,14 @@ export default class OrderModuleService
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<OrderTypes.OrderExchangeDTO>
|
): Promise<OrderTypes.OrderExchangeDTO>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderExchanges(
|
async createOrderExchanges(
|
||||||
data: OrderTypes.CreateOrderExchangeDTO[],
|
data: OrderTypes.CreateOrderExchangeDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<OrderTypes.OrderExchangeDTO[]>
|
): Promise<OrderTypes.OrderExchangeDTO[]>
|
||||||
|
|
||||||
@InjectTransactionManager()
|
@InjectTransactionManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createOrderExchanges(
|
async createOrderExchanges(
|
||||||
data:
|
data:
|
||||||
| OrderTypes.CreateOrderExchangeDTO
|
| OrderTypes.CreateOrderExchangeDTO
|
||||||
@@ -3537,12 +3568,13 @@ export default class OrderModuleService
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
updateReturnReasons(
|
updateReturnReasons(
|
||||||
id: string,
|
id: string,
|
||||||
data: UpdateOrderReturnReasonDTO,
|
data: UpdateOrderReturnReasonDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<OrderReturnReasonDTO>
|
): Promise<OrderReturnReasonDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updateReturnReasons(
|
updateReturnReasons(
|
||||||
selector: FilterableOrderReturnReasonProps,
|
selector: FilterableOrderReturnReasonProps,
|
||||||
data: Partial<UpdateOrderReturnReasonDTO>,
|
data: Partial<UpdateOrderReturnReasonDTO>,
|
||||||
@@ -3550,6 +3582,7 @@ export default class OrderModuleService
|
|||||||
): Promise<OrderReturnReasonDTO[]>
|
): Promise<OrderReturnReasonDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateReturnReasons(
|
async updateReturnReasons(
|
||||||
idOrSelector: string | FilterableOrderReturnReasonProps,
|
idOrSelector: string | FilterableOrderReturnReasonProps,
|
||||||
data: UpdateOrderReturnReasonDTO,
|
data: UpdateOrderReturnReasonDTO,
|
||||||
@@ -3652,4 +3685,16 @@ export default class OrderModuleService
|
|||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
return await BundledActions.registerDelivery.bind(this)(data, sharedContext)
|
return await BundledActions.registerDelivery.bind(this)(data, sharedContext)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
|
async createReturnItems(
|
||||||
|
data: OrderTypes.CreateOrderReturnItemDTO,
|
||||||
|
sharedContext?: Context
|
||||||
|
): Promise<OrderTypes.OrderReturnItemDTO> {
|
||||||
|
return super.createReturnItems(
|
||||||
|
data as unknown as OrderTypes.OrderReturnItemDTO,
|
||||||
|
sharedContext
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -151,17 +151,20 @@ export default class PaymentModuleService
|
|||||||
return joinerConfig
|
return joinerConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
createPaymentCollections(
|
createPaymentCollections(
|
||||||
data: CreatePaymentCollectionDTO,
|
data: CreatePaymentCollectionDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PaymentCollectionDTO>
|
): Promise<PaymentCollectionDTO>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
createPaymentCollections(
|
createPaymentCollections(
|
||||||
data: CreatePaymentCollectionDTO[],
|
data: CreatePaymentCollectionDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PaymentCollectionDTO[]>
|
): Promise<PaymentCollectionDTO[]>
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
async createPaymentCollections(
|
async createPaymentCollections(
|
||||||
data: CreatePaymentCollectionDTO | CreatePaymentCollectionDTO[],
|
data: CreatePaymentCollectionDTO | CreatePaymentCollectionDTO[],
|
||||||
@MedusaContext() sharedContext?: Context
|
@MedusaContext() sharedContext?: Context
|
||||||
@@ -189,12 +192,13 @@ export default class PaymentModuleService
|
|||||||
return await this.paymentCollectionService_.create(data, sharedContext)
|
return await this.paymentCollectionService_.create(data, sharedContext)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
updatePaymentCollections(
|
updatePaymentCollections(
|
||||||
paymentCollectionId: string,
|
paymentCollectionId: string,
|
||||||
data: PaymentCollectionUpdatableFields,
|
data: PaymentCollectionUpdatableFields,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PaymentCollectionDTO>
|
): Promise<PaymentCollectionDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updatePaymentCollections(
|
updatePaymentCollections(
|
||||||
selector: FilterablePaymentCollectionProps,
|
selector: FilterablePaymentCollectionProps,
|
||||||
data: PaymentCollectionUpdatableFields,
|
data: PaymentCollectionUpdatableFields,
|
||||||
@@ -202,6 +206,7 @@ export default class PaymentModuleService
|
|||||||
): Promise<PaymentCollectionDTO[]>
|
): Promise<PaymentCollectionDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updatePaymentCollections(
|
async updatePaymentCollections(
|
||||||
idOrSelector: string | FilterablePaymentCollectionProps,
|
idOrSelector: string | FilterablePaymentCollectionProps,
|
||||||
data: PaymentCollectionUpdatableFields,
|
data: PaymentCollectionUpdatableFields,
|
||||||
|
|||||||
@@ -427,6 +427,7 @@ export default class PricingModuleService
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PriceSetDTO>
|
): Promise<PriceSetDTO>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
async createPriceSets(
|
async createPriceSets(
|
||||||
data: PricingTypes.CreatePriceSetDTO[],
|
data: PricingTypes.CreatePriceSetDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -434,6 +435,7 @@ export default class PricingModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createPriceSets(
|
async createPriceSets(
|
||||||
data: PricingTypes.CreatePriceSetDTO | PricingTypes.CreatePriceSetDTO[],
|
data: PricingTypes.CreatePriceSetDTO | PricingTypes.CreatePriceSetDTO[],
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -503,6 +505,7 @@ export default class PricingModuleService
|
|||||||
data: PricingTypes.UpdatePriceSetDTO,
|
data: PricingTypes.UpdatePriceSetDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PriceSetDTO>
|
): Promise<PriceSetDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async updatePriceSets(
|
async updatePriceSets(
|
||||||
selector: PricingTypes.FilterablePriceSetProps,
|
selector: PricingTypes.FilterablePriceSetProps,
|
||||||
data: PricingTypes.UpdatePriceSetDTO,
|
data: PricingTypes.UpdatePriceSetDTO,
|
||||||
@@ -510,6 +513,7 @@ export default class PricingModuleService
|
|||||||
): Promise<PriceSetDTO[]>
|
): Promise<PriceSetDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updatePriceSets(
|
async updatePriceSets(
|
||||||
idOrSelector: string | PricingTypes.FilterablePriceSetProps,
|
idOrSelector: string | PricingTypes.FilterablePriceSetProps,
|
||||||
data: PricingTypes.UpdatePriceSetDTO,
|
data: PricingTypes.UpdatePriceSetDTO,
|
||||||
@@ -885,6 +889,7 @@ export default class PricingModuleService
|
|||||||
data: PricingTypes.UpdatePricePreferenceDTO,
|
data: PricingTypes.UpdatePricePreferenceDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PricePreferenceDTO>
|
): Promise<PricePreferenceDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async updatePricePreferences(
|
async updatePricePreferences(
|
||||||
selector: PricingTypes.FilterablePricePreferenceProps,
|
selector: PricingTypes.FilterablePricePreferenceProps,
|
||||||
data: PricingTypes.UpdatePricePreferenceDTO,
|
data: PricingTypes.UpdatePricePreferenceDTO,
|
||||||
@@ -892,6 +897,7 @@ export default class PricingModuleService
|
|||||||
): Promise<PricePreferenceDTO[]>
|
): Promise<PricePreferenceDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updatePricePreferences(
|
async updatePricePreferences(
|
||||||
idOrSelector: string | PricingTypes.FilterablePricePreferenceProps,
|
idOrSelector: string | PricingTypes.FilterablePricePreferenceProps,
|
||||||
data: PricingTypes.UpdatePricePreferenceDTO,
|
data: PricingTypes.UpdatePricePreferenceDTO,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
Context,
|
Context,
|
||||||
DAL,
|
DAL,
|
||||||
|
FilterableProductOptionValueProps,
|
||||||
FindConfig,
|
FindConfig,
|
||||||
IEventBusModuleService,
|
IEventBusModuleService,
|
||||||
InferEntityType,
|
InferEntityType,
|
||||||
@@ -242,11 +243,12 @@ export default class ProductModuleService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
createProductVariants(
|
createProductVariants(
|
||||||
data: ProductTypes.CreateProductVariantDTO[],
|
data: ProductTypes.CreateProductVariantDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductVariantDTO[]>
|
): Promise<ProductTypes.ProductVariantDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createProductVariants(
|
createProductVariants(
|
||||||
data: ProductTypes.CreateProductVariantDTO,
|
data: ProductTypes.CreateProductVariantDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -254,6 +256,7 @@ export default class ProductModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createProductVariants(
|
async createProductVariants(
|
||||||
data:
|
data:
|
||||||
| ProductTypes.CreateProductVariantDTO[]
|
| ProductTypes.CreateProductVariantDTO[]
|
||||||
@@ -371,12 +374,13 @@ export default class ProductModuleService
|
|||||||
return Array.isArray(data) ? allVariants : allVariants[0]
|
return Array.isArray(data) ? allVariants : allVariants[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
updateProductVariants(
|
updateProductVariants(
|
||||||
id: string,
|
id: string,
|
||||||
data: ProductTypes.UpdateProductVariantDTO,
|
data: ProductTypes.UpdateProductVariantDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductVariantDTO>
|
): Promise<ProductTypes.ProductVariantDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updateProductVariants(
|
updateProductVariants(
|
||||||
selector: ProductTypes.FilterableProductVariantProps,
|
selector: ProductTypes.FilterableProductVariantProps,
|
||||||
data: ProductTypes.UpdateProductVariantDTO,
|
data: ProductTypes.UpdateProductVariantDTO,
|
||||||
@@ -385,6 +389,7 @@ export default class ProductModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateProductVariants(
|
async updateProductVariants(
|
||||||
idOrSelector: string | ProductTypes.FilterableProductVariantProps,
|
idOrSelector: string | ProductTypes.FilterableProductVariantProps,
|
||||||
data: ProductTypes.UpdateProductVariantDTO,
|
data: ProductTypes.UpdateProductVariantDTO,
|
||||||
@@ -503,11 +508,12 @@ export default class ProductModuleService
|
|||||||
return productVariants
|
return productVariants
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
createProductTags(
|
createProductTags(
|
||||||
data: ProductTypes.CreateProductTagDTO[],
|
data: ProductTypes.CreateProductTagDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductTagDTO[]>
|
): Promise<ProductTypes.ProductTagDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createProductTags(
|
createProductTags(
|
||||||
data: ProductTypes.CreateProductTagDTO,
|
data: ProductTypes.CreateProductTagDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -515,6 +521,7 @@ export default class ProductModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createProductTags(
|
async createProductTags(
|
||||||
data: ProductTypes.CreateProductTagDTO[] | ProductTypes.CreateProductTagDTO,
|
data: ProductTypes.CreateProductTagDTO[] | ProductTypes.CreateProductTagDTO,
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -582,12 +589,13 @@ export default class ProductModuleService
|
|||||||
return Array.isArray(data) ? allTags : allTags[0]
|
return Array.isArray(data) ? allTags : allTags[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
updateProductTags(
|
updateProductTags(
|
||||||
id: string,
|
id: string,
|
||||||
data: ProductTypes.UpdateProductTagDTO,
|
data: ProductTypes.UpdateProductTagDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductTagDTO>
|
): Promise<ProductTypes.ProductTagDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updateProductTags(
|
updateProductTags(
|
||||||
selector: ProductTypes.FilterableProductTagProps,
|
selector: ProductTypes.FilterableProductTagProps,
|
||||||
data: ProductTypes.UpdateProductTagDTO,
|
data: ProductTypes.UpdateProductTagDTO,
|
||||||
@@ -596,6 +604,7 @@ export default class ProductModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateProductTags(
|
async updateProductTags(
|
||||||
idOrSelector: string | ProductTypes.FilterableProductTagProps,
|
idOrSelector: string | ProductTypes.FilterableProductTagProps,
|
||||||
data: ProductTypes.UpdateProductTagDTO,
|
data: ProductTypes.UpdateProductTagDTO,
|
||||||
@@ -636,17 +645,19 @@ export default class ProductModuleService
|
|||||||
return isString(idOrSelector) ? updatedTags[0] : updatedTags
|
return isString(idOrSelector) ? updatedTags[0] : updatedTags
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
createProductTypes(
|
createProductTypes(
|
||||||
data: ProductTypes.CreateProductTypeDTO[],
|
data: ProductTypes.CreateProductTypeDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductTypeDTO[]>
|
): Promise<ProductTypes.ProductTypeDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createProductTypes(
|
createProductTypes(
|
||||||
data: ProductTypes.CreateProductTypeDTO,
|
data: ProductTypes.CreateProductTypeDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductTypeDTO>
|
): Promise<ProductTypes.ProductTypeDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createProductTypes(
|
async createProductTypes(
|
||||||
data:
|
data:
|
||||||
| ProductTypes.CreateProductTypeDTO[]
|
| ProductTypes.CreateProductTypeDTO[]
|
||||||
@@ -704,12 +715,13 @@ export default class ProductModuleService
|
|||||||
return Array.isArray(data) ? allTypes : allTypes[0]
|
return Array.isArray(data) ? allTypes : allTypes[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
updateProductTypes(
|
updateProductTypes(
|
||||||
id: string,
|
id: string,
|
||||||
data: ProductTypes.UpdateProductTypeDTO,
|
data: ProductTypes.UpdateProductTypeDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductTypeDTO>
|
): Promise<ProductTypes.ProductTypeDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updateProductTypes(
|
updateProductTypes(
|
||||||
selector: ProductTypes.FilterableProductTypeProps,
|
selector: ProductTypes.FilterableProductTypeProps,
|
||||||
data: ProductTypes.UpdateProductTypeDTO,
|
data: ProductTypes.UpdateProductTypeDTO,
|
||||||
@@ -717,6 +729,7 @@ export default class ProductModuleService
|
|||||||
): Promise<ProductTypes.ProductTypeDTO[]>
|
): Promise<ProductTypes.ProductTypeDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateProductTypes(
|
async updateProductTypes(
|
||||||
idOrSelector: string | ProductTypes.FilterableProductTypeProps,
|
idOrSelector: string | ProductTypes.FilterableProductTypeProps,
|
||||||
data: ProductTypes.UpdateProductTypeDTO,
|
data: ProductTypes.UpdateProductTypeDTO,
|
||||||
@@ -752,17 +765,19 @@ export default class ProductModuleService
|
|||||||
return isString(idOrSelector) ? updatedTypes[0] : updatedTypes
|
return isString(idOrSelector) ? updatedTypes[0] : updatedTypes
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
createProductOptions(
|
createProductOptions(
|
||||||
data: ProductTypes.CreateProductOptionDTO[],
|
data: ProductTypes.CreateProductOptionDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductOptionDTO[]>
|
): Promise<ProductTypes.ProductOptionDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createProductOptions(
|
createProductOptions(
|
||||||
data: ProductTypes.CreateProductOptionDTO,
|
data: ProductTypes.CreateProductOptionDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductOptionDTO>
|
): Promise<ProductTypes.ProductOptionDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createProductOptions(
|
async createProductOptions(
|
||||||
data:
|
data:
|
||||||
| ProductTypes.CreateProductOptionDTO[]
|
| ProductTypes.CreateProductOptionDTO[]
|
||||||
@@ -849,12 +864,13 @@ export default class ProductModuleService
|
|||||||
return Array.isArray(data) ? allOptions : allOptions[0]
|
return Array.isArray(data) ? allOptions : allOptions[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
updateProductOptions(
|
updateProductOptions(
|
||||||
id: string,
|
id: string,
|
||||||
data: ProductTypes.UpdateProductOptionDTO,
|
data: ProductTypes.UpdateProductOptionDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductOptionDTO>
|
): Promise<ProductTypes.ProductOptionDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updateProductOptions(
|
updateProductOptions(
|
||||||
selector: ProductTypes.FilterableProductOptionProps,
|
selector: ProductTypes.FilterableProductOptionProps,
|
||||||
data: ProductTypes.UpdateProductOptionDTO,
|
data: ProductTypes.UpdateProductOptionDTO,
|
||||||
@@ -862,6 +878,7 @@ export default class ProductModuleService
|
|||||||
): Promise<ProductTypes.ProductOptionDTO[]>
|
): Promise<ProductTypes.ProductOptionDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateProductOptions(
|
async updateProductOptions(
|
||||||
idOrSelector: string | ProductTypes.FilterableProductOptionProps,
|
idOrSelector: string | ProductTypes.FilterableProductOptionProps,
|
||||||
data: ProductTypes.UpdateProductOptionDTO,
|
data: ProductTypes.UpdateProductOptionDTO,
|
||||||
@@ -966,11 +983,12 @@ export default class ProductModuleService
|
|||||||
return productOptions
|
return productOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
createProductCollections(
|
createProductCollections(
|
||||||
data: ProductTypes.CreateProductCollectionDTO[],
|
data: ProductTypes.CreateProductCollectionDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductCollectionDTO[]>
|
): Promise<ProductTypes.ProductCollectionDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createProductCollections(
|
createProductCollections(
|
||||||
data: ProductTypes.CreateProductCollectionDTO,
|
data: ProductTypes.CreateProductCollectionDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -978,6 +996,7 @@ export default class ProductModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createProductCollections(
|
async createProductCollections(
|
||||||
data:
|
data:
|
||||||
| ProductTypes.CreateProductCollectionDTO[]
|
| ProductTypes.CreateProductCollectionDTO[]
|
||||||
@@ -1084,12 +1103,13 @@ export default class ProductModuleService
|
|||||||
return Array.isArray(data) ? allCollections : allCollections[0]
|
return Array.isArray(data) ? allCollections : allCollections[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
updateProductCollections(
|
updateProductCollections(
|
||||||
id: string,
|
id: string,
|
||||||
data: ProductTypes.UpdateProductCollectionDTO,
|
data: ProductTypes.UpdateProductCollectionDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductCollectionDTO>
|
): Promise<ProductTypes.ProductCollectionDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updateProductCollections(
|
updateProductCollections(
|
||||||
selector: ProductTypes.FilterableProductCollectionProps,
|
selector: ProductTypes.FilterableProductCollectionProps,
|
||||||
data: ProductTypes.UpdateProductCollectionDTO,
|
data: ProductTypes.UpdateProductCollectionDTO,
|
||||||
@@ -1098,6 +1118,7 @@ export default class ProductModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateProductCollections(
|
async updateProductCollections(
|
||||||
idOrSelector: string | ProductTypes.FilterableProductCollectionProps,
|
idOrSelector: string | ProductTypes.FilterableProductCollectionProps,
|
||||||
data: ProductTypes.UpdateProductCollectionDTO,
|
data: ProductTypes.UpdateProductCollectionDTO,
|
||||||
@@ -1216,11 +1237,12 @@ export default class ProductModuleService
|
|||||||
return collections
|
return collections
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
createProductCategories(
|
createProductCategories(
|
||||||
data: ProductTypes.CreateProductCategoryDTO[],
|
data: ProductTypes.CreateProductCategoryDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductCategoryDTO[]>
|
): Promise<ProductTypes.ProductCategoryDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createProductCategories(
|
createProductCategories(
|
||||||
data: ProductTypes.CreateProductCategoryDTO,
|
data: ProductTypes.CreateProductCategoryDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -1228,6 +1250,7 @@ export default class ProductModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createProductCategories(
|
async createProductCategories(
|
||||||
data:
|
data:
|
||||||
| ProductTypes.CreateProductCategoryDTO[]
|
| ProductTypes.CreateProductCategoryDTO[]
|
||||||
@@ -1325,12 +1348,13 @@ export default class ProductModuleService
|
|||||||
return Array.isArray(data) ? result : result[0]
|
return Array.isArray(data) ? result : result[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
updateProductCategories(
|
updateProductCategories(
|
||||||
id: string,
|
id: string,
|
||||||
data: ProductTypes.UpdateProductCategoryDTO,
|
data: ProductTypes.UpdateProductCategoryDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductCategoryDTO>
|
): Promise<ProductTypes.ProductCategoryDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updateProductCategories(
|
updateProductCategories(
|
||||||
selector: ProductTypes.FilterableProductTypeProps,
|
selector: ProductTypes.FilterableProductTypeProps,
|
||||||
data: ProductTypes.UpdateProductCategoryDTO,
|
data: ProductTypes.UpdateProductCategoryDTO,
|
||||||
@@ -1339,6 +1363,7 @@ export default class ProductModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateProductCategories(
|
async updateProductCategories(
|
||||||
idOrSelector: string | ProductTypes.FilterableProductTypeProps,
|
idOrSelector: string | ProductTypes.FilterableProductTypeProps,
|
||||||
data: ProductTypes.UpdateProductCategoryDTO,
|
data: ProductTypes.UpdateProductCategoryDTO,
|
||||||
@@ -1390,6 +1415,7 @@ export default class ProductModuleService
|
|||||||
data: ProductTypes.CreateProductDTO[],
|
data: ProductTypes.CreateProductDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductDTO[]>
|
): Promise<ProductTypes.ProductDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createProducts(
|
createProducts(
|
||||||
data: ProductTypes.CreateProductDTO,
|
data: ProductTypes.CreateProductDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -1397,6 +1423,7 @@ export default class ProductModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createProducts(
|
async createProducts(
|
||||||
data: ProductTypes.CreateProductDTO[] | ProductTypes.CreateProductDTO,
|
data: ProductTypes.CreateProductDTO[] | ProductTypes.CreateProductDTO,
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -1477,6 +1504,7 @@ export default class ProductModuleService
|
|||||||
data: ProductTypes.UpdateProductDTO,
|
data: ProductTypes.UpdateProductDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<ProductTypes.ProductDTO>
|
): Promise<ProductTypes.ProductDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updateProducts(
|
updateProducts(
|
||||||
selector: ProductTypes.FilterableProductProps,
|
selector: ProductTypes.FilterableProductProps,
|
||||||
data: ProductTypes.UpdateProductDTO,
|
data: ProductTypes.UpdateProductDTO,
|
||||||
@@ -1485,6 +1513,7 @@ export default class ProductModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateProducts(
|
async updateProducts(
|
||||||
idOrSelector: string | ProductTypes.FilterableProductProps,
|
idOrSelector: string | ProductTypes.FilterableProductProps,
|
||||||
data: ProductTypes.UpdateProductDTO,
|
data: ProductTypes.UpdateProductDTO,
|
||||||
@@ -1746,6 +1775,70 @@ export default class ProductModuleService
|
|||||||
return productData
|
return productData
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
|
updateProductOptionValues(
|
||||||
|
idOrSelector: string,
|
||||||
|
data: ProductTypes.UpdateProductOptionValueDTO,
|
||||||
|
sharedContext?: Context
|
||||||
|
): Promise<ProductTypes.ProductOptionValueDTO>
|
||||||
|
// @ts-expect-error
|
||||||
|
updateProductOptionValues(
|
||||||
|
selector: FilterableProductOptionValueProps,
|
||||||
|
data: ProductTypes.UpdateProductOptionValueDTO,
|
||||||
|
sharedContext?: Context
|
||||||
|
): Promise<ProductTypes.ProductOptionValueDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
|
async updateProductOptionValues(
|
||||||
|
idOrSelector: string | FilterableProductOptionValueProps,
|
||||||
|
data: ProductTypes.UpdateProductOptionValueDTO,
|
||||||
|
sharedContext: Context = {}
|
||||||
|
): Promise<
|
||||||
|
ProductTypes.ProductOptionValueDTO | ProductTypes.ProductOptionValueDTO[]
|
||||||
|
> {
|
||||||
|
let normalizedInput: ({
|
||||||
|
id: string
|
||||||
|
} & ProductTypes.UpdateProductOptionValueDTO)[] = []
|
||||||
|
if (isString(idOrSelector)) {
|
||||||
|
// This will throw if the product option value does not exist
|
||||||
|
await this.productOptionValueService_.retrieve(
|
||||||
|
idOrSelector,
|
||||||
|
{},
|
||||||
|
sharedContext
|
||||||
|
)
|
||||||
|
|
||||||
|
normalizedInput = [{ id: idOrSelector, ...data }]
|
||||||
|
} else {
|
||||||
|
const productOptionValues = await this.productOptionValueService_.list(
|
||||||
|
idOrSelector,
|
||||||
|
{},
|
||||||
|
sharedContext
|
||||||
|
)
|
||||||
|
|
||||||
|
normalizedInput = productOptionValues.map((product) => ({
|
||||||
|
id: product.id,
|
||||||
|
...data,
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
const productOptionValues = await super.updateProductOptionValues(
|
||||||
|
normalizedInput,
|
||||||
|
sharedContext
|
||||||
|
)
|
||||||
|
|
||||||
|
const updatedProductOptionValues = await this.baseRepository_.serialize<
|
||||||
|
ProductTypes.ProductOptionValueDTO[]
|
||||||
|
>(productOptionValues)
|
||||||
|
|
||||||
|
eventBuilders.updatedProductOptionValue({
|
||||||
|
data: updatedProductOptionValues,
|
||||||
|
sharedContext: sharedContext,
|
||||||
|
})
|
||||||
|
|
||||||
|
return isString(idOrSelector)
|
||||||
|
? updatedProductOptionValues[0]
|
||||||
|
: updatedProductOptionValues
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates the manually provided handle value of the product
|
* Validates the manually provided handle value of the product
|
||||||
* to be URL-safe
|
* to be URL-safe
|
||||||
|
|||||||
@@ -132,4 +132,22 @@ export const eventBuilders = {
|
|||||||
object: "product_collection",
|
object: "product_collection",
|
||||||
eventName: ProductEvents.PRODUCT_COLLECTION_DELETED,
|
eventName: ProductEvents.PRODUCT_COLLECTION_DELETED,
|
||||||
}),
|
}),
|
||||||
|
createdProductOptionValue: moduleEventBuilderFactory({
|
||||||
|
source: Modules.PRODUCT,
|
||||||
|
action: CommonEvents.CREATED,
|
||||||
|
object: "product_option_value",
|
||||||
|
eventName: ProductEvents.PRODUCT_OPTION_VALUE_CREATED,
|
||||||
|
}),
|
||||||
|
updatedProductOptionValue: moduleEventBuilderFactory({
|
||||||
|
source: Modules.PRODUCT,
|
||||||
|
action: CommonEvents.UPDATED,
|
||||||
|
object: "product_option_value",
|
||||||
|
eventName: ProductEvents.PRODUCT_OPTION_VALUE_UPDATED,
|
||||||
|
}),
|
||||||
|
deletedProductOptionValue: moduleEventBuilderFactory({
|
||||||
|
source: Modules.PRODUCT,
|
||||||
|
action: CommonEvents.DELETED,
|
||||||
|
object: "product_option_value",
|
||||||
|
eventName: ProductEvents.PRODUCT_OPTION_VALUE_DELETED,
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
@@ -574,12 +574,14 @@ export default class PromotionModuleService
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PromotionTypes.PromotionDTO>
|
): Promise<PromotionTypes.PromotionDTO>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
async createPromotions(
|
async createPromotions(
|
||||||
data: PromotionTypes.CreatePromotionDTO[],
|
data: PromotionTypes.CreatePromotionDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PromotionTypes.PromotionDTO[]>
|
): Promise<PromotionTypes.PromotionDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createPromotions(
|
async createPromotions(
|
||||||
data:
|
data:
|
||||||
| PromotionTypes.CreatePromotionDTO
|
| PromotionTypes.CreatePromotionDTO
|
||||||
@@ -841,12 +843,14 @@ export default class PromotionModuleService
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PromotionTypes.PromotionDTO>
|
): Promise<PromotionTypes.PromotionDTO>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
async updatePromotions(
|
async updatePromotions(
|
||||||
data: PromotionTypes.UpdatePromotionDTO[],
|
data: PromotionTypes.UpdatePromotionDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PromotionTypes.PromotionDTO[]>
|
): Promise<PromotionTypes.PromotionDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updatePromotions(
|
async updatePromotions(
|
||||||
data:
|
data:
|
||||||
| PromotionTypes.UpdatePromotionDTO
|
| PromotionTypes.UpdatePromotionDTO
|
||||||
@@ -1295,18 +1299,20 @@ export default class PromotionModuleService
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
async createCampaigns(
|
async createCampaigns(
|
||||||
data: PromotionTypes.CreateCampaignDTO,
|
data: PromotionTypes.CreateCampaignDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PromotionTypes.CampaignDTO>
|
): Promise<PromotionTypes.CampaignDTO>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
async createCampaigns(
|
async createCampaigns(
|
||||||
data: PromotionTypes.CreateCampaignDTO[],
|
data: PromotionTypes.CreateCampaignDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PromotionTypes.CampaignDTO[]>
|
): Promise<PromotionTypes.CampaignDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createCampaigns(
|
async createCampaigns(
|
||||||
data: PromotionTypes.CreateCampaignDTO | PromotionTypes.CreateCampaignDTO[],
|
data: PromotionTypes.CreateCampaignDTO | PromotionTypes.CreateCampaignDTO[],
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -1404,18 +1410,20 @@ export default class PromotionModuleService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
async updateCampaigns(
|
async updateCampaigns(
|
||||||
data: PromotionTypes.UpdateCampaignDTO,
|
data: PromotionTypes.UpdateCampaignDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PromotionTypes.CampaignDTO>
|
): Promise<PromotionTypes.CampaignDTO>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
async updateCampaigns(
|
async updateCampaigns(
|
||||||
data: PromotionTypes.UpdateCampaignDTO[],
|
data: PromotionTypes.UpdateCampaignDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<PromotionTypes.CampaignDTO[]>
|
): Promise<PromotionTypes.CampaignDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateCampaigns(
|
async updateCampaigns(
|
||||||
data: PromotionTypes.UpdateCampaignDTO | PromotionTypes.UpdateCampaignDTO[],
|
data: PromotionTypes.UpdateCampaignDTO | PromotionTypes.UpdateCampaignDTO[],
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
|
|||||||
@@ -71,12 +71,14 @@ export default class RegionModuleService
|
|||||||
data: CreateRegionDTO[],
|
data: CreateRegionDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<RegionDTO[]>
|
): Promise<RegionDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async createRegions(
|
async createRegions(
|
||||||
data: CreateRegionDTO,
|
data: CreateRegionDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<RegionDTO>
|
): Promise<RegionDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createRegions(
|
async createRegions(
|
||||||
data: CreateRegionDTO | CreateRegionDTO[],
|
data: CreateRegionDTO | CreateRegionDTO[],
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -130,7 +132,7 @@ export default class RegionModuleService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
async softDeleteRegions(
|
async softDeleteRegions(
|
||||||
ids: string | object | string[] | object[],
|
ids: string | object | string[] | object[],
|
||||||
config?: SoftDeleteReturn<string>,
|
config?: SoftDeleteReturn<string>,
|
||||||
@@ -141,7 +143,7 @@ export default class RegionModuleService
|
|||||||
await super.updateCountries(
|
await super.updateCountries(
|
||||||
{
|
{
|
||||||
selector: { region_id: ids },
|
selector: { region_id: ids },
|
||||||
data: { region_id: null },
|
data: { region_id: null } as any,
|
||||||
},
|
},
|
||||||
sharedContext
|
sharedContext
|
||||||
)
|
)
|
||||||
@@ -192,6 +194,7 @@ export default class RegionModuleService
|
|||||||
data: UpdateRegionDTO,
|
data: UpdateRegionDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<RegionDTO>
|
): Promise<RegionDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async updateRegions(
|
async updateRegions(
|
||||||
selector: FilterableRegionProps,
|
selector: FilterableRegionProps,
|
||||||
data: UpdateRegionDTO,
|
data: UpdateRegionDTO,
|
||||||
@@ -199,6 +202,7 @@ export default class RegionModuleService
|
|||||||
): Promise<RegionDTO[]>
|
): Promise<RegionDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateRegions(
|
async updateRegions(
|
||||||
idOrSelector: string | FilterableRegionProps,
|
idOrSelector: string | FilterableRegionProps,
|
||||||
data: UpdateRegionDTO,
|
data: UpdateRegionDTO,
|
||||||
|
|||||||
@@ -60,12 +60,14 @@ export default class SalesChannelModuleService
|
|||||||
data: CreateSalesChannelDTO[],
|
data: CreateSalesChannelDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<SalesChannelDTO[]>
|
): Promise<SalesChannelDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async createSalesChannels(
|
async createSalesChannels(
|
||||||
data: CreateSalesChannelDTO,
|
data: CreateSalesChannelDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<SalesChannelDTO>
|
): Promise<SalesChannelDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createSalesChannels(
|
async createSalesChannels(
|
||||||
data: CreateSalesChannelDTO | CreateSalesChannelDTO[],
|
data: CreateSalesChannelDTO | CreateSalesChannelDTO[],
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -96,6 +98,7 @@ export default class SalesChannelModuleService
|
|||||||
data: UpdateSalesChannelDTO,
|
data: UpdateSalesChannelDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<SalesChannelDTO>
|
): Promise<SalesChannelDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async updateSalesChannels(
|
async updateSalesChannels(
|
||||||
selector: FilterableSalesChannelProps,
|
selector: FilterableSalesChannelProps,
|
||||||
data: UpdateSalesChannelDTO,
|
data: UpdateSalesChannelDTO,
|
||||||
@@ -103,6 +106,7 @@ export default class SalesChannelModuleService
|
|||||||
): Promise<SalesChannelDTO[]>
|
): Promise<SalesChannelDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateSalesChannels(
|
async updateSalesChannels(
|
||||||
idOrSelector: string | FilterableSalesChannelProps,
|
idOrSelector: string | FilterableSalesChannelProps,
|
||||||
data: UpdateSalesChannelDTO | UpdateSalesChannelDTO[],
|
data: UpdateSalesChannelDTO | UpdateSalesChannelDTO[],
|
||||||
|
|||||||
@@ -81,12 +81,13 @@ export default class StockLocationModuleService
|
|||||||
data: CreateStockLocationInput,
|
data: CreateStockLocationInput,
|
||||||
context: Context
|
context: Context
|
||||||
): Promise<StockLocationTypes.StockLocationDTO>
|
): Promise<StockLocationTypes.StockLocationDTO>
|
||||||
|
// @ts-expect-error
|
||||||
createStockLocations(
|
createStockLocations(
|
||||||
data: CreateStockLocationInput[],
|
data: CreateStockLocationInput[],
|
||||||
context: Context
|
context: Context
|
||||||
): Promise<StockLocationTypes.StockLocationDTO[]>
|
): Promise<StockLocationTypes.StockLocationDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createStockLocations(
|
async createStockLocations(
|
||||||
data: CreateStockLocationInput | CreateStockLocationInput[],
|
data: CreateStockLocationInput | CreateStockLocationInput[],
|
||||||
@MedusaContext() context: Context = {}
|
@MedusaContext() context: Context = {}
|
||||||
@@ -172,6 +173,7 @@ export default class StockLocationModuleService
|
|||||||
input: UpdateStockLocationInput,
|
input: UpdateStockLocationInput,
|
||||||
context?: Context
|
context?: Context
|
||||||
): Promise<StockLocationTypes.StockLocationDTO>
|
): Promise<StockLocationTypes.StockLocationDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updateStockLocations(
|
updateStockLocations(
|
||||||
selector: FilterableStockLocationProps,
|
selector: FilterableStockLocationProps,
|
||||||
input: UpdateStockLocationInput,
|
input: UpdateStockLocationInput,
|
||||||
@@ -185,6 +187,7 @@ export default class StockLocationModuleService
|
|||||||
* @returns The updated stock location.
|
* @returns The updated stock location.
|
||||||
*/
|
*/
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateStockLocations(
|
async updateStockLocations(
|
||||||
idOrSelector: string | FilterableStockLocationProps,
|
idOrSelector: string | FilterableStockLocationProps,
|
||||||
data: UpdateStockLocationInput | UpdateStockLocationInput[],
|
data: UpdateStockLocationInput | UpdateStockLocationInput[],
|
||||||
@@ -229,12 +232,14 @@ export default class StockLocationModuleService
|
|||||||
data: StockLocationAddressInput & { id: string },
|
data: StockLocationAddressInput & { id: string },
|
||||||
context?: Context
|
context?: Context
|
||||||
): Promise<StockLocationTypes.StockLocationAddressDTO>
|
): Promise<StockLocationTypes.StockLocationAddressDTO>
|
||||||
|
// @ts-expect-error
|
||||||
updateStockLocationAddresses(
|
updateStockLocationAddresses(
|
||||||
data: (StockLocationAddressInput & { id: string })[],
|
data: (StockLocationAddressInput & { id: string })[],
|
||||||
context?: Context
|
context?: Context
|
||||||
): Promise<StockLocationTypes.StockLocationAddressDTO[]>
|
): Promise<StockLocationTypes.StockLocationAddressDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateStockLocationAddresses(
|
async updateStockLocationAddresses(
|
||||||
data:
|
data:
|
||||||
| (StockLocationAddressInput & { id: string })
|
| (StockLocationAddressInput & { id: string })
|
||||||
|
|||||||
@@ -54,11 +54,13 @@ export default class StoreModuleService
|
|||||||
data: StoreTypes.CreateStoreDTO[],
|
data: StoreTypes.CreateStoreDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<StoreTypes.StoreDTO[]>
|
): Promise<StoreTypes.StoreDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async createStores(
|
async createStores(
|
||||||
data: StoreTypes.CreateStoreDTO,
|
data: StoreTypes.CreateStoreDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<StoreTypes.StoreDTO>
|
): Promise<StoreTypes.StoreDTO>
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createStores(
|
async createStores(
|
||||||
data: StoreTypes.CreateStoreDTO | StoreTypes.CreateStoreDTO[],
|
data: StoreTypes.CreateStoreDTO | StoreTypes.CreateStoreDTO[],
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -131,12 +133,14 @@ export default class StoreModuleService
|
|||||||
data: StoreTypes.UpdateStoreDTO,
|
data: StoreTypes.UpdateStoreDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<StoreTypes.StoreDTO>
|
): Promise<StoreTypes.StoreDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async updateStores(
|
async updateStores(
|
||||||
selector: StoreTypes.FilterableStoreProps,
|
selector: StoreTypes.FilterableStoreProps,
|
||||||
data: StoreTypes.UpdateStoreDTO,
|
data: StoreTypes.UpdateStoreDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<StoreTypes.StoreDTO[]>
|
): Promise<StoreTypes.StoreDTO[]>
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateStores(
|
async updateStores(
|
||||||
idOrSelector: string | StoreTypes.FilterableStoreProps,
|
idOrSelector: string | StoreTypes.FilterableStoreProps,
|
||||||
data: StoreTypes.UpdateStoreDTO,
|
data: StoreTypes.UpdateStoreDTO,
|
||||||
|
|||||||
@@ -88,12 +88,14 @@ export default class TaxModuleService
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<TaxTypes.TaxRateDTO[]>
|
): Promise<TaxTypes.TaxRateDTO[]>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
async createTaxRates(
|
async createTaxRates(
|
||||||
data: TaxTypes.CreateTaxRateDTO,
|
data: TaxTypes.CreateTaxRateDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<TaxTypes.TaxRateDTO>
|
): Promise<TaxTypes.TaxRateDTO>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createTaxRates(
|
async createTaxRates(
|
||||||
data: TaxTypes.CreateTaxRateDTO[] | TaxTypes.CreateTaxRateDTO,
|
data: TaxTypes.CreateTaxRateDTO[] | TaxTypes.CreateTaxRateDTO,
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -155,11 +157,13 @@ export default class TaxModuleService
|
|||||||
data: TaxTypes.UpdateTaxRateDTO,
|
data: TaxTypes.UpdateTaxRateDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<TaxTypes.TaxRateDTO>
|
): Promise<TaxTypes.TaxRateDTO>
|
||||||
|
// @ts-expect-error
|
||||||
async updateTaxRates(
|
async updateTaxRates(
|
||||||
ids: string[],
|
ids: string[],
|
||||||
data: TaxTypes.UpdateTaxRateDTO,
|
data: TaxTypes.UpdateTaxRateDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<TaxTypes.TaxRateDTO[]>
|
): Promise<TaxTypes.TaxRateDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
async updateTaxRates(
|
async updateTaxRates(
|
||||||
selector: TaxTypes.FilterableTaxRateProps,
|
selector: TaxTypes.FilterableTaxRateProps,
|
||||||
data: TaxTypes.UpdateTaxRateDTO,
|
data: TaxTypes.UpdateTaxRateDTO,
|
||||||
@@ -167,6 +171,7 @@ export default class TaxModuleService
|
|||||||
): Promise<TaxTypes.TaxRateDTO[]>
|
): Promise<TaxTypes.TaxRateDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async updateTaxRates(
|
async updateTaxRates(
|
||||||
selector: string | string[] | TaxTypes.FilterableTaxRateProps,
|
selector: string | string[] | TaxTypes.FilterableTaxRateProps,
|
||||||
data: TaxTypes.UpdateTaxRateDTO,
|
data: TaxTypes.UpdateTaxRateDTO,
|
||||||
@@ -296,12 +301,14 @@ export default class TaxModuleService
|
|||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<TaxRegionDTO>
|
): Promise<TaxRegionDTO>
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
createTaxRegions(
|
createTaxRegions(
|
||||||
data: TaxTypes.CreateTaxRegionDTO[],
|
data: TaxTypes.CreateTaxRegionDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<TaxRegionDTO[]>
|
): Promise<TaxRegionDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createTaxRegions(
|
async createTaxRegions(
|
||||||
data: TaxTypes.CreateTaxRegionDTO | TaxTypes.CreateTaxRegionDTO[],
|
data: TaxTypes.CreateTaxRegionDTO | TaxTypes.CreateTaxRegionDTO[],
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -347,17 +354,19 @@ export default class TaxModuleService
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
createTaxRateRules(
|
createTaxRateRules(
|
||||||
data: TaxTypes.CreateTaxRateRuleDTO,
|
data: TaxTypes.CreateTaxRateRuleDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<TaxTypes.TaxRateRuleDTO>
|
): Promise<TaxTypes.TaxRateRuleDTO>
|
||||||
|
// @ts-expect-error
|
||||||
createTaxRateRules(
|
createTaxRateRules(
|
||||||
data: TaxTypes.CreateTaxRateRuleDTO[],
|
data: TaxTypes.CreateTaxRateRuleDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<TaxTypes.TaxRateRuleDTO[]>
|
): Promise<TaxTypes.TaxRateRuleDTO[]>
|
||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
|
// @ts-expect-error
|
||||||
async createTaxRateRules(
|
async createTaxRateRules(
|
||||||
data: TaxTypes.CreateTaxRateRuleDTO | TaxTypes.CreateTaxRateRuleDTO[],
|
data: TaxTypes.CreateTaxRateRuleDTO | TaxTypes.CreateTaxRateRuleDTO[],
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ export default class UserModuleService
|
|||||||
data: UserTypes.CreateUserDTO[],
|
data: UserTypes.CreateUserDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<UserTypes.UserDTO[]>
|
): Promise<UserTypes.UserDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createUsers(
|
createUsers(
|
||||||
data: UserTypes.CreateUserDTO,
|
data: UserTypes.CreateUserDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -177,6 +178,7 @@ export default class UserModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createUsers(
|
async createUsers(
|
||||||
data: UserTypes.CreateUserDTO[] | UserTypes.CreateUserDTO,
|
data: UserTypes.CreateUserDTO[] | UserTypes.CreateUserDTO,
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -210,6 +212,7 @@ export default class UserModuleService
|
|||||||
data: UserTypes.UpdateUserDTO[],
|
data: UserTypes.UpdateUserDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<UserTypes.UserDTO[]>
|
): Promise<UserTypes.UserDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
updateUsers(
|
updateUsers(
|
||||||
data: UserTypes.UpdateUserDTO,
|
data: UserTypes.UpdateUserDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -217,6 +220,7 @@ export default class UserModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateUsers(
|
async updateUsers(
|
||||||
data: UserTypes.UpdateUserDTO | UserTypes.UpdateUserDTO[],
|
data: UserTypes.UpdateUserDTO | UserTypes.UpdateUserDTO[],
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -245,11 +249,12 @@ export default class UserModuleService
|
|||||||
return Array.isArray(data) ? serializedUsers : serializedUsers[0]
|
return Array.isArray(data) ? serializedUsers : serializedUsers[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
createInvites(
|
createInvites(
|
||||||
data: UserTypes.CreateInviteDTO[],
|
data: UserTypes.CreateInviteDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<UserTypes.InviteDTO[]>
|
): Promise<UserTypes.InviteDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
createInvites(
|
createInvites(
|
||||||
data: UserTypes.CreateInviteDTO,
|
data: UserTypes.CreateInviteDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -257,6 +262,7 @@ export default class UserModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async createInvites(
|
async createInvites(
|
||||||
data: UserTypes.CreateInviteDTO[] | UserTypes.CreateInviteDTO,
|
data: UserTypes.CreateInviteDTO[] | UserTypes.CreateInviteDTO,
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
@@ -332,6 +338,7 @@ export default class UserModuleService
|
|||||||
data: UserTypes.UpdateInviteDTO[],
|
data: UserTypes.UpdateInviteDTO[],
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
): Promise<UserTypes.InviteDTO[]>
|
): Promise<UserTypes.InviteDTO[]>
|
||||||
|
// @ts-expect-error
|
||||||
updateInvites(
|
updateInvites(
|
||||||
data: UserTypes.UpdateInviteDTO,
|
data: UserTypes.UpdateInviteDTO,
|
||||||
sharedContext?: Context
|
sharedContext?: Context
|
||||||
@@ -339,6 +346,7 @@ export default class UserModuleService
|
|||||||
|
|
||||||
@InjectManager()
|
@InjectManager()
|
||||||
@EmitEvents()
|
@EmitEvents()
|
||||||
|
// @ts-expect-error
|
||||||
async updateInvites(
|
async updateInvites(
|
||||||
data: UserTypes.UpdateInviteDTO | UserTypes.UpdateInviteDTO[],
|
data: UserTypes.UpdateInviteDTO | UserTypes.UpdateInviteDTO[],
|
||||||
@MedusaContext() sharedContext: Context = {}
|
@MedusaContext() sharedContext: Context = {}
|
||||||
|
|||||||
Reference in new issue
Block a user