@acmekit/core-flows 2.13.14 → 2.13.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-key/steps/create-api-keys.d.ts +2 -2
- package/dist/api-key/steps/create-api-keys.js +2 -2
- package/dist/api-key/workflows/create-api-keys.d.ts +5 -15
- package/dist/api-key/workflows/create-api-keys.d.ts.map +1 -1
- package/dist/api-key/workflows/create-api-keys.js +5 -15
- package/dist/api-key/workflows/create-api-keys.js.map +1 -1
- package/dist/api-key/workflows/delete-api-keys.d.ts +2 -2
- package/dist/api-key/workflows/delete-api-keys.d.ts.map +1 -1
- package/dist/api-key/workflows/delete-api-keys.js +2 -3
- package/dist/api-key/workflows/delete-api-keys.js.map +1 -1
- package/dist/api-key/workflows/revoke-api-keys.d.ts +2 -2
- package/dist/api-key/workflows/revoke-api-keys.js +2 -2
- package/dist/api-key/workflows/update-api-keys.d.ts +2 -2
- package/dist/api-key/workflows/update-api-keys.js +2 -2
- package/dist/defaults/steps/index.d.ts +1 -1
- package/dist/defaults/steps/index.d.ts.map +1 -1
- package/dist/defaults/steps/index.js +1 -15
- package/dist/defaults/steps/index.js.map +1 -1
- package/dist/defaults/workflows/create-defaults.d.ts +7 -11
- package/dist/defaults/workflows/create-defaults.d.ts.map +1 -1
- package/dist/defaults/workflows/create-defaults.js +12 -20
- package/dist/defaults/workflows/create-defaults.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/customer/index.d.ts +0 -3
- package/dist/customer/index.d.ts.map +0 -1
- package/dist/customer/index.js +0 -19
- package/dist/customer/index.js.map +0 -1
- package/dist/customer/steps/create-addresses.d.ts +0 -25
- package/dist/customer/steps/create-addresses.d.ts.map +0 -1
- package/dist/customer/steps/create-addresses.js +0 -35
- package/dist/customer/steps/create-addresses.js.map +0 -1
- package/dist/customer/steps/create-customers.d.ts +0 -20
- package/dist/customer/steps/create-customers.d.ts.map +0 -1
- package/dist/customer/steps/create-customers.js +0 -30
- package/dist/customer/steps/create-customers.js.map +0 -1
- package/dist/customer/steps/delete-addresses.d.ts +0 -10
- package/dist/customer/steps/delete-addresses.d.ts.map +0 -1
- package/dist/customer/steps/delete-addresses.js +0 -24
- package/dist/customer/steps/delete-addresses.js.map +0 -1
- package/dist/customer/steps/delete-customers.d.ts +0 -10
- package/dist/customer/steps/delete-customers.d.ts.map +0 -1
- package/dist/customer/steps/delete-customers.js +0 -21
- package/dist/customer/steps/delete-customers.js.map +0 -1
- package/dist/customer/steps/index.d.ts +0 -10
- package/dist/customer/steps/index.d.ts.map +0 -1
- package/dist/customer/steps/index.js +0 -26
- package/dist/customer/steps/index.js.map +0 -1
- package/dist/customer/steps/maybe-unset-default-billing-addresses.d.ts +0 -57
- package/dist/customer/steps/maybe-unset-default-billing-addresses.d.ts.map +0 -1
- package/dist/customer/steps/maybe-unset-default-billing-addresses.js +0 -51
- package/dist/customer/steps/maybe-unset-default-billing-addresses.js.map +0 -1
- package/dist/customer/steps/maybe-unset-default-shipping-addresses.d.ts +0 -57
- package/dist/customer/steps/maybe-unset-default-shipping-addresses.d.ts.map +0 -1
- package/dist/customer/steps/maybe-unset-default-shipping-addresses.js +0 -51
- package/dist/customer/steps/maybe-unset-default-shipping-addresses.js.map +0 -1
- package/dist/customer/steps/update-addresses.d.ts +0 -30
- package/dist/customer/steps/update-addresses.d.ts.map +0 -1
- package/dist/customer/steps/update-addresses.js +0 -38
- package/dist/customer/steps/update-addresses.js.map +0 -1
- package/dist/customer/steps/update-customers.d.ts +0 -30
- package/dist/customer/steps/update-customers.d.ts.map +0 -1
- package/dist/customer/steps/update-customers.js +0 -44
- package/dist/customer/steps/update-customers.js.map +0 -1
- package/dist/customer/steps/utils/index.d.ts +0 -3
- package/dist/customer/steps/utils/index.d.ts.map +0 -1
- package/dist/customer/steps/utils/index.js +0 -19
- package/dist/customer/steps/utils/index.js.map +0 -1
- package/dist/customer/steps/utils/unset-address-for-create.d.ts +0 -4
- package/dist/customer/steps/utils/unset-address-for-create.d.ts.map +0 -1
- package/dist/customer/steps/utils/unset-address-for-create.js +0 -20
- package/dist/customer/steps/utils/unset-address-for-create.js.map +0 -1
- package/dist/customer/steps/utils/unset-address-for-update.d.ts +0 -7
- package/dist/customer/steps/utils/unset-address-for-update.d.ts.map +0 -1
- package/dist/customer/steps/utils/unset-address-for-update.js +0 -21
- package/dist/customer/steps/utils/unset-address-for-update.js.map +0 -1
- package/dist/customer/steps/validate-customer-account-creation.d.ts +0 -22
- package/dist/customer/steps/validate-customer-account-creation.d.ts.map +0 -1
- package/dist/customer/steps/validate-customer-account-creation.js +0 -43
- package/dist/customer/steps/validate-customer-account-creation.js.map +0 -1
- package/dist/customer/workflows/create-addresses.d.ts +0 -66
- package/dist/customer/workflows/create-addresses.d.ts.map +0 -1
- package/dist/customer/workflows/create-addresses.js +0 -66
- package/dist/customer/workflows/create-addresses.js.map +0 -1
- package/dist/customer/workflows/create-customer-account.d.ts +0 -44
- package/dist/customer/workflows/create-customer-account.d.ts.map +0 -1
- package/dist/customer/workflows/create-customer-account.js +0 -57
- package/dist/customer/workflows/create-customer-account.js.map +0 -1
- package/dist/customer/workflows/create-customers.d.ts +0 -51
- package/dist/customer/workflows/create-customers.d.ts.map +0 -1
- package/dist/customer/workflows/create-customers.js +0 -58
- package/dist/customer/workflows/create-customers.js.map +0 -1
- package/dist/customer/workflows/delete-addresses.d.ts +0 -47
- package/dist/customer/workflows/delete-addresses.d.ts.map +0 -1
- package/dist/customer/workflows/delete-addresses.js +0 -48
- package/dist/customer/workflows/delete-addresses.js.map +0 -1
- package/dist/customer/workflows/delete-customers.d.ts +0 -38
- package/dist/customer/workflows/delete-customers.d.ts.map +0 -1
- package/dist/customer/workflows/delete-customers.js +0 -50
- package/dist/customer/workflows/delete-customers.js.map +0 -1
- package/dist/customer/workflows/index.d.ts +0 -9
- package/dist/customer/workflows/index.d.ts.map +0 -1
- package/dist/customer/workflows/index.js +0 -25
- package/dist/customer/workflows/index.js.map +0 -1
- package/dist/customer/workflows/remove-customer-account.d.ts +0 -32
- package/dist/customer/workflows/remove-customer-account.d.ts.map +0 -1
- package/dist/customer/workflows/remove-customer-account.js +0 -78
- package/dist/customer/workflows/remove-customer-account.js.map +0 -1
- package/dist/customer/workflows/update-addresses.d.ts +0 -56
- package/dist/customer/workflows/update-addresses.d.ts.map +0 -1
- package/dist/customer/workflows/update-addresses.js +0 -52
- package/dist/customer/workflows/update-addresses.js.map +0 -1
- package/dist/customer/workflows/update-customers.d.ts +0 -53
- package/dist/customer/workflows/update-customers.d.ts.map +0 -1
- package/dist/customer/workflows/update-customers.js +0 -59
- package/dist/customer/workflows/update-customers.js.map +0 -1
- package/dist/customer-group/index.d.ts +0 -3
- package/dist/customer-group/index.d.ts.map +0 -1
- package/dist/customer-group/index.js +0 -19
- package/dist/customer-group/index.js.map +0 -1
- package/dist/customer-group/steps/create-customer-groups.d.ts +0 -11
- package/dist/customer-group/steps/create-customer-groups.d.ts.map +0 -1
- package/dist/customer-group/steps/create-customer-groups.js +0 -21
- package/dist/customer-group/steps/create-customer-groups.js.map +0 -1
- package/dist/customer-group/steps/delete-customer-group-customers.d.ts +0 -7
- package/dist/customer-group/steps/delete-customer-group-customers.d.ts.map +0 -1
- package/dist/customer-group/steps/delete-customer-group-customers.js +0 -21
- package/dist/customer-group/steps/delete-customer-group-customers.js.map +0 -1
- package/dist/customer-group/steps/delete-customer-groups.d.ts +0 -10
- package/dist/customer-group/steps/delete-customer-groups.d.ts.map +0 -1
- package/dist/customer-group/steps/delete-customer-groups.js +0 -21
- package/dist/customer-group/steps/delete-customer-groups.js.map +0 -1
- package/dist/customer-group/steps/index.d.ts +0 -6
- package/dist/customer-group/steps/index.d.ts.map +0 -1
- package/dist/customer-group/steps/index.js +0 -22
- package/dist/customer-group/steps/index.js.map +0 -1
- package/dist/customer-group/steps/link-customer-groups-customer.d.ts +0 -14
- package/dist/customer-group/steps/link-customer-groups-customer.d.ts.map +0 -1
- package/dist/customer-group/steps/link-customer-groups-customer.js +0 -52
- package/dist/customer-group/steps/link-customer-groups-customer.js.map +0 -1
- package/dist/customer-group/steps/link-customers-customer-group.d.ts +0 -14
- package/dist/customer-group/steps/link-customers-customer-group.d.ts.map +0 -1
- package/dist/customer-group/steps/link-customers-customer-group.js +0 -52
- package/dist/customer-group/steps/link-customers-customer-group.js.map +0 -1
- package/dist/customer-group/steps/update-customer-groups.d.ts +0 -30
- package/dist/customer-group/steps/update-customer-groups.d.ts.map +0 -1
- package/dist/customer-group/steps/update-customer-groups.js +0 -41
- package/dist/customer-group/steps/update-customer-groups.js.map +0 -1
- package/dist/customer-group/workflows/create-customer-groups.d.ts +0 -41
- package/dist/customer-group/workflows/create-customer-groups.d.ts.map +0 -1
- package/dist/customer-group/workflows/create-customer-groups.js +0 -34
- package/dist/customer-group/workflows/create-customer-groups.js.map +0 -1
- package/dist/customer-group/workflows/delete-customer-groups.d.ts +0 -31
- package/dist/customer-group/workflows/delete-customer-groups.d.ts.map +0 -1
- package/dist/customer-group/workflows/delete-customer-groups.js +0 -29
- package/dist/customer-group/workflows/delete-customer-groups.js.map +0 -1
- package/dist/customer-group/workflows/index.d.ts +0 -6
- package/dist/customer-group/workflows/index.d.ts.map +0 -1
- package/dist/customer-group/workflows/index.js +0 -22
- package/dist/customer-group/workflows/index.js.map +0 -1
- package/dist/customer-group/workflows/link-customer-groups-customer.d.ts +0 -33
- package/dist/customer-group/workflows/link-customer-groups-customer.d.ts.map +0 -1
- package/dist/customer-group/workflows/link-customer-groups-customer.js +0 -31
- package/dist/customer-group/workflows/link-customer-groups-customer.js.map +0 -1
- package/dist/customer-group/workflows/link-customers-customer-group.d.ts +0 -33
- package/dist/customer-group/workflows/link-customers-customer-group.d.ts.map +0 -1
- package/dist/customer-group/workflows/link-customers-customer-group.js +0 -31
- package/dist/customer-group/workflows/link-customers-customer-group.js.map +0 -1
- package/dist/customer-group/workflows/update-customer-groups.d.ts +0 -45
- package/dist/customer-group/workflows/update-customer-groups.d.ts.map +0 -1
- package/dist/customer-group/workflows/update-customer-groups.js +0 -34
- package/dist/customer-group/workflows/update-customer-groups.js.map +0 -1
- package/dist/defaults/steps/create-default-store.d.ts +0 -31
- package/dist/defaults/steps/create-default-store.d.ts.map +0 -1
- package/dist/defaults/steps/create-default-store.js +0 -67
- package/dist/defaults/steps/create-default-store.js.map +0 -1
- package/dist/store/index.d.ts +0 -3
- package/dist/store/index.d.ts.map +0 -1
- package/dist/store/index.js +0 -19
- package/dist/store/index.js.map +0 -1
- package/dist/store/steps/create-stores.d.ts +0 -12
- package/dist/store/steps/create-stores.d.ts.map +0 -1
- package/dist/store/steps/create-stores.js +0 -26
- package/dist/store/steps/create-stores.js.map +0 -1
- package/dist/store/steps/delete-stores.d.ts +0 -10
- package/dist/store/steps/delete-stores.d.ts.map +0 -1
- package/dist/store/steps/delete-stores.js +0 -21
- package/dist/store/steps/delete-stores.js.map +0 -1
- package/dist/store/steps/index.d.ts +0 -4
- package/dist/store/steps/index.d.ts.map +0 -1
- package/dist/store/steps/index.js +0 -20
- package/dist/store/steps/index.js.map +0 -1
- package/dist/store/steps/update-stores.d.ts +0 -30
- package/dist/store/steps/update-stores.d.ts.map +0 -1
- package/dist/store/steps/update-stores.js +0 -41
- package/dist/store/steps/update-stores.js.map +0 -1
- package/dist/store/workflows/create-stores.d.ts +0 -53
- package/dist/store/workflows/create-stores.d.ts.map +0 -1
- package/dist/store/workflows/create-stores.js +0 -51
- package/dist/store/workflows/create-stores.js.map +0 -1
- package/dist/store/workflows/delete-stores.d.ts +0 -38
- package/dist/store/workflows/delete-stores.d.ts.map +0 -1
- package/dist/store/workflows/delete-stores.js +0 -44
- package/dist/store/workflows/delete-stores.js.map +0 -1
- package/dist/store/workflows/index.d.ts +0 -4
- package/dist/store/workflows/index.d.ts.map +0 -1
- package/dist/store/workflows/index.js +0 -20
- package/dist/store/workflows/index.js.map +0 -1
- package/dist/store/workflows/update-stores.d.ts +0 -32
- package/dist/store/workflows/update-stores.d.ts.map +0 -1
- package/dist/store/workflows/update-stores.js +0 -52
- package/dist/store/workflows/update-stores.js.map +0 -1
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { WorkflowData } from "@acmekit/framework/workflows-sdk";
|
|
2
|
-
/**
|
|
3
|
-
* The details of the customers to delete.
|
|
4
|
-
*/
|
|
5
|
-
export type DeleteCustomersWorkflowInput = {
|
|
6
|
-
/**
|
|
7
|
-
* The IDs of the customers to delete.
|
|
8
|
-
*/
|
|
9
|
-
ids: string[];
|
|
10
|
-
};
|
|
11
|
-
export declare const deleteCustomersWorkflowId = "delete-customers";
|
|
12
|
-
/**
|
|
13
|
-
* This workflow deletes one or more customers. It's used by the
|
|
14
|
-
* {@link removeCustomerAccountWorkflow}.
|
|
15
|
-
*
|
|
16
|
-
* You can use this workflow within your customizations or your own custom workflows, allowing you to
|
|
17
|
-
* delete customers in your custom flows.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* const { result } = await deleteCustomersWorkflow(container)
|
|
21
|
-
* .run({
|
|
22
|
-
* input: {
|
|
23
|
-
* ids: [
|
|
24
|
-
* "cus_123",
|
|
25
|
-
* ]
|
|
26
|
-
* }
|
|
27
|
-
* })
|
|
28
|
-
*
|
|
29
|
-
* @summary
|
|
30
|
-
*
|
|
31
|
-
* Delete one or more customers.
|
|
32
|
-
*
|
|
33
|
-
* @property hooks.customersDeleted - This hook is executed after the customers are deleted. You can consume this hook to perform custom actions.
|
|
34
|
-
*/
|
|
35
|
-
export declare const deleteCustomersWorkflow: import("@acmekit/framework/workflows-sdk").ReturnWorkflow<DeleteCustomersWorkflowInput, never, [import("@acmekit/framework/workflows-sdk").Hook<"customersDeleted", {
|
|
36
|
-
ids: (string[] | WorkflowData<string[]>) & string[];
|
|
37
|
-
}, unknown>]>;
|
|
38
|
-
//# sourceMappingURL=delete-customers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-customers.d.ts","sourceRoot":"","sources":["../../../src/customer/workflows/delete-customers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EAKb,MAAM,kCAAkC,CAAA;AAIzC;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,GAAG,EAAE,MAAM,EAAE,CAAA;CACd,CAAA;AAED,eAAO,MAAM,yBAAyB,qBAAqB,CAAA;AAC3D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,uBAAuB;;aAuBnC,CAAA"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteCustomersWorkflow = exports.deleteCustomersWorkflowId = void 0;
|
|
4
|
-
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
6
|
-
const emit_event_1 = require("../../common/steps/emit-event");
|
|
7
|
-
const steps_1 = require("../steps");
|
|
8
|
-
exports.deleteCustomersWorkflowId = "delete-customers";
|
|
9
|
-
/**
|
|
10
|
-
* This workflow deletes one or more customers. It's used by the
|
|
11
|
-
* {@link removeCustomerAccountWorkflow}.
|
|
12
|
-
*
|
|
13
|
-
* You can use this workflow within your customizations or your own custom workflows, allowing you to
|
|
14
|
-
* delete customers in your custom flows.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* const { result } = await deleteCustomersWorkflow(container)
|
|
18
|
-
* .run({
|
|
19
|
-
* input: {
|
|
20
|
-
* ids: [
|
|
21
|
-
* "cus_123",
|
|
22
|
-
* ]
|
|
23
|
-
* }
|
|
24
|
-
* })
|
|
25
|
-
*
|
|
26
|
-
* @summary
|
|
27
|
-
*
|
|
28
|
-
* Delete one or more customers.
|
|
29
|
-
*
|
|
30
|
-
* @property hooks.customersDeleted - This hook is executed after the customers are deleted. You can consume this hook to perform custom actions.
|
|
31
|
-
*/
|
|
32
|
-
exports.deleteCustomersWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.deleteCustomersWorkflowId, (input) => {
|
|
33
|
-
const deletedCustomers = (0, steps_1.deleteCustomersStep)(input.ids);
|
|
34
|
-
const customersDeleted = (0, workflows_sdk_1.createHook)("customersDeleted", {
|
|
35
|
-
ids: input.ids,
|
|
36
|
-
});
|
|
37
|
-
const customerIdEvents = (0, workflows_sdk_1.transform)({ input }, ({ input }) => {
|
|
38
|
-
return input.ids?.map((id) => {
|
|
39
|
-
return { id };
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
(0, emit_event_1.emitEventStep)({
|
|
43
|
-
eventName: utils_1.CustomerWorkflowEvents.DELETED,
|
|
44
|
-
data: customerIdEvents,
|
|
45
|
-
});
|
|
46
|
-
return new workflows_sdk_1.WorkflowResponse(deletedCustomers, {
|
|
47
|
-
hooks: [customersDeleted],
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
//# sourceMappingURL=delete-customers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-customers.js","sourceRoot":"","sources":["../../../src/customer/workflows/delete-customers.ts"],"names":[],"mappings":";;;AAAA,oDAAiE;AACjE,oEAMyC;AACzC,8DAA6D;AAC7D,oCAA8C;AAYjC,QAAA,yBAAyB,GAAG,kBAAkB,CAAA;AAC3D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACU,QAAA,uBAAuB,GAAG,IAAA,8BAAc,EACnD,iCAAyB,EACzB,CAAC,KAAiD,EAAE,EAAE;IACpD,MAAM,gBAAgB,GAAG,IAAA,2BAAmB,EAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACvD,MAAM,gBAAgB,GAAG,IAAA,0BAAU,EAAC,kBAAkB,EAAE;QACtD,GAAG,EAAE,KAAK,CAAC,GAAG;KACf,CAAC,CAAA;IAEF,MAAM,gBAAgB,GAAG,IAAA,yBAAS,EAAC,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QAC1D,OAAO,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;YAC3B,OAAO,EAAE,EAAE,EAAE,CAAA;QACf,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,IAAA,0BAAa,EAAC;QACZ,SAAS,EAAE,8BAAsB,CAAC,OAAO;QACzC,IAAI,EAAE,gBAAgB;KACvB,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,gBAAgB,EAAE;QAC5C,KAAK,EAAE,CAAC,gBAAgB,CAAC;KAC1B,CAAC,CAAA;AACJ,CAAC,CACF,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./create-addresses";
|
|
2
|
-
export * from "./create-customer-account";
|
|
3
|
-
export * from "./create-customers";
|
|
4
|
-
export * from "./delete-addresses";
|
|
5
|
-
export * from "./delete-customers";
|
|
6
|
-
export * from "./remove-customer-account";
|
|
7
|
-
export * from "./update-addresses";
|
|
8
|
-
export * from "./update-customers";
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/customer/workflows/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,2BAA2B,CAAA;AACzC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,2BAA2B,CAAA;AACzC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./create-addresses"), exports);
|
|
18
|
-
__exportStar(require("./create-customer-account"), exports);
|
|
19
|
-
__exportStar(require("./create-customers"), exports);
|
|
20
|
-
__exportStar(require("./delete-addresses"), exports);
|
|
21
|
-
__exportStar(require("./delete-customers"), exports);
|
|
22
|
-
__exportStar(require("./remove-customer-account"), exports);
|
|
23
|
-
__exportStar(require("./update-addresses"), exports);
|
|
24
|
-
__exportStar(require("./update-customers"), exports);
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/customer/workflows/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,4DAAyC;AACzC,qDAAkC;AAClC,qDAAkC;AAClC,qDAAkC;AAClC,4DAAyC;AACzC,qDAAkC;AAClC,qDAAkC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export type RemoveCustomerAccountWorkflowInput = {
|
|
2
|
-
customerId: string;
|
|
3
|
-
};
|
|
4
|
-
export declare const removeCustomerAccountWorkflowId = "remove-customer-account";
|
|
5
|
-
/**
|
|
6
|
-
* This workflow deletes a customer and remove its association to its auth identity. It's used by the
|
|
7
|
-
* [Delete Customer Admin API Route](https://docs.acmekit.com/api/admin#customers_deletecustomersid).
|
|
8
|
-
*
|
|
9
|
-
* You can use this workflow within your customizations or your own custom workflows, allowing you to
|
|
10
|
-
* delete customer accounts within your custom flows.
|
|
11
|
-
*
|
|
12
|
-
* :::note
|
|
13
|
-
*
|
|
14
|
-
* This workflow uses the {@link deleteCustomersWorkflow} which has a hook that allows you to perform
|
|
15
|
-
* custom actions after the customers are deleted.
|
|
16
|
-
*
|
|
17
|
-
* :::
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* const { result } = await removeCustomerAccountWorkflow(container)
|
|
21
|
-
* .run({
|
|
22
|
-
* input: {
|
|
23
|
-
* customerId: "cus_123"
|
|
24
|
-
* }
|
|
25
|
-
* })
|
|
26
|
-
*
|
|
27
|
-
* @summary
|
|
28
|
-
*
|
|
29
|
-
* Delete a customer account and its auth identity association.
|
|
30
|
-
*/
|
|
31
|
-
export declare const removeCustomerAccountWorkflow: import("@acmekit/framework/workflows-sdk").ReturnWorkflow<RemoveCustomerAccountWorkflowInput, string, []>;
|
|
32
|
-
//# sourceMappingURL=remove-customer-account.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-customer-account.d.ts","sourceRoot":"","sources":["../../../src/customer/workflows/remove-customer-account.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,kCAAkC,GAAG;IAC/C,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AACD,eAAO,MAAM,+BAA+B,4BAA4B,CAAA;AACxE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,6BAA6B,2GA2DzC,CAAA"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeCustomerAccountWorkflow = exports.removeCustomerAccountWorkflowId = void 0;
|
|
4
|
-
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
6
|
-
const auth_1 = require("../../auth");
|
|
7
|
-
const common_1 = require("../../common");
|
|
8
|
-
const delete_customers_1 = require("./delete-customers");
|
|
9
|
-
exports.removeCustomerAccountWorkflowId = "remove-customer-account";
|
|
10
|
-
/**
|
|
11
|
-
* This workflow deletes a customer and remove its association to its auth identity. It's used by the
|
|
12
|
-
* [Delete Customer Admin API Route](https://docs.acmekit.com/api/admin#customers_deletecustomersid).
|
|
13
|
-
*
|
|
14
|
-
* You can use this workflow within your customizations or your own custom workflows, allowing you to
|
|
15
|
-
* delete customer accounts within your custom flows.
|
|
16
|
-
*
|
|
17
|
-
* :::note
|
|
18
|
-
*
|
|
19
|
-
* This workflow uses the {@link deleteCustomersWorkflow} which has a hook that allows you to perform
|
|
20
|
-
* custom actions after the customers are deleted.
|
|
21
|
-
*
|
|
22
|
-
* :::
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* const { result } = await removeCustomerAccountWorkflow(container)
|
|
26
|
-
* .run({
|
|
27
|
-
* input: {
|
|
28
|
-
* customerId: "cus_123"
|
|
29
|
-
* }
|
|
30
|
-
* })
|
|
31
|
-
*
|
|
32
|
-
* @summary
|
|
33
|
-
*
|
|
34
|
-
* Delete a customer account and its auth identity association.
|
|
35
|
-
*/
|
|
36
|
-
exports.removeCustomerAccountWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.removeCustomerAccountWorkflowId, (input) => {
|
|
37
|
-
const customers = (0, common_1.useRemoteQueryStep)({
|
|
38
|
-
entry_point: "customer",
|
|
39
|
-
fields: ["id", "has_account"],
|
|
40
|
-
variables: {
|
|
41
|
-
id: input.customerId,
|
|
42
|
-
},
|
|
43
|
-
}).config({ name: "get-customer" });
|
|
44
|
-
delete_customers_1.deleteCustomersWorkflow.runAsStep({
|
|
45
|
-
input: {
|
|
46
|
-
ids: [input.customerId],
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
(0, workflows_sdk_1.when)({ customers }, ({ customers }) => {
|
|
50
|
-
return !!customers[0]?.has_account;
|
|
51
|
-
}).then(() => {
|
|
52
|
-
const authIdentities = (0, common_1.useRemoteQueryStep)({
|
|
53
|
-
entry_point: "auth_identity",
|
|
54
|
-
fields: ["id"],
|
|
55
|
-
variables: {
|
|
56
|
-
filters: {
|
|
57
|
-
app_metadata: {
|
|
58
|
-
customer_id: input.customerId,
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
const authIdentity = (0, workflows_sdk_1.transform)({ authIdentities }, ({ authIdentities }) => {
|
|
64
|
-
const authIdentity = authIdentities[0];
|
|
65
|
-
if (!authIdentity) {
|
|
66
|
-
throw new utils_1.AcmeKitError(utils_1.AcmeKitError.Types.NOT_FOUND, "Auth identity not found");
|
|
67
|
-
}
|
|
68
|
-
return authIdentity;
|
|
69
|
-
});
|
|
70
|
-
(0, auth_1.setAuthAppMetadataStep)({
|
|
71
|
-
authIdentityId: authIdentity.id,
|
|
72
|
-
actorType: "customer",
|
|
73
|
-
value: null,
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
return new workflows_sdk_1.WorkflowResponse(input.customerId);
|
|
77
|
-
});
|
|
78
|
-
//# sourceMappingURL=remove-customer-account.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-customer-account.js","sourceRoot":"","sources":["../../../src/customer/workflows/remove-customer-account.ts"],"names":[],"mappings":";;;AAAA,oDAAuD;AACvD,oEAMyC;AACzC,qCAAmD;AACnD,yCAAiD;AACjD,yDAA4D;AAK/C,QAAA,+BAA+B,GAAG,yBAAyB,CAAA;AACxE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACU,QAAA,6BAA6B,GAAG,IAAA,8BAAc,EACzD,uCAA+B,EAC/B,CACE,KAAuD,EAC7B,EAAE;IAC5B,MAAM,SAAS,GAAG,IAAA,2BAAkB,EAAC;QACnC,WAAW,EAAE,UAAU;QACvB,MAAM,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC;QAC7B,SAAS,EAAE;YACT,EAAE,EAAE,KAAK,CAAC,UAAU;SACrB;KACF,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAA;IAEnC,0CAAuB,CAAC,SAAS,CAAC;QAChC,KAAK,EAAE;YACL,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC;SACxB;KACF,CAAC,CAAA;IAEF,IAAA,oBAAI,EAAC,EAAE,SAAS,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;QACpC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,CAAA;IACpC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;QACX,MAAM,cAAc,GAAG,IAAA,2BAAkB,EAAC;YACxC,WAAW,EAAE,eAAe;YAC5B,MAAM,EAAE,CAAC,IAAI,CAAC;YACd,SAAS,EAAE;gBACT,OAAO,EAAE;oBACP,YAAY,EAAE;wBACZ,WAAW,EAAE,KAAK,CAAC,UAAU;qBAC9B;iBACF;aACF;SACF,CAAC,CAAA;QAEF,MAAM,YAAY,GAAG,IAAA,yBAAS,EAC5B,EAAE,cAAc,EAAE,EAClB,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE;YACrB,MAAM,YAAY,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;YAEtC,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,MAAM,IAAI,oBAAY,CACpB,oBAAY,CAAC,KAAK,CAAC,SAAS,EAC5B,yBAAyB,CAC1B,CAAA;YACH,CAAC;YAED,OAAO,YAAY,CAAA;QACrB,CAAC,CACF,CAAA;QAED,IAAA,6BAAsB,EAAC;YACrB,cAAc,EAAE,YAAY,CAAC,EAAE;YAC/B,SAAS,EAAE,UAAU;YACrB,KAAK,EAAE,IAAI;SACZ,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;AAC/C,CAAC,CACF,CAAA"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { FilterableCustomerAddressProps, UpdateCustomerAddressDTO, AdditionalData } from "@acmekit/framework/types";
|
|
2
|
-
import { WorkflowData } from "@acmekit/framework/workflows-sdk";
|
|
3
|
-
/**
|
|
4
|
-
* The data to update one or more customer addresses, along with custom data that's passed to the workflow's hooks.
|
|
5
|
-
*/
|
|
6
|
-
export type UpdateCustomerAddressesWorkflowInput = {
|
|
7
|
-
/**
|
|
8
|
-
* The filters to select the addresses to update.
|
|
9
|
-
*/
|
|
10
|
-
selector: FilterableCustomerAddressProps;
|
|
11
|
-
/**
|
|
12
|
-
* The data to update in the addresses.
|
|
13
|
-
*/
|
|
14
|
-
update: UpdateCustomerAddressDTO;
|
|
15
|
-
} & AdditionalData;
|
|
16
|
-
export declare const updateCustomerAddressesWorkflowId = "update-customer-addresses";
|
|
17
|
-
/**
|
|
18
|
-
* This workflow updates one or more addresses for customers. It's used by the [Update Customer Address Admin API Route](https://docs.acmekit.com/api/admin#customers_postcustomersidaddressesaddress_id)
|
|
19
|
-
* and the [Update Customer Address Store API Route](https://docs.acmekit.com/api/store#customers_postcustomersmeaddressesaddress_id).
|
|
20
|
-
*
|
|
21
|
-
* 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
|
|
22
|
-
* allows you to update custom data models linked to the addresses.
|
|
23
|
-
*
|
|
24
|
-
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around updating customer addresses.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* const { result } = await updateCustomerAddressesWorkflow(container)
|
|
28
|
-
* .run({
|
|
29
|
-
* input: {
|
|
30
|
-
* selector: {
|
|
31
|
-
* customer_id: "123"
|
|
32
|
-
* },
|
|
33
|
-
* update: {
|
|
34
|
-
* first_name: "John"
|
|
35
|
-
* },
|
|
36
|
-
* additional_data: {
|
|
37
|
-
* crm_id: "123"
|
|
38
|
-
* }
|
|
39
|
-
* }
|
|
40
|
-
* })
|
|
41
|
-
*
|
|
42
|
-
* @summary
|
|
43
|
-
*
|
|
44
|
-
* Update one or more customer addresses.
|
|
45
|
-
*
|
|
46
|
-
* @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.
|
|
47
|
-
*/
|
|
48
|
-
export declare const updateCustomerAddressesWorkflow: import("@acmekit/framework/workflows-sdk").ReturnWorkflow<UpdateCustomerAddressesWorkflowInput, import("@acmekit/framework/types").CustomerAddressDTO[], [import("@acmekit/framework/workflows-sdk").Hook<"addressesUpdated", {
|
|
49
|
-
addresses: (import("@acmekit/framework/types").CustomerAddressDTO | WorkflowData<import("@acmekit/framework/types").CustomerAddressDTO>)[] & import("@acmekit/framework/types").CustomerAddressDTO[] & import("@acmekit/framework/workflows-sdk").WorkflowDataProperties<import("@acmekit/framework/types").CustomerAddressDTO[]> & {
|
|
50
|
-
config(config: {
|
|
51
|
-
name?: string;
|
|
52
|
-
} & Omit<import("@acmekit/orchestration").TransactionStepsDefinition, "next" | "uuid" | "action">): WorkflowData<import("@acmekit/framework/types").CustomerAddressDTO[]>;
|
|
53
|
-
} & import("@acmekit/framework/workflows-sdk").StepFunctionReturnConfig<import("@acmekit/framework/types").CustomerAddressDTO[]>;
|
|
54
|
-
additional_data: ((Record<string, unknown> | WorkflowData<Record<string, unknown> | undefined>) & Record<string, unknown>) | undefined;
|
|
55
|
-
}, unknown>]>;
|
|
56
|
-
//# sourceMappingURL=update-addresses.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-addresses.d.ts","sourceRoot":"","sources":["../../../src/customer/workflows/update-addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,EACxB,cAAc,EACf,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,YAAY,EAMb,MAAM,kCAAkC,CAAA;AAOzC;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD;;OAEG;IACH,QAAQ,EAAE,8BAA8B,CAAA;IACxC;;OAEG;IACH,MAAM,EAAE,wBAAwB,CAAA;CACjC,GAAG,cAAc,CAAA;AAElB,eAAO,MAAM,iCAAiC,8BAA8B,CAAA;AAC5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,+BAA+B;;;gBASnC,CAAC;;;;aAaT,CAAA"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateCustomerAddressesWorkflow = exports.updateCustomerAddressesWorkflowId = void 0;
|
|
4
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
5
|
-
const steps_1 = require("../steps");
|
|
6
|
-
exports.updateCustomerAddressesWorkflowId = "update-customer-addresses";
|
|
7
|
-
/**
|
|
8
|
-
* This workflow updates one or more addresses for customers. It's used by the [Update Customer Address Admin API Route](https://docs.acmekit.com/api/admin#customers_postcustomersidaddressesaddress_id)
|
|
9
|
-
* and the [Update Customer Address Store API Route](https://docs.acmekit.com/api/store#customers_postcustomersmeaddressesaddress_id).
|
|
10
|
-
*
|
|
11
|
-
* 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
|
|
12
|
-
* allows you to update custom data models linked to the addresses.
|
|
13
|
-
*
|
|
14
|
-
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around updating customer addresses.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* const { result } = await updateCustomerAddressesWorkflow(container)
|
|
18
|
-
* .run({
|
|
19
|
-
* input: {
|
|
20
|
-
* selector: {
|
|
21
|
-
* customer_id: "123"
|
|
22
|
-
* },
|
|
23
|
-
* update: {
|
|
24
|
-
* first_name: "John"
|
|
25
|
-
* },
|
|
26
|
-
* additional_data: {
|
|
27
|
-
* crm_id: "123"
|
|
28
|
-
* }
|
|
29
|
-
* }
|
|
30
|
-
* })
|
|
31
|
-
*
|
|
32
|
-
* @summary
|
|
33
|
-
*
|
|
34
|
-
* Update one or more customer addresses.
|
|
35
|
-
*
|
|
36
|
-
* @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.
|
|
37
|
-
*/
|
|
38
|
-
exports.updateCustomerAddressesWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.updateCustomerAddressesWorkflowId, (input) => {
|
|
39
|
-
const unsetInput = (0, workflows_sdk_1.transform)(input, (data) => ({
|
|
40
|
-
update: data,
|
|
41
|
-
}));
|
|
42
|
-
(0, workflows_sdk_1.parallelize)((0, steps_1.maybeUnsetDefaultShippingAddressesStep)(unsetInput), (0, steps_1.maybeUnsetDefaultBillingAddressesStep)(unsetInput));
|
|
43
|
-
const updatedAddresses = (0, steps_1.updateCustomerAddressesStep)(input);
|
|
44
|
-
const addressesUpdated = (0, workflows_sdk_1.createHook)("addressesUpdated", {
|
|
45
|
-
addresses: updatedAddresses,
|
|
46
|
-
additional_data: input.additional_data,
|
|
47
|
-
});
|
|
48
|
-
return new workflows_sdk_1.WorkflowResponse(updatedAddresses, {
|
|
49
|
-
hooks: [addressesUpdated],
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=update-addresses.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-addresses.js","sourceRoot":"","sources":["../../../src/customer/workflows/update-addresses.ts"],"names":[],"mappings":";;;AAKA,oEAOyC;AACzC,oCAIiB;AAgBJ,QAAA,iCAAiC,GAAG,2BAA2B,CAAA;AAC5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACU,QAAA,+BAA+B,GAAG,IAAA,8BAAc,EAC3D,yCAAiC,EACjC,CAAC,KAAyD,EAAE,EAAE;IAC5D,MAAM,UAAU,GAAG,IAAA,yBAAS,EAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC7C,MAAM,EAAE,IAAI;KACb,CAAC,CAAC,CAAA;IAEH,IAAA,2BAAW,EACT,IAAA,8CAAsC,EAAC,UAAU,CAAC,EAClD,IAAA,6CAAqC,EAAC,UAAU,CAAC,CAClD,CAAA;IAED,MAAM,gBAAgB,GAAG,IAAA,mCAA2B,EAAC,KAAK,CAAC,CAAA;IAC3D,MAAM,gBAAgB,GAAG,IAAA,0BAAU,EAAC,kBAAkB,EAAE;QACtD,SAAS,EAAE,gBAAgB;QAC3B,eAAe,EAAE,KAAK,CAAC,eAAe;KACvC,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,gBAAgB,EAAE;QAC5C,KAAK,EAAE,CAAC,gBAAgB,CAAC;KAC1B,CAAC,CAAA;AACJ,CAAC,CACF,CAAA"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { AdditionalData, CustomerUpdatableFields, FilterableCustomerProps } from "@acmekit/framework/types";
|
|
2
|
-
import { WorkflowData } from "@acmekit/framework/workflows-sdk";
|
|
3
|
-
/**
|
|
4
|
-
* The data to update one or more customers, along with custom data that's passed to the workflow's hooks.
|
|
5
|
-
*/
|
|
6
|
-
export type UpdateCustomersWorkflowInput = {
|
|
7
|
-
/**
|
|
8
|
-
* The filters to select the customers to update.
|
|
9
|
-
*/
|
|
10
|
-
selector: FilterableCustomerProps;
|
|
11
|
-
/**
|
|
12
|
-
* The data to update in the customers.
|
|
13
|
-
*/
|
|
14
|
-
update: CustomerUpdatableFields;
|
|
15
|
-
} & AdditionalData;
|
|
16
|
-
export declare const updateCustomersWorkflowId = "update-customers";
|
|
17
|
-
/**
|
|
18
|
-
* This workflow updates one or more customers. It's used by the [Update Customer Admin API Route](https://docs.acmekit.com/api/admin#customers_postcustomersid) and
|
|
19
|
-
* the [Update Customer Store API Route](https://docs.acmekit.com/api/store#customers_postcustomersme).
|
|
20
|
-
*
|
|
21
|
-
* This workflow has a hook that allows you to perform custom actions on the updated customer. For example, you can pass under `additional_data` custom data to update
|
|
22
|
-
* custom data models linked to the customers.
|
|
23
|
-
*
|
|
24
|
-
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around updating customers.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* const { result } = await updateCustomersWorkflow(container)
|
|
28
|
-
* .run({
|
|
29
|
-
* input: {
|
|
30
|
-
* selector: {
|
|
31
|
-
* id: ["cus_123"]
|
|
32
|
-
* },
|
|
33
|
-
* update: {
|
|
34
|
-
* first_name: "John"
|
|
35
|
-
* }
|
|
36
|
-
* }
|
|
37
|
-
* })
|
|
38
|
-
*
|
|
39
|
-
* @summary
|
|
40
|
-
*
|
|
41
|
-
* Update one or more customers.
|
|
42
|
-
*
|
|
43
|
-
* @property hooks.customersUpdated - This hook is executed after the customers are updated. You can consume this hook to perform custom actions on the updated customers.
|
|
44
|
-
*/
|
|
45
|
-
export declare const updateCustomersWorkflow: import("@acmekit/framework/workflows-sdk").ReturnWorkflow<UpdateCustomersWorkflowInput, import("@acmekit/framework/types").CustomerDTO[], [import("@acmekit/framework/workflows-sdk").Hook<"customersUpdated", {
|
|
46
|
-
customers: (import("@acmekit/framework/types").CustomerDTO | WorkflowData<import("@acmekit/framework/types").CustomerDTO>)[] & import("@acmekit/framework/types").CustomerDTO[] & import("@acmekit/framework/workflows-sdk").WorkflowDataProperties<import("@acmekit/framework/types").CustomerDTO[]> & {
|
|
47
|
-
config(config: {
|
|
48
|
-
name?: string;
|
|
49
|
-
} & Omit<import("@acmekit/orchestration").TransactionStepsDefinition, "next" | "uuid" | "action">): WorkflowData<import("@acmekit/framework/types").CustomerDTO[]>;
|
|
50
|
-
} & import("@acmekit/framework/workflows-sdk").StepFunctionReturnConfig<import("@acmekit/framework/types").CustomerDTO[]>;
|
|
51
|
-
additional_data: ((Record<string, unknown> | WorkflowData<Record<string, unknown> | undefined>) & Record<string, unknown>) | undefined;
|
|
52
|
-
}, unknown>]>;
|
|
53
|
-
//# sourceMappingURL=update-customers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-customers.d.ts","sourceRoot":"","sources":["../../../src/customer/workflows/update-customers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACL,YAAY,EAKb,MAAM,kCAAkC,CAAA;AAIzC;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,QAAQ,EAAE,uBAAuB,CAAA;IACjC;;OAEG;IACH,MAAM,EAAE,uBAAuB,CAAA;CAChC,GAAG,cAAc,CAAA;AAElB,eAAO,MAAM,yBAAyB,qBAAqB,CAAA;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,uBAAuB;;;gBAcvB,CAAC;;;;aAiBb,CAAA"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateCustomersWorkflow = exports.updateCustomersWorkflowId = void 0;
|
|
4
|
-
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
6
|
-
const emit_event_1 = require("../../common/steps/emit-event");
|
|
7
|
-
const steps_1 = require("../steps");
|
|
8
|
-
exports.updateCustomersWorkflowId = "update-customers";
|
|
9
|
-
/**
|
|
10
|
-
* This workflow updates one or more customers. It's used by the [Update Customer Admin API Route](https://docs.acmekit.com/api/admin#customers_postcustomersid) and
|
|
11
|
-
* the [Update Customer Store API Route](https://docs.acmekit.com/api/store#customers_postcustomersme).
|
|
12
|
-
*
|
|
13
|
-
* This workflow has a hook that allows you to perform custom actions on the updated customer. For example, you can pass under `additional_data` custom data to update
|
|
14
|
-
* custom data models linked to the customers.
|
|
15
|
-
*
|
|
16
|
-
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around updating customers.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* const { result } = await updateCustomersWorkflow(container)
|
|
20
|
-
* .run({
|
|
21
|
-
* input: {
|
|
22
|
-
* selector: {
|
|
23
|
-
* id: ["cus_123"]
|
|
24
|
-
* },
|
|
25
|
-
* update: {
|
|
26
|
-
* first_name: "John"
|
|
27
|
-
* }
|
|
28
|
-
* }
|
|
29
|
-
* })
|
|
30
|
-
*
|
|
31
|
-
* @summary
|
|
32
|
-
*
|
|
33
|
-
* Update one or more customers.
|
|
34
|
-
*
|
|
35
|
-
* @property hooks.customersUpdated - This hook is executed after the customers are updated. You can consume this hook to perform custom actions on the updated customers.
|
|
36
|
-
*/
|
|
37
|
-
exports.updateCustomersWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.updateCustomersWorkflowId, (input) => {
|
|
38
|
-
const updatedCustomers = (0, steps_1.updateCustomersStep)(input);
|
|
39
|
-
const customersUpdated = (0, workflows_sdk_1.createHook)("customersUpdated", {
|
|
40
|
-
customers: updatedCustomers,
|
|
41
|
-
additional_data: input.additional_data,
|
|
42
|
-
});
|
|
43
|
-
const customerIdEvents = (0, workflows_sdk_1.transform)({ updatedCustomers }, ({ updatedCustomers }) => {
|
|
44
|
-
const arr = Array.isArray(updatedCustomers)
|
|
45
|
-
? updatedCustomers
|
|
46
|
-
: [updatedCustomers];
|
|
47
|
-
return arr?.map((customer) => {
|
|
48
|
-
return { id: customer.id };
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
(0, emit_event_1.emitEventStep)({
|
|
52
|
-
eventName: utils_1.CustomerWorkflowEvents.UPDATED,
|
|
53
|
-
data: customerIdEvents,
|
|
54
|
-
});
|
|
55
|
-
return new workflows_sdk_1.WorkflowResponse(updatedCustomers, {
|
|
56
|
-
hooks: [customersUpdated],
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
//# sourceMappingURL=update-customers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-customers.js","sourceRoot":"","sources":["../../../src/customer/workflows/update-customers.ts"],"names":[],"mappings":";;;AAKA,oDAAiE;AACjE,oEAMyC;AACzC,8DAA6D;AAC7D,oCAA8C;AAgBjC,QAAA,yBAAyB,GAAG,kBAAkB,CAAA;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACU,QAAA,uBAAuB,GAAG,IAAA,8BAAc,EACnD,iCAAyB,EACzB,CAAC,KAAiD,EAAE,EAAE;IACpD,MAAM,gBAAgB,GAAG,IAAA,2BAAmB,EAAC,KAAK,CAAC,CAAA;IACnD,MAAM,gBAAgB,GAAG,IAAA,0BAAU,EAAC,kBAAkB,EAAE;QACtD,SAAS,EAAE,gBAAgB;QAC3B,eAAe,EAAE,KAAK,CAAC,eAAe;KACvC,CAAC,CAAA;IAEF,MAAM,gBAAgB,GAAG,IAAA,yBAAS,EAChC,EAAE,gBAAgB,EAAE,EACpB,CAAC,EAAE,gBAAgB,EAAE,EAAE,EAAE;QACvB,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC;YACzC,CAAC,CAAC,gBAAgB;YAClB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAA;QAEtB,OAAO,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;YAC3B,OAAO,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAA;QAC5B,CAAC,CAAC,CAAA;IACJ,CAAC,CACF,CAAA;IAED,IAAA,0BAAa,EAAC;QACZ,SAAS,EAAE,8BAAsB,CAAC,OAAO;QACzC,IAAI,EAAE,gBAAgB;KACvB,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,gBAAgB,EAAE;QAC5C,KAAK,EAAE,CAAC,gBAAgB,CAAC;KAC1B,CAAC,CAAA;AACJ,CAAC,CACF,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/customer-group/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./workflows"), exports);
|
|
18
|
-
__exportStar(require("./steps"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/customer-group/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,0CAAuB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CreateCustomerGroupDTO } from "@acmekit/framework/types";
|
|
2
|
-
/**
|
|
3
|
-
* The data to create customer groups.
|
|
4
|
-
*/
|
|
5
|
-
export type CreateCustomerGroupsStepInput = CreateCustomerGroupDTO[];
|
|
6
|
-
export declare const createCustomerGroupsStepId = "create-customer-groups";
|
|
7
|
-
/**
|
|
8
|
-
* This step creates one or more customer groups.
|
|
9
|
-
*/
|
|
10
|
-
export declare const createCustomerGroupsStep: import("@acmekit/framework/workflows-sdk").StepFunction<CreateCustomerGroupsStepInput, import("@acmekit/framework/types").CustomerGroupDTO[]>;
|
|
11
|
-
//# sourceMappingURL=create-customer-groups.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-customer-groups.d.ts","sourceRoot":"","sources":["../../../src/customer-group/steps/create-customer-groups.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEvB,MAAM,0BAA0B,CAAA;AAIjC;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,sBAAsB,EAAE,CAAA;AAEpE,eAAO,MAAM,0BAA0B,2BAA2B,CAAA;AAClE;;GAEG;AACH,eAAO,MAAM,wBAAwB,+IAuBpC,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCustomerGroupsStep = exports.createCustomerGroupsStepId = void 0;
|
|
4
|
-
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
6
|
-
exports.createCustomerGroupsStepId = "create-customer-groups";
|
|
7
|
-
/**
|
|
8
|
-
* This step creates one or more customer groups.
|
|
9
|
-
*/
|
|
10
|
-
exports.createCustomerGroupsStep = (0, workflows_sdk_1.createStep)(exports.createCustomerGroupsStepId, async (data, { container }) => {
|
|
11
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
12
|
-
const createdCustomerGroups = await service.createCustomerGroups(data);
|
|
13
|
-
return new workflows_sdk_1.StepResponse(createdCustomerGroups, createdCustomerGroups.map((createdCustomerGroups) => createdCustomerGroups.id));
|
|
14
|
-
}, async (createdCustomerGroupIds, { container }) => {
|
|
15
|
-
if (!createdCustomerGroupIds?.length) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
19
|
-
await service.deleteCustomerGroups(createdCustomerGroupIds);
|
|
20
|
-
});
|
|
21
|
-
//# sourceMappingURL=create-customer-groups.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-customer-groups.js","sourceRoot":"","sources":["../../../src/customer-group/steps/create-customer-groups.ts"],"names":[],"mappings":";;;AAIA,oDAAkD;AAClD,oEAA2E;AAO9D,QAAA,0BAA0B,GAAG,wBAAwB,CAAA;AAClE;;GAEG;AACU,QAAA,wBAAwB,GAAG,IAAA,0BAAU,EAChD,kCAA0B,EAC1B,KAAK,EAAE,IAAmC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAC3D,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,qBAAqB,GAAG,MAAM,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAEtE,OAAO,IAAI,4BAAY,CACrB,qBAAqB,EACrB,qBAAqB,CAAC,GAAG,CACvB,CAAC,qBAAqB,EAAE,EAAE,CAAC,qBAAqB,CAAC,EAAE,CACpD,CACF,CAAA;AACH,CAAC,EACD,KAAK,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAC/C,IAAI,CAAC,uBAAuB,EAAE,MAAM,EAAE,CAAC;QACrC,OAAM;IACR,CAAC;IAED,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,OAAO,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAA;AAC7D,CAAC,CACF,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GroupCustomerPair } from "@acmekit/framework/types";
|
|
2
|
-
export declare const deleteCustomerGroupCustomersStepId = "delete-customer-group-customers";
|
|
3
|
-
/**
|
|
4
|
-
* This step removes customers from groups.
|
|
5
|
-
*/
|
|
6
|
-
export declare const deleteCustomerGroupCustomersStep: import("@acmekit/framework/workflows-sdk").StepFunction<GroupCustomerPair[], undefined>;
|
|
7
|
-
//# sourceMappingURL=delete-customer-group-customers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-customer-group-customers.d.ts","sourceRoot":"","sources":["../../../src/customer-group/steps/delete-customer-group-customers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAElB,MAAM,0BAA0B,CAAA;AAIjC,eAAO,MAAM,kCAAkC,oCACZ,CAAA;AACnC;;GAEG;AACH,eAAO,MAAM,gCAAgC,yFAiB5C,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteCustomerGroupCustomersStep = exports.deleteCustomerGroupCustomersStepId = void 0;
|
|
4
|
-
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
6
|
-
exports.deleteCustomerGroupCustomersStepId = "delete-customer-group-customers";
|
|
7
|
-
/**
|
|
8
|
-
* This step removes customers from groups.
|
|
9
|
-
*/
|
|
10
|
-
exports.deleteCustomerGroupCustomersStep = (0, workflows_sdk_1.createStep)(exports.deleteCustomerGroupCustomersStepId, async (data, { container }) => {
|
|
11
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
12
|
-
await service.removeCustomerFromGroup(data);
|
|
13
|
-
return new workflows_sdk_1.StepResponse(void 0, data);
|
|
14
|
-
}, async (groupPairs, { container }) => {
|
|
15
|
-
if (!groupPairs?.length) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
19
|
-
await service.addCustomerToGroup(groupPairs);
|
|
20
|
-
});
|
|
21
|
-
//# sourceMappingURL=delete-customer-group-customers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-customer-group-customers.js","sourceRoot":"","sources":["../../../src/customer-group/steps/delete-customer-group-customers.ts"],"names":[],"mappings":";;;AAIA,oDAAkD;AAClD,oEAA2E;AAE9D,QAAA,kCAAkC,GAC7C,iCAAiC,CAAA;AACnC;;GAEG;AACU,QAAA,gCAAgC,GAAG,IAAA,0BAAU,EACxD,0CAAkC,EAClC,KAAK,EAAE,IAAyB,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACjD,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,OAAO,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAA;IAE3C,OAAO,IAAI,4BAAY,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAA;AACvC,CAAC,EACD,KAAK,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAClC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;QACxB,OAAM;IACR,CAAC;IACD,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAA;AAC9C,CAAC,CACF,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The IDs of the customer groups to delete.
|
|
3
|
-
*/
|
|
4
|
-
export type DeleteCustomerGroupsStepInput = string[];
|
|
5
|
-
export declare const deleteCustomerGroupStepId = "delete-customer-groups";
|
|
6
|
-
/**
|
|
7
|
-
* This step deletes one or more customer groups.
|
|
8
|
-
*/
|
|
9
|
-
export declare const deleteCustomerGroupStep: import("@acmekit/framework/workflows-sdk").StepFunction<DeleteCustomerGroupsStepInput, undefined>;
|
|
10
|
-
//# sourceMappingURL=delete-customer-groups.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-customer-groups.d.ts","sourceRoot":"","sources":["../../../src/customer-group/steps/delete-customer-groups.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,MAAM,EAAE,CAAA;AAEpD,eAAO,MAAM,yBAAyB,2BAA2B,CAAA;AACjE;;GAEG;AACH,eAAO,MAAM,uBAAuB,mGAkBnC,CAAA"}
|