From 0cc306bf562d8f1f1f1c09d9658463e2c8def465 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 25 Mar 2025 17:37:30 +0200 Subject: [PATCH] fix(js-sdk, types): fixes types and deprecate duplicate methods (#11975) --- .changeset/gorgeous-wombats-arrive.md | 6 ++++++ packages/core/js-sdk/src/admin/return.ts | 2 +- packages/core/js-sdk/src/admin/sales-channel.ts | 4 +++- .../types/src/http/workflow-execution/admin/entities.ts | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 .changeset/gorgeous-wombats-arrive.md diff --git a/.changeset/gorgeous-wombats-arrive.md b/.changeset/gorgeous-wombats-arrive.md new file mode 100644 index 0000000000..e939720842 --- /dev/null +++ b/.changeset/gorgeous-wombats-arrive.md @@ -0,0 +1,6 @@ +--- +"@medusajs/js-sdk": patch +"@medusajs/types": patch +--- + +fix(js-sdk, types): fixes types and deprecate duplicate methods diff --git a/packages/core/js-sdk/src/admin/return.ts b/packages/core/js-sdk/src/admin/return.ts index 31266f34a7..39783670b3 100644 --- a/packages/core/js-sdk/src/admin/return.ts +++ b/packages/core/js-sdk/src/admin/return.ts @@ -397,7 +397,7 @@ export class Return { async updateReturnShipping( id: string, actionId: string, - body: HttpTypes.AdminAddReturnShipping, + body: HttpTypes.AdminUpdateReturnShipping, query?: HttpTypes.SelectParams, headers?: ClientHeaders ) { diff --git a/packages/core/js-sdk/src/admin/sales-channel.ts b/packages/core/js-sdk/src/admin/sales-channel.ts index 70c29879ff..f895f977d7 100644 --- a/packages/core/js-sdk/src/admin/sales-channel.ts +++ b/packages/core/js-sdk/src/admin/sales-channel.ts @@ -239,6 +239,8 @@ export class SalesChannel { * .then(({ sales_channel }) => { * console.log(sales_channel) * }) + * + * @deprecated Use {@link batchProducts} instead */ async updateProducts( id: string, @@ -276,7 +278,7 @@ export class SalesChannel { */ async batchProducts( id: string, - body: HttpTypes.AdminBatchLink, + body: HttpTypes.AdminUpdateSalesChannelProducts, headers?: ClientHeaders ) { return await this.client.fetch( diff --git a/packages/core/types/src/http/workflow-execution/admin/entities.ts b/packages/core/types/src/http/workflow-execution/admin/entities.ts index 22e1150b1b..0d1fa373f5 100644 --- a/packages/core/types/src/http/workflow-execution/admin/entities.ts +++ b/packages/core/types/src/http/workflow-execution/admin/entities.ts @@ -26,7 +26,7 @@ export type TransactionStepState = | "skipped_failure" | "timeout" -interface AdminWorkflowExecutionExecution { +export interface AdminWorkflowExecutionExecution { /** * The details of the workflow execution's steps. * The key is the step's ID, and the value is the step's details.