@medusajs/core-flows
Version:
Set of workflow definitions for Medusa
56 lines • 3.15 kB
TypeScript
import { FilterableCustomerAddressProps, UpdateCustomerAddressDTO, AdditionalData } from "@medusajs/framework/types";
import { WorkflowData } from "@medusajs/framework/workflows-sdk";
/**
* The data to update one or more customer addresses, along with custom data that's passed to the workflow's hooks.
*/
export type UpdateCustomerAddressesWorkflowInput = {
/**
* The filters to select the addresses to update.
*/
selector: FilterableCustomerAddressProps;
/**
* The data to update in the addresses.
*/
update: UpdateCustomerAddressDTO;
} & AdditionalData;
export declare const updateCustomerAddressesWorkflowId = "update-customer-addresses";
/**
* This workflow updates one or more addresses for customers. It's used by the [Update Customer Address Admin API Route](https://docs.medusajs.com/api/admin#customers_postcustomersidaddressesaddress_id)
* and the [Update Customer Address Store API Route](https://docs.medusajs.com/api/store#customers_postcustomersmeaddressesaddress_id).
*
* This workflow has a hook that allows you to perform custom actions on the updated customer addresses. For example, you can pass under `additional_data` custom data that
* allows you to update custom data models linked to the addresses.
*
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around updating customer addresses.
*
* @example
* const { result } = await updateCustomerAddressesWorkflow(container)
* .run({
* input: {
* selector: {
* customer_id: "123"
* },
* update: {
* first_name: "John"
* },
* additional_data: {
* crm_id: "123"
* }
* }
* })
*
* @summary
*
* Update one or more customer addresses.
*
* @property hooks.addressesUpdated - This hook is executed after the addresses are updated. You can consume this hook to perform custom actions on the updated addresses.
*/
export declare const updateCustomerAddressesWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<UpdateCustomerAddressesWorkflowInput, import("@medusajs/framework/types").CustomerAddressDTO[], [import("@medusajs/framework/workflows-sdk").Hook<"addressesUpdated", {
addresses: (import("@medusajs/framework/types").CustomerAddressDTO | WorkflowData<import("@medusajs/framework/types").CustomerAddressDTO>)[] & import("@medusajs/framework/types").CustomerAddressDTO[] & import("@medusajs/framework/workflows-sdk").WorkflowDataProperties<import("@medusajs/framework/types").CustomerAddressDTO[]> & {
config(config: {
name?: string;
} & Omit<import("@medusajs/orchestration").TransactionStepsDefinition, "next" | "uuid" | "action">): WorkflowData<import("@medusajs/framework/types").CustomerAddressDTO[]>;
} & import("@medusajs/framework/workflows-sdk").StepFunctionReturnConfig<import("@medusajs/framework/types").CustomerAddressDTO[]>;
additional_data: ((Record<string, unknown> | WorkflowData<Record<string, unknown> | undefined>) & Record<string, unknown>) | undefined;
}, unknown>]>;
//# sourceMappingURL=update-addresses.d.ts.map