diff --git a/packages/core/core-flows/src/api-key/steps/create-api-keys.ts b/packages/core/core-flows/src/api-key/steps/create-api-keys.ts index 47b70fe02f..4af5fafa8e 100644 --- a/packages/core/core-flows/src/api-key/steps/create-api-keys.ts +++ b/packages/core/core-flows/src/api-key/steps/create-api-keys.ts @@ -2,11 +2,14 @@ import { CreateApiKeyDTO, IApiKeyModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/utils" import { StepResponse, createStep } from "@medusajs/workflows-sdk" -type CreateApiKeysStepInput = { +export type CreateApiKeysStepInput = { api_keys: CreateApiKeyDTO[] } export const createApiKeysStepId = "create-api-keys" +/** + * This step creates one or more API keys. + */ export const createApiKeysStep = createStep( createApiKeysStepId, async (data: CreateApiKeysStepInput, { container }) => { diff --git a/packages/core/core-flows/src/api-key/steps/delete-api-keys.ts b/packages/core/core-flows/src/api-key/steps/delete-api-keys.ts index be63550149..11c09340b0 100644 --- a/packages/core/core-flows/src/api-key/steps/delete-api-keys.ts +++ b/packages/core/core-flows/src/api-key/steps/delete-api-keys.ts @@ -3,6 +3,9 @@ import { ModuleRegistrationName } from "@medusajs/utils" import { StepResponse, createStep } from "@medusajs/workflows-sdk" export const deleteApiKeysStepId = "delete-api-keys" +/** + * This step deletes one or more API keys. + */ export const deleteApiKeysStep = createStep( { name: deleteApiKeysStepId, noCompensation: true }, async (ids: string[], { container }) => { diff --git a/packages/core/core-flows/src/api-key/steps/link-sales-channels-to-publishable-key.ts b/packages/core/core-flows/src/api-key/steps/link-sales-channels-to-publishable-key.ts index 9d9c1d7550..81cf62e4ee 100644 --- a/packages/core/core-flows/src/api-key/steps/link-sales-channels-to-publishable-key.ts +++ b/packages/core/core-flows/src/api-key/steps/link-sales-channels-to-publishable-key.ts @@ -3,6 +3,9 @@ import { ContainerRegistrationKeys, Modules, promiseAll } from "@medusajs/utils" import { StepResponse, createStep } from "@medusajs/workflows-sdk" export const linkSalesChannelsToApiKeyStepId = "link-sales-channels-to-api-key" +/** + * This step links sales channels to API keys. + */ export const linkSalesChannelsToApiKeyStep = createStep( linkSalesChannelsToApiKeyStepId, async (input: LinkWorkflowInput, { container }) => { diff --git a/packages/core/core-flows/src/api-key/steps/revoke-api-keys.ts b/packages/core/core-flows/src/api-key/steps/revoke-api-keys.ts index 3d0dd61174..9487da0106 100644 --- a/packages/core/core-flows/src/api-key/steps/revoke-api-keys.ts +++ b/packages/core/core-flows/src/api-key/steps/revoke-api-keys.ts @@ -6,12 +6,15 @@ import { import { ModuleRegistrationName } from "@medusajs/utils" import { StepResponse, createStep } from "@medusajs/workflows-sdk" -type RevokeApiKeysStepInput = { +export type RevokeApiKeysStepInput = { selector: FilterableApiKeyProps revoke: RevokeApiKeyDTO } export const revokeApiKeysStepId = "revoke-api-keys" +/** + * This step revokes one or more API keys. + */ export const revokeApiKeysStep = createStep( { name: revokeApiKeysStepId, noCompensation: true }, async (data: RevokeApiKeysStepInput, { container }) => { diff --git a/packages/core/core-flows/src/api-key/steps/update-api-keys.ts b/packages/core/core-flows/src/api-key/steps/update-api-keys.ts index 07ae1d8e7d..dc7b3b7ba6 100644 --- a/packages/core/core-flows/src/api-key/steps/update-api-keys.ts +++ b/packages/core/core-flows/src/api-key/steps/update-api-keys.ts @@ -9,12 +9,15 @@ import { } from "@medusajs/utils" import { StepResponse, createStep } from "@medusajs/workflows-sdk" -type UpdateApiKeysStepInput = { +export type UpdateApiKeysStepInput = { selector: FilterableApiKeyProps update: UpdateApiKeyDTO } export const updateApiKeysStepId = "update-api-keys" +/** + * This step updates one or more API keys. + */ export const updateApiKeysStep = createStep( updateApiKeysStepId, async (data: UpdateApiKeysStepInput, { container }) => { diff --git a/packages/core/core-flows/src/api-key/steps/validate-sales-channel-exists.ts b/packages/core/core-flows/src/api-key/steps/validate-sales-channel-exists.ts index 4d06ad83c4..a54f636987 100644 --- a/packages/core/core-flows/src/api-key/steps/validate-sales-channel-exists.ts +++ b/packages/core/core-flows/src/api-key/steps/validate-sales-channel-exists.ts @@ -6,14 +6,17 @@ import { } from "@medusajs/utils" import { StepResponse, createStep } from "@medusajs/workflows-sdk" -interface StepInput { +export interface ValidateSalesChannelsExistStepInput { sales_channel_ids: string[] } export const validateSalesChannelsExistStepId = "validate-sales-channels-exist" +/** + * This step validates that a sales channel exists before linking it to an API key. + */ export const validateSalesChannelsExistStep = createStep( validateSalesChannelsExistStepId, - async (data: StepInput, { container }) => { + async (data: ValidateSalesChannelsExistStepInput, { container }) => { const salesChannelModuleService = container.resolve( ModuleRegistrationName.SALES_CHANNEL diff --git a/packages/core/core-flows/src/api-key/workflows/create-api-keys.ts b/packages/core/core-flows/src/api-key/workflows/create-api-keys.ts index dd5fad41e6..443417db82 100644 --- a/packages/core/core-flows/src/api-key/workflows/create-api-keys.ts +++ b/packages/core/core-flows/src/api-key/workflows/create-api-keys.ts @@ -6,12 +6,15 @@ import { } from "@medusajs/workflows-sdk" import { createApiKeysStep } from "../steps" -type WorkflowInput = { api_keys: CreateApiKeyDTO[] } +export type CreateApiKeysWorkflowInput = { api_keys: CreateApiKeyDTO[] } export const createApiKeysWorkflowId = "create-api-keys" +/** + * This workflow creates one or more API keys. + */ export const createApiKeysWorkflow = createWorkflow( createApiKeysWorkflowId, - (input: WorkflowData): WorkflowResponse => { + (input: WorkflowData): WorkflowResponse => { return new WorkflowResponse(createApiKeysStep(input)) } ) diff --git a/packages/core/core-flows/src/api-key/workflows/delete-api-keys.ts b/packages/core/core-flows/src/api-key/workflows/delete-api-keys.ts index 3e049c4913..74f97e2ebd 100644 --- a/packages/core/core-flows/src/api-key/workflows/delete-api-keys.ts +++ b/packages/core/core-flows/src/api-key/workflows/delete-api-keys.ts @@ -3,12 +3,15 @@ import { removeRemoteLinkStep } from "../../common/steps/remove-remote-links" import { deleteApiKeysStep } from "../steps" import { Modules } from "@medusajs/utils" -type WorkflowInput = { ids: string[] } +export type DeleteApiKeysWorkflowInput = { ids: string[] } export const deleteApiKeysWorkflowId = "delete-api-keys" +/** + * This workflow deletes one or more API keys. + */ export const deleteApiKeysWorkflow = createWorkflow( deleteApiKeysWorkflowId, - (input: WorkflowData): WorkflowData => { + (input: WorkflowData): WorkflowData => { deleteApiKeysStep(input.ids) // Please note, the ids here should be publishable key IDs diff --git a/packages/core/core-flows/src/api-key/workflows/link-sales-channels-to-publishable-key.ts b/packages/core/core-flows/src/api-key/workflows/link-sales-channels-to-publishable-key.ts index 6b5e1b7aad..82cd895fdc 100644 --- a/packages/core/core-flows/src/api-key/workflows/link-sales-channels-to-publishable-key.ts +++ b/packages/core/core-flows/src/api-key/workflows/link-sales-channels-to-publishable-key.ts @@ -7,6 +7,9 @@ import { export const linkSalesChannelsToApiKeyWorkflowId = "link-sales-channels-to-api-key" +/** + * This workflow links sales channels to API keys. + */ export const linkSalesChannelsToApiKeyWorkflow = createWorkflow( linkSalesChannelsToApiKeyWorkflowId, (input: WorkflowData) => { diff --git a/packages/core/core-flows/src/api-key/workflows/revoke-api-keys.ts b/packages/core/core-flows/src/api-key/workflows/revoke-api-keys.ts index aabdcea48b..57311b7de5 100644 --- a/packages/core/core-flows/src/api-key/workflows/revoke-api-keys.ts +++ b/packages/core/core-flows/src/api-key/workflows/revoke-api-keys.ts @@ -10,17 +10,18 @@ import { } from "@medusajs/workflows-sdk" import { revokeApiKeysStep } from "../steps" -type RevokeApiKeysStepInput = { +export type RevokeApiKeysWorkflowInput = { selector: FilterableApiKeyProps revoke: RevokeApiKeyDTO } -type WorkflowInput = RevokeApiKeysStepInput - export const revokeApiKeysWorkflowId = "revoke-api-keys" +/** + * This workflow revokes one or more API keys. + */ export const revokeApiKeysWorkflow = createWorkflow( revokeApiKeysWorkflowId, - (input: WorkflowData): WorkflowResponse => { + (input: WorkflowData): WorkflowResponse => { return new WorkflowResponse(revokeApiKeysStep(input)) } ) diff --git a/packages/core/core-flows/src/api-key/workflows/update-api-keys.ts b/packages/core/core-flows/src/api-key/workflows/update-api-keys.ts index f4c9be97e0..a3688b8325 100644 --- a/packages/core/core-flows/src/api-key/workflows/update-api-keys.ts +++ b/packages/core/core-flows/src/api-key/workflows/update-api-keys.ts @@ -10,17 +10,18 @@ import { } from "@medusajs/workflows-sdk" import { updateApiKeysStep } from "../steps" -type UpdateApiKeysStepInput = { +export type UpdateApiKeysWorkflowInput = { selector: FilterableApiKeyProps update: UpdateApiKeyDTO } -type WorkflowInput = UpdateApiKeysStepInput - export const updateApiKeysWorkflowId = "update-api-keys" +/** + * This workflow creates one or more API keys. + */ export const updateApiKeysWorkflow = createWorkflow( updateApiKeysWorkflowId, - (input: WorkflowData): WorkflowResponse => { + (input: WorkflowData): WorkflowResponse => { return new WorkflowResponse(updateApiKeysStep(input)) } ) diff --git a/packages/core/core-flows/src/auth/steps/set-auth-app-metadata.ts b/packages/core/core-flows/src/auth/steps/set-auth-app-metadata.ts index 969e7ba254..164d36fb4c 100644 --- a/packages/core/core-flows/src/auth/steps/set-auth-app-metadata.ts +++ b/packages/core/core-flows/src/auth/steps/set-auth-app-metadata.ts @@ -3,16 +3,19 @@ import { createStep, StepResponse } from "@medusajs/workflows-sdk" import { IAuthModuleService } from "@medusajs/types" import { isDefined, ModuleRegistrationName } from "@medusajs/utils" -type StepInput = { +export type SetAuthAppMetadataStepInput = { authIdentityId: string actorType: string value: string } export const setAuthAppMetadataStepId = "set-auth-app-metadata" +/** + * This step sets the `app_metadata` property of an auth identity. + */ export const setAuthAppMetadataStep = createStep( setAuthAppMetadataStepId, - async (data: StepInput, { container }) => { + async (data: SetAuthAppMetadataStepInput, { container }) => { const service = container.resolve( ModuleRegistrationName.AUTH ) diff --git a/packages/core/core-flows/src/common/workflows/batch-links.ts b/packages/core/core-flows/src/common/workflows/batch-links.ts index d5e7d7f887..9e94830dc0 100644 --- a/packages/core/core-flows/src/common/workflows/batch-links.ts +++ b/packages/core/core-flows/src/common/workflows/batch-links.ts @@ -11,6 +11,9 @@ import { dismissRemoteLinkStep } from "../steps/dismiss-remote-links" import { updateRemoteLinksStep } from "../steps/update-remote-links" export const batchLinksWorkflowId = "batch-links" +/** + * This workflow manages one or more links to create, update, or dismiss them. + */ export const batchLinksWorkflow = createWorkflow( batchLinksWorkflowId, ( diff --git a/packages/core/core-flows/src/common/workflows/create-links.ts b/packages/core/core-flows/src/common/workflows/create-links.ts index 39023973f7..d9b9d3ae40 100644 --- a/packages/core/core-flows/src/common/workflows/create-links.ts +++ b/packages/core/core-flows/src/common/workflows/create-links.ts @@ -7,6 +7,9 @@ import { import { createRemoteLinkStep } from "../steps/create-remote-links" export const createLinksWorkflowId = "create-link" +/** + * This workflow creates one or more links between records. + */ export const createLinksWorkflow = createWorkflow( createLinksWorkflowId, (input: WorkflowData) => { diff --git a/packages/core/core-flows/src/common/workflows/dismiss-links.ts b/packages/core/core-flows/src/common/workflows/dismiss-links.ts index 95ad9cde26..3e31fb4bca 100644 --- a/packages/core/core-flows/src/common/workflows/dismiss-links.ts +++ b/packages/core/core-flows/src/common/workflows/dismiss-links.ts @@ -7,6 +7,9 @@ import { import { dismissRemoteLinkStep } from "../steps/dismiss-remote-links" export const dismissLinksWorkflowId = "dismiss-link" +/** + * This workflow dismisses one or more links between records. + */ export const dismissLinksWorkflow = createWorkflow( dismissLinksWorkflowId, (input: WorkflowData) => { diff --git a/packages/core/core-flows/src/common/workflows/update-links.ts b/packages/core/core-flows/src/common/workflows/update-links.ts index 38305e6afa..e4b2688a47 100644 --- a/packages/core/core-flows/src/common/workflows/update-links.ts +++ b/packages/core/core-flows/src/common/workflows/update-links.ts @@ -7,6 +7,9 @@ import { import { updateRemoteLinksStep } from "../steps/update-remote-links" export const updateLinksWorkflowId = "update-link" +/** + * This workflow updates one or more links between records. + */ export const updateLinksWorkflow = createWorkflow( updateLinksWorkflowId, (input: WorkflowData) => { diff --git a/packages/core/core-flows/src/customer/steps/create-addresses.ts b/packages/core/core-flows/src/customer/steps/create-addresses.ts index afac1b0793..ef8ebae060 100644 --- a/packages/core/core-flows/src/customer/steps/create-addresses.ts +++ b/packages/core/core-flows/src/customer/steps/create-addresses.ts @@ -6,6 +6,9 @@ import { ModuleRegistrationName } from "@medusajs/utils" import { StepResponse, createStep } from "@medusajs/workflows-sdk" export const createCustomerAddressesStepId = "create-customer-addresses" +/** + * This step creates one or more customer addresses. + */ export const createCustomerAddressesStep = createStep( createCustomerAddressesStepId, async (data: CreateCustomerAddressDTO[], { container }) => { diff --git a/packages/core/core-flows/src/customer/steps/create-customers.ts b/packages/core/core-flows/src/customer/steps/create-customers.ts index 615650ad2b..42d7bfabc3 100644 --- a/packages/core/core-flows/src/customer/steps/create-customers.ts +++ b/packages/core/core-flows/src/customer/steps/create-customers.ts @@ -3,6 +3,9 @@ import { ModuleRegistrationName } from "@medusajs/utils" import { StepResponse, createStep } from "@medusajs/workflows-sdk" export const createCustomersStepId = "create-customers" +/** + * This step creates one or more customers. + */ export const createCustomersStep = createStep( createCustomersStepId, async (data: CreateCustomerDTO[], { container }) => { diff --git a/packages/core/core-flows/src/customer/steps/delete-addresses.ts b/packages/core/core-flows/src/customer/steps/delete-addresses.ts index e2bd8a4a62..0568ce2eff 100644 --- a/packages/core/core-flows/src/customer/steps/delete-addresses.ts +++ b/packages/core/core-flows/src/customer/steps/delete-addresses.ts @@ -2,11 +2,13 @@ import { ICustomerModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/utils" import { createStep, StepResponse } from "@medusajs/workflows-sdk" -type DeleteCustomerAddressStepInput = string[] export const deleteCustomerAddressesStepId = "delete-customer-addresses" +/** + * This step deletes one or more customer addresses. + */ export const deleteCustomerAddressesStep = createStep( deleteCustomerAddressesStepId, - async (ids: DeleteCustomerAddressStepInput, { container }) => { + async (ids: string[], { container }) => { const service = container.resolve( ModuleRegistrationName.CUSTOMER ) diff --git a/packages/core/core-flows/src/customer/steps/delete-customers.ts b/packages/core/core-flows/src/customer/steps/delete-customers.ts index c777162d23..1829693522 100644 --- a/packages/core/core-flows/src/customer/steps/delete-customers.ts +++ b/packages/core/core-flows/src/customer/steps/delete-customers.ts @@ -2,12 +2,13 @@ import { ICustomerModuleService } from "@medusajs/types" import { ModuleRegistrationName } from "@medusajs/utils" import { createStep, StepResponse } from "@medusajs/workflows-sdk" -type DeleteCustomerStepInput = string[] - export const deleteCustomersStepId = "delete-customers" +/** + * This step deletes one or more customers. + */ export const deleteCustomersStep = createStep( deleteCustomersStepId, - async (ids: DeleteCustomerStepInput, { container }) => { + async (ids: string[], { container }) => { const service = container.resolve( ModuleRegistrationName.CUSTOMER ) diff --git a/packages/core/core-flows/src/customer/steps/maybe-unset-default-billing-addresses.ts b/packages/core/core-flows/src/customer/steps/maybe-unset-default-billing-addresses.ts index d96a160bd6..d7e20f2829 100644 --- a/packages/core/core-flows/src/customer/steps/maybe-unset-default-billing-addresses.ts +++ b/packages/core/core-flows/src/customer/steps/maybe-unset-default-billing-addresses.ts @@ -8,7 +8,7 @@ import { ModuleRegistrationName, isDefined } from "@medusajs/utils" import { createStep } from "@medusajs/workflows-sdk" import { unsetForCreate, unsetForUpdate } from "./utils" -type StepInput = { +export type MaybeUnsetDefaultBillingAddressStepInput = { create?: CreateCustomerAddressDTO[] update?: { selector: FilterableCustomerAddressProps @@ -18,9 +18,12 @@ type StepInput = { export const maybeUnsetDefaultBillingAddressesStepId = "maybe-unset-default-billing-customer-addresses" +/** + * This step unsets the `is_default_billing` property of one or more addresses. + */ export const maybeUnsetDefaultBillingAddressesStep = createStep( maybeUnsetDefaultBillingAddressesStepId, - async (data: StepInput, { container }) => { + async (data: MaybeUnsetDefaultBillingAddressStepInput, { container }) => { const customerModuleService = container.resolve( ModuleRegistrationName.CUSTOMER ) diff --git a/packages/core/core-flows/src/customer/steps/maybe-unset-default-shipping-addresses.ts b/packages/core/core-flows/src/customer/steps/maybe-unset-default-shipping-addresses.ts index 50a8fc5326..3d967f04ca 100644 --- a/packages/core/core-flows/src/customer/steps/maybe-unset-default-shipping-addresses.ts +++ b/packages/core/core-flows/src/customer/steps/maybe-unset-default-shipping-addresses.ts @@ -8,7 +8,7 @@ import { ModuleRegistrationName, isDefined } from "@medusajs/utils" import { createStep } from "@medusajs/workflows-sdk" import { unsetForCreate, unsetForUpdate } from "./utils" -type StepInput = { +export type MaybeUnsetDefaultShippingAddressesStepInput = { create?: CreateCustomerAddressDTO[] update?: { selector: FilterableCustomerAddressProps @@ -18,9 +18,12 @@ type StepInput = { export const maybeUnsetDefaultShippingAddressesStepId = "maybe-unset-default-shipping-customer-addresses" +/** + * This step unsets the `is_default_shipping` property of one or more addresses. + */ export const maybeUnsetDefaultShippingAddressesStep = createStep( maybeUnsetDefaultShippingAddressesStepId, - async (data: StepInput, { container }) => { + async (data: MaybeUnsetDefaultShippingAddressesStepInput, { container }) => { const customerModuleService = container.resolve( ModuleRegistrationName.CUSTOMER ) diff --git a/packages/core/core-flows/src/customer/steps/update-addresses.ts b/packages/core/core-flows/src/customer/steps/update-addresses.ts index 031808256b..a89f6efedd 100644 --- a/packages/core/core-flows/src/customer/steps/update-addresses.ts +++ b/packages/core/core-flows/src/customer/steps/update-addresses.ts @@ -10,12 +10,15 @@ import { } from "@medusajs/utils" import { StepResponse, createStep } from "@medusajs/workflows-sdk" -type UpdateCustomerAddresseStepInput = { +export type UpdateCustomerAddresseStepInput = { selector: FilterableCustomerAddressProps update: UpdateCustomerAddressDTO } export const updateCustomerAddresseStepId = "update-customer-addresses" +/** + * This step updates one or more customer addresses. + */ export const updateCustomerAddressesStep = createStep( updateCustomerAddresseStepId, async (data: UpdateCustomerAddresseStepInput, { container }) => { diff --git a/packages/core/core-flows/src/customer/steps/update-customers.ts b/packages/core/core-flows/src/customer/steps/update-customers.ts index 61871ddd45..2d435229de 100644 --- a/packages/core/core-flows/src/customer/steps/update-customers.ts +++ b/packages/core/core-flows/src/customer/steps/update-customers.ts @@ -10,12 +10,15 @@ import { } from "@medusajs/utils" import { StepResponse, createStep } from "@medusajs/workflows-sdk" -type UpdateCustomersStepInput = { +export type UpdateCustomersStepInput = { selector: FilterableCustomerProps update: CustomerUpdatableFields } export const updateCustomersStepId = "update-customer" +/** + * This step updates one or more customers. + */ export const updateCustomersStep = createStep( updateCustomersStepId, async (data: UpdateCustomersStepInput, { container }) => { diff --git a/packages/core/core-flows/src/customer/workflows/create-addresses.ts b/packages/core/core-flows/src/customer/workflows/create-addresses.ts index c3cb742078..8f87acd7f3 100644 --- a/packages/core/core-flows/src/customer/workflows/create-addresses.ts +++ b/packages/core/core-flows/src/customer/workflows/create-addresses.ts @@ -13,12 +13,15 @@ import { maybeUnsetDefaultShippingAddressesStep, } from "../steps" -type WorkflowInput = { addresses: CreateCustomerAddressDTO[] } & AdditionalData +export type CreateCustomerAddressesWorkflowInput = { addresses: CreateCustomerAddressDTO[] } & AdditionalData export const createCustomerAddressesWorkflowId = "create-customer-addresses" +/** + * This workflow creates one or more customer address. + */ export const createCustomerAddressesWorkflow = createWorkflow( createCustomerAddressesWorkflowId, - (input: WorkflowData) => { + (input: WorkflowData) => { const unsetInput = transform(input, (data) => ({ create: data.addresses, })) diff --git a/packages/core/core-flows/src/customer/workflows/create-customer-account.ts b/packages/core/core-flows/src/customer/workflows/create-customer-account.ts index 567d5ceee8..269fc71a34 100644 --- a/packages/core/core-flows/src/customer/workflows/create-customer-account.ts +++ b/packages/core/core-flows/src/customer/workflows/create-customer-account.ts @@ -8,15 +8,18 @@ import { createCustomersStep } from "../steps" import { transform } from "@medusajs/workflows-sdk" import { setAuthAppMetadataStep } from "../../auth" -type WorkflowInput = { +export type CreateCustomerAccountWorkflowInput = { authIdentityId: string customersData: CreateCustomerDTO } export const createCustomerAccountWorkflowId = "create-customer-account" +/** + * This workflow creates an authentication account for a customer. + */ export const createCustomerAccountWorkflow = createWorkflow( createCustomerAccountWorkflowId, - (input: WorkflowData): WorkflowResponse => { + (input: WorkflowData): WorkflowResponse => { const customers = createCustomersStep([input.customersData]) const customer = transform( diff --git a/packages/core/core-flows/src/customer/workflows/create-customers.ts b/packages/core/core-flows/src/customer/workflows/create-customers.ts index 7a6974b8aa..4be02e0ca5 100644 --- a/packages/core/core-flows/src/customer/workflows/create-customers.ts +++ b/packages/core/core-flows/src/customer/workflows/create-customers.ts @@ -7,13 +7,15 @@ import { } from "@medusajs/workflows-sdk" import { createCustomersStep } from "../steps" -type WorkflowInput = { customersData: CreateCustomerDTO[] } & AdditionalData +export type CreateCustomersWorkflowInput = { customersData: CreateCustomerDTO[] } & AdditionalData export const createCustomersWorkflowId = "create-customers" - +/** + * This workflow creates one or more customers. + */ export const createCustomersWorkflow = createWorkflow( createCustomersWorkflowId, - (input: WorkflowData) => { + (input: WorkflowData) => { const createdCustomers = createCustomersStep(input.customersData) const customersCreated = createHook("customersCreated", { customers: createdCustomers, diff --git a/packages/core/core-flows/src/customer/workflows/delete-addresses.ts b/packages/core/core-flows/src/customer/workflows/delete-addresses.ts index 77d4f15345..4ac964aff0 100644 --- a/packages/core/core-flows/src/customer/workflows/delete-addresses.ts +++ b/packages/core/core-flows/src/customer/workflows/delete-addresses.ts @@ -6,12 +6,15 @@ import { } from "@medusajs/workflows-sdk" import { deleteCustomerAddressesStep } from "../steps" -type WorkflowInput = { ids: string[] } +export type DeleteCustomerAddressesWorkflowInput = { ids: string[] } export const deleteCustomerAddressesWorkflowId = "delete-customer-addresses" +/** + * This workflow deletes one or more customer addresses. + */ export const deleteCustomerAddressesWorkflow = createWorkflow( deleteCustomerAddressesWorkflowId, - (input: WorkflowData) => { + (input: WorkflowData) => { const deletedAddresses = deleteCustomerAddressesStep(input.ids) const addressesDeleted = createHook("addressesDeleted", { ids: input.ids, diff --git a/packages/core/core-flows/src/customer/workflows/delete-customers.ts b/packages/core/core-flows/src/customer/workflows/delete-customers.ts index d6128bdc04..1232bc3516 100644 --- a/packages/core/core-flows/src/customer/workflows/delete-customers.ts +++ b/packages/core/core-flows/src/customer/workflows/delete-customers.ts @@ -6,12 +6,15 @@ import { } from "@medusajs/workflows-sdk" import { deleteCustomersStep } from "../steps" -type WorkflowInput = { ids: string[] } +export type DeleteCustomersWorkflowInput = { ids: string[] } export const deleteCustomersWorkflowId = "delete-customers" +/** + * This workflow deletes one or more customers. + */ export const deleteCustomersWorkflow = createWorkflow( deleteCustomersWorkflowId, - (input: WorkflowData) => { + (input: WorkflowData) => { const deletedCustomers = deleteCustomersStep(input.ids) const customersDeleted = createHook("customersDeleted", { ids: input.ids, diff --git a/packages/core/core-flows/src/customer/workflows/update-addresses.ts b/packages/core/core-flows/src/customer/workflows/update-addresses.ts index fb1fe63018..570c73c9f0 100644 --- a/packages/core/core-flows/src/customer/workflows/update-addresses.ts +++ b/packages/core/core-flows/src/customer/workflows/update-addresses.ts @@ -17,15 +17,18 @@ import { updateCustomerAddressesStep, } from "../steps" -type WorkflowInput = { +export type UpdateCustomerAddressesWorkflowInput = { selector: FilterableCustomerAddressProps update: UpdateCustomerAddressDTO } & AdditionalData export const updateCustomerAddressesWorkflowId = "update-customer-addresses" +/** + * This workflow updates one or more customer addresses. + */ export const updateCustomerAddressesWorkflow = createWorkflow( updateCustomerAddressesWorkflowId, - (input: WorkflowData) => { + (input: WorkflowData) => { const unsetInput = transform(input, (data) => ({ update: data, })) diff --git a/packages/core/core-flows/src/customer/workflows/update-customers.ts b/packages/core/core-flows/src/customer/workflows/update-customers.ts index 04d2b6e72f..557c39e3e3 100644 --- a/packages/core/core-flows/src/customer/workflows/update-customers.ts +++ b/packages/core/core-flows/src/customer/workflows/update-customers.ts @@ -11,17 +11,18 @@ import { } from "@medusajs/workflows-sdk" import { updateCustomersStep } from "../steps" -type UpdateCustomersStepInput = { +export type UpdateCustomersWorkflowInput = { selector: FilterableCustomerProps update: CustomerUpdatableFields } & AdditionalData -type WorkflowInput = UpdateCustomersStepInput - export const updateCustomersWorkflowId = "update-customers" +/** + * This workflow updates one or more customers. + */ export const updateCustomersWorkflow = createWorkflow( updateCustomersWorkflowId, - (input: WorkflowData) => { + (input: WorkflowData) => { const updatedCustomers = updateCustomersStep(input) const customersUpdated = createHook("customersUpdated", { customers: updatedCustomers,