@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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unset-address-for-create.d.ts","sourceRoot":"","sources":["../../../../src/customer/steps/utils/unset-address-for-create.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAE/D,eAAO,MAAM,cAAc,GACzB,MAAM,wBAAwB,EAAE,EAChC,iBAAiB,sBAAsB,EACvC,OAAO,oBAAoB,GAAG,qBAAqB,+CAuBpD,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unsetForCreate = void 0;
|
|
4
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
5
|
-
const unsetForCreate = async (data, customerService, field) => {
|
|
6
|
-
const customerIds = data.reduce((acc, curr) => {
|
|
7
|
-
if (curr[field]) {
|
|
8
|
-
acc.push(curr.customer_id);
|
|
9
|
-
}
|
|
10
|
-
return acc;
|
|
11
|
-
}, []);
|
|
12
|
-
const customerDefaultAddresses = await customerService.listCustomerAddresses({
|
|
13
|
-
customer_id: customerIds,
|
|
14
|
-
[field]: true,
|
|
15
|
-
});
|
|
16
|
-
await customerService.updateCustomerAddresses({ customer_id: customerIds, [field]: true }, { [field]: false });
|
|
17
|
-
return new workflows_sdk_1.StepResponse(void 0, customerDefaultAddresses.map((address) => address.id));
|
|
18
|
-
};
|
|
19
|
-
exports.unsetForCreate = unsetForCreate;
|
|
20
|
-
//# sourceMappingURL=unset-address-for-create.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unset-address-for-create.js","sourceRoot":"","sources":["../../../../src/customer/steps/utils/unset-address-for-create.ts"],"names":[],"mappings":";;;AAIA,oEAA+D;AAExD,MAAM,cAAc,GAAG,KAAK,EACjC,IAAgC,EAChC,eAAuC,EACvC,KAAmD,EACnD,EAAE;IACF,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAW,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACtD,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAChB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QAC5B,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,MAAM,wBAAwB,GAAG,MAAM,eAAe,CAAC,qBAAqB,CAAC;QAC3E,WAAW,EAAE,WAAW;QACxB,CAAC,KAAK,CAAC,EAAE,IAAI;KACd,CAAC,CAAA;IAEF,MAAM,eAAe,CAAC,uBAAuB,CAC3C,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,EAC3C,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CACnB,CAAA;IAED,OAAO,IAAI,4BAAY,CACrB,KAAK,CAAC,EACN,wBAAwB,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CACtD,CAAA;AACH,CAAC,CAAA;AA1BY,QAAA,cAAc,kBA0B1B"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FilterableCustomerAddressProps, ICustomerModuleService, UpdateCustomerAddressDTO } from "@acmekit/framework/types";
|
|
2
|
-
import { StepResponse } from "@acmekit/framework/workflows-sdk";
|
|
3
|
-
export declare const unsetForUpdate: (data: {
|
|
4
|
-
selector: FilterableCustomerAddressProps;
|
|
5
|
-
update: UpdateCustomerAddressDTO;
|
|
6
|
-
}, customerService: ICustomerModuleService, field: "is_default_billing" | "is_default_shipping") => Promise<StepResponse<undefined, undefined> | StepResponse<undefined, string[]>>;
|
|
7
|
-
//# sourceMappingURL=unset-address-for-update.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unset-address-for-update.d.ts","sourceRoot":"","sources":["../../../../src/customer/steps/utils/unset-address-for-update.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAE/D,eAAO,MAAM,cAAc,GACzB,MAAM;IACJ,QAAQ,EAAE,8BAA8B,CAAA;IACxC,MAAM,EAAE,wBAAwB,CAAA;CACjC,EACD,iBAAiB,sBAAsB,EACvC,OAAO,oBAAoB,GAAG,qBAAqB,oFA6BpD,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unsetForUpdate = void 0;
|
|
4
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
5
|
-
const unsetForUpdate = async (data, customerService, field) => {
|
|
6
|
-
if (!data.update[field]) {
|
|
7
|
-
return new workflows_sdk_1.StepResponse(void 0);
|
|
8
|
-
}
|
|
9
|
-
const affectedCustomers = await customerService.listCustomerAddresses(data.selector, {
|
|
10
|
-
select: ["id", "customer_id"],
|
|
11
|
-
});
|
|
12
|
-
const customerIds = affectedCustomers.map((address) => address.customer_id);
|
|
13
|
-
const customerDefaultAddresses = await customerService.listCustomerAddresses({
|
|
14
|
-
customer_id: customerIds,
|
|
15
|
-
[field]: true,
|
|
16
|
-
});
|
|
17
|
-
await customerService.updateCustomerAddresses({ customer_id: customerIds, [field]: true }, { [field]: false });
|
|
18
|
-
return new workflows_sdk_1.StepResponse(void 0, customerDefaultAddresses.map((address) => address.id));
|
|
19
|
-
};
|
|
20
|
-
exports.unsetForUpdate = unsetForUpdate;
|
|
21
|
-
//# sourceMappingURL=unset-address-for-update.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unset-address-for-update.js","sourceRoot":"","sources":["../../../../src/customer/steps/utils/unset-address-for-update.ts"],"names":[],"mappings":";;;AAKA,oEAA+D;AAExD,MAAM,cAAc,GAAG,KAAK,EACjC,IAGC,EACD,eAAuC,EACvC,KAAmD,EACnD,EAAE;IACF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,4BAAY,CAAC,KAAK,CAAC,CAAC,CAAA;IACjC,CAAC;IAED,MAAM,iBAAiB,GAAG,MAAM,eAAe,CAAC,qBAAqB,CACnE,IAAI,CAAC,QAAQ,EACb;QACE,MAAM,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC;KAC9B,CACF,CAAA;IAED,MAAM,WAAW,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IAE3E,MAAM,wBAAwB,GAAG,MAAM,eAAe,CAAC,qBAAqB,CAAC;QAC3E,WAAW,EAAE,WAAW;QACxB,CAAC,KAAK,CAAC,EAAE,IAAI;KACd,CAAC,CAAA;IAEF,MAAM,eAAe,CAAC,uBAAuB,CAC3C,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,EAC3C,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CACnB,CAAA;IAED,OAAO,IAAI,4BAAY,CACrB,KAAK,CAAC,EACN,wBAAwB,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CACtD,CAAA;AACH,CAAC,CAAA;AAnCY,QAAA,cAAc,kBAmC1B"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CreateCustomerAccountWorkflowInput } from "../workflows";
|
|
2
|
-
export declare const validateCustomerAccountCreationStepId = "validate-customer-account-creation";
|
|
3
|
-
/**
|
|
4
|
-
* This step validates the input data for creating a customer account.
|
|
5
|
-
* The step throws an error if:
|
|
6
|
-
*
|
|
7
|
-
* - The email is missing
|
|
8
|
-
* - A customer with the email already exists and has an account
|
|
9
|
-
* - A guest customer with the email already exists
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* const data = validateCustomerAccountCreation({
|
|
13
|
-
* authIdentityId: "au_1234",
|
|
14
|
-
* customerData: {
|
|
15
|
-
* first_name: "John",
|
|
16
|
-
* last_name: "Doe",
|
|
17
|
-
* email: "john.doe@example.com",
|
|
18
|
-
* }
|
|
19
|
-
* })
|
|
20
|
-
*/
|
|
21
|
-
export declare const validateCustomerAccountCreation: import("@acmekit/framework/workflows-sdk").StepFunction<CreateCustomerAccountWorkflowInput, unknown>;
|
|
22
|
-
//# sourceMappingURL=validate-customer-account-creation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-customer-account-creation.d.ts","sourceRoot":"","sources":["../../../src/customer/steps/validate-customer-account-creation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kCAAkC,EAAE,MAAM,cAAc,CAAA;AAEjE,eAAO,MAAM,qCAAqC,uCACZ,CAAA;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,+BAA+B,sGAqC3C,CAAA"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateCustomerAccountCreation = exports.validateCustomerAccountCreationStepId = void 0;
|
|
4
|
-
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
6
|
-
exports.validateCustomerAccountCreationStepId = "validate-customer-account-creation";
|
|
7
|
-
/**
|
|
8
|
-
* This step validates the input data for creating a customer account.
|
|
9
|
-
* The step throws an error if:
|
|
10
|
-
*
|
|
11
|
-
* - The email is missing
|
|
12
|
-
* - A customer with the email already exists and has an account
|
|
13
|
-
* - A guest customer with the email already exists
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* const data = validateCustomerAccountCreation({
|
|
17
|
-
* authIdentityId: "au_1234",
|
|
18
|
-
* customerData: {
|
|
19
|
-
* first_name: "John",
|
|
20
|
-
* last_name: "Doe",
|
|
21
|
-
* email: "john.doe@example.com",
|
|
22
|
-
* }
|
|
23
|
-
* })
|
|
24
|
-
*/
|
|
25
|
-
exports.validateCustomerAccountCreation = (0, workflows_sdk_1.createStep)(exports.validateCustomerAccountCreationStepId, async (input, { container }) => {
|
|
26
|
-
const customerService = container.resolve(utils_1.Modules.CUSTOMER);
|
|
27
|
-
const { email } = input.customerData;
|
|
28
|
-
if (!email) {
|
|
29
|
-
throw new utils_1.AcmeKitError(utils_1.AcmeKitError.Types.INVALID_DATA, "Email is required to create a customer");
|
|
30
|
-
}
|
|
31
|
-
// Check if customer with email already exists
|
|
32
|
-
const existingCustomers = await customerService.listCustomers({ email });
|
|
33
|
-
if (existingCustomers?.length) {
|
|
34
|
-
const hasExistingAccount = existingCustomers.some((customer) => customer.has_account);
|
|
35
|
-
if (hasExistingAccount && input.authIdentityId) {
|
|
36
|
-
throw new utils_1.AcmeKitError(utils_1.AcmeKitError.Types.DUPLICATE_ERROR, "Customer with this email already has an account");
|
|
37
|
-
}
|
|
38
|
-
if (!hasExistingAccount && !input.authIdentityId) {
|
|
39
|
-
throw new utils_1.AcmeKitError(utils_1.AcmeKitError.Types.DUPLICATE_ERROR, "Guest customer with this email already exists");
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=validate-customer-account-creation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-customer-account-creation.js","sourceRoot":"","sources":["../../../src/customer/steps/validate-customer-account-creation.ts"],"names":[],"mappings":";;;AAAA,oDAAgE;AAChE,oEAA6D;AAGhD,QAAA,qCAAqC,GAChD,oCAAoC,CAAA;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,+BAA+B,GAAG,IAAA,0BAAU,EACvD,6CAAqC,EACrC,KAAK,EAAE,KAAyC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACjE,MAAM,eAAe,GAAG,SAAS,CAAC,OAAO,CAAC,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3D,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,YAAY,CAAA;IAEpC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,oBAAY,CACpB,oBAAY,CAAC,KAAK,CAAC,YAAY,EAC/B,wCAAwC,CACzC,CAAA;IACH,CAAC;IAED,8CAA8C;IAC9C,MAAM,iBAAiB,GAAG,MAAM,eAAe,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;IAExE,IAAI,iBAAiB,EAAE,MAAM,EAAE,CAAC;QAC9B,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,IAAI,CAC/C,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,WAAW,CACnC,CAAA;QAED,IAAI,kBAAkB,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;YAC/C,MAAM,IAAI,oBAAY,CACpB,oBAAY,CAAC,KAAK,CAAC,eAAe,EAClC,iDAAiD,CAClD,CAAA;QACH,CAAC;QAED,IAAI,CAAC,kBAAkB,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;YACjD,MAAM,IAAI,oBAAY,CACpB,oBAAY,CAAC,KAAK,CAAC,eAAe,EAClC,+CAA+C,CAChD,CAAA;QACH,CAAC;IACH,CAAC;AACH,CAAC,CACF,CAAA"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { AdditionalData, CreateCustomerAddressDTO } from "@acmekit/framework/types";
|
|
2
|
-
import { WorkflowData } from "@acmekit/framework/workflows-sdk";
|
|
3
|
-
/**
|
|
4
|
-
* The data to create one or more customer addresses, along with custom data that's passed to the workflow's hooks.
|
|
5
|
-
*/
|
|
6
|
-
export type CreateCustomerAddressesWorkflowInput = {
|
|
7
|
-
/**
|
|
8
|
-
* The addresses to create.
|
|
9
|
-
*/
|
|
10
|
-
addresses: CreateCustomerAddressDTO[];
|
|
11
|
-
} & AdditionalData;
|
|
12
|
-
export declare const createCustomerAddressesWorkflowId = "create-customer-addresses";
|
|
13
|
-
/**
|
|
14
|
-
* This workflow creates one or more addresses for customers. It's used by the [Add Customer Address Admin API Route](https://docs.acmekit.com/api/admin#customers_postcustomersidaddresses)
|
|
15
|
-
* and the [Add Customer Address Store API Route](https://docs.acmekit.com/api/store#customers_postcustomersmeaddresses).
|
|
16
|
-
*
|
|
17
|
-
* This workflow has a hook that allows you to perform custom actions on the created customer addresses. For example, you can pass under `additional_data` custom data that
|
|
18
|
-
* allows you to create custom data models linked to the addresses.
|
|
19
|
-
*
|
|
20
|
-
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around creating customer addresses.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* const { result } = await createCustomerAddressesWorkflow(container)
|
|
24
|
-
* .run({
|
|
25
|
-
* input: {
|
|
26
|
-
* addresses: [
|
|
27
|
-
* {
|
|
28
|
-
* customer_id: "cus_123",
|
|
29
|
-
* address_1: "456 Elm St",
|
|
30
|
-
* city: "Los Angeles",
|
|
31
|
-
* country_code: "us",
|
|
32
|
-
* postal_code: "90001",
|
|
33
|
-
* first_name: "Jane",
|
|
34
|
-
* last_name: "Smith",
|
|
35
|
-
* },
|
|
36
|
-
* {
|
|
37
|
-
* customer_id: "cus_321",
|
|
38
|
-
* address_1: "789 Oak St",
|
|
39
|
-
* city: "New York",
|
|
40
|
-
* country_code: "us",
|
|
41
|
-
* postal_code: "10001",
|
|
42
|
-
* first_name: "Alice",
|
|
43
|
-
* last_name: "Johnson",
|
|
44
|
-
* }
|
|
45
|
-
* ],
|
|
46
|
-
* additional_data: {
|
|
47
|
-
* crm_id: "123"
|
|
48
|
-
* }
|
|
49
|
-
* }
|
|
50
|
-
* })
|
|
51
|
-
*
|
|
52
|
-
* @summary
|
|
53
|
-
*
|
|
54
|
-
* Create one or more customer addresses.
|
|
55
|
-
*
|
|
56
|
-
* @property hooks.addressesCreated - This hook is executed after the addresses are created. You can consume this hook to perform custom actions on the created addresses.
|
|
57
|
-
*/
|
|
58
|
-
export declare const createCustomerAddressesWorkflow: import("@acmekit/framework/workflows-sdk").ReturnWorkflow<CreateCustomerAddressesWorkflowInput, import("@acmekit/framework/types").CustomerAddressDTO[], [import("@acmekit/framework/workflows-sdk").Hook<"addressesCreated", {
|
|
59
|
-
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[]> & {
|
|
60
|
-
config(config: {
|
|
61
|
-
name?: string;
|
|
62
|
-
} & Omit<import("@acmekit/orchestration").TransactionStepsDefinition, "next" | "uuid" | "action">): WorkflowData<import("@acmekit/framework/types").CustomerAddressDTO[]>;
|
|
63
|
-
} & import("@acmekit/framework/workflows-sdk").StepFunctionReturnConfig<import("@acmekit/framework/types").CustomerAddressDTO[]>;
|
|
64
|
-
additional_data: ((Record<string, unknown> | WorkflowData<Record<string, unknown> | undefined>) & Record<string, unknown>) | undefined;
|
|
65
|
-
}, unknown>]>;
|
|
66
|
-
//# sourceMappingURL=create-addresses.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-addresses.d.ts","sourceRoot":"","sources":["../../../src/customer/workflows/create-addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,wBAAwB,EACzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,YAAY,EAMb,MAAM,kCAAkC,CAAA;AAOzC;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD;;OAEG;IACH,SAAS,EAAE,wBAAwB,EAAE,CAAA;CACtC,GAAG,cAAc,CAAA;AAElB,eAAO,MAAM,iCAAiC,8BAA8B,CAAA;AAC5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,eAAO,MAAM,+BAA+B;;;gBACrB,CAAC;;;;aAqBvB,CAAA"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCustomerAddressesWorkflow = exports.createCustomerAddressesWorkflowId = void 0;
|
|
4
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
5
|
-
const steps_1 = require("../steps");
|
|
6
|
-
exports.createCustomerAddressesWorkflowId = "create-customer-addresses";
|
|
7
|
-
/**
|
|
8
|
-
* This workflow creates one or more addresses for customers. It's used by the [Add Customer Address Admin API Route](https://docs.acmekit.com/api/admin#customers_postcustomersidaddresses)
|
|
9
|
-
* and the [Add Customer Address Store API Route](https://docs.acmekit.com/api/store#customers_postcustomersmeaddresses).
|
|
10
|
-
*
|
|
11
|
-
* This workflow has a hook that allows you to perform custom actions on the created customer addresses. For example, you can pass under `additional_data` custom data that
|
|
12
|
-
* allows you to create 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 creating customer addresses.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* const { result } = await createCustomerAddressesWorkflow(container)
|
|
18
|
-
* .run({
|
|
19
|
-
* input: {
|
|
20
|
-
* addresses: [
|
|
21
|
-
* {
|
|
22
|
-
* customer_id: "cus_123",
|
|
23
|
-
* address_1: "456 Elm St",
|
|
24
|
-
* city: "Los Angeles",
|
|
25
|
-
* country_code: "us",
|
|
26
|
-
* postal_code: "90001",
|
|
27
|
-
* first_name: "Jane",
|
|
28
|
-
* last_name: "Smith",
|
|
29
|
-
* },
|
|
30
|
-
* {
|
|
31
|
-
* customer_id: "cus_321",
|
|
32
|
-
* address_1: "789 Oak St",
|
|
33
|
-
* city: "New York",
|
|
34
|
-
* country_code: "us",
|
|
35
|
-
* postal_code: "10001",
|
|
36
|
-
* first_name: "Alice",
|
|
37
|
-
* last_name: "Johnson",
|
|
38
|
-
* }
|
|
39
|
-
* ],
|
|
40
|
-
* additional_data: {
|
|
41
|
-
* crm_id: "123"
|
|
42
|
-
* }
|
|
43
|
-
* }
|
|
44
|
-
* })
|
|
45
|
-
*
|
|
46
|
-
* @summary
|
|
47
|
-
*
|
|
48
|
-
* Create one or more customer addresses.
|
|
49
|
-
*
|
|
50
|
-
* @property hooks.addressesCreated - This hook is executed after the addresses are created. You can consume this hook to perform custom actions on the created addresses.
|
|
51
|
-
*/
|
|
52
|
-
exports.createCustomerAddressesWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.createCustomerAddressesWorkflowId, (input) => {
|
|
53
|
-
const unsetInput = (0, workflows_sdk_1.transform)(input, (data) => ({
|
|
54
|
-
create: data.addresses,
|
|
55
|
-
}));
|
|
56
|
-
(0, workflows_sdk_1.parallelize)((0, steps_1.maybeUnsetDefaultShippingAddressesStep)(unsetInput), (0, steps_1.maybeUnsetDefaultBillingAddressesStep)(unsetInput));
|
|
57
|
-
const createdAddresses = (0, steps_1.createCustomerAddressesStep)(input.addresses);
|
|
58
|
-
const addressesCreated = (0, workflows_sdk_1.createHook)("addressesCreated", {
|
|
59
|
-
addresses: createdAddresses,
|
|
60
|
-
additional_data: input.additional_data,
|
|
61
|
-
});
|
|
62
|
-
return new workflows_sdk_1.WorkflowResponse(createdAddresses, {
|
|
63
|
-
hooks: [addressesCreated],
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
//# sourceMappingURL=create-addresses.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-addresses.js","sourceRoot":"","sources":["../../../src/customer/workflows/create-addresses.ts"],"names":[],"mappings":";;;AAIA,oEAOyC;AACzC,oCAIiB;AAYJ,QAAA,iCAAiC,GAAG,2BAA2B,CAAA;AAC5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;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,CAAC,SAAS;KACvB,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,SAAS,CAAC,CAAA;IACrE,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,44 +0,0 @@
|
|
|
1
|
-
import type { CreateCustomerDTO, CustomerDTO } from "@acmekit/framework/types";
|
|
2
|
-
/**
|
|
3
|
-
* The details of the customer account to create.
|
|
4
|
-
*/
|
|
5
|
-
export type CreateCustomerAccountWorkflowInput = {
|
|
6
|
-
/**
|
|
7
|
-
* The ID of the auth identity to attach the customer to.
|
|
8
|
-
*/
|
|
9
|
-
authIdentityId: string;
|
|
10
|
-
/**
|
|
11
|
-
* The details of the customer to create.
|
|
12
|
-
*/
|
|
13
|
-
customerData: CreateCustomerDTO;
|
|
14
|
-
};
|
|
15
|
-
export declare const createCustomerAccountWorkflowId = "create-customer-account";
|
|
16
|
-
/**
|
|
17
|
-
* This workflow creates a customer and attaches it to an auth identity. It's used by the
|
|
18
|
-
* [Register Customer Store API Route](https://docs.acmekit.com/api/store#customers_postcustomers).
|
|
19
|
-
*
|
|
20
|
-
* You can create an auth identity first using the [Retrieve Registration JWT Token API Route](https://docs.acmekit.com/api/store#auth_postactor_typeauth_provider_register).
|
|
21
|
-
* Learn more about basic authentication flows in [this documentation](https://docs.acmekit.com/resources/commerce-modules/auth/authentication-route).
|
|
22
|
-
*
|
|
23
|
-
* You can use this workflow within your customizations or your own custom workflows, allowing you to
|
|
24
|
-
* register or create customer accounts within your custom flows.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* const { result } = await createCustomerAccountWorkflow(container)
|
|
28
|
-
* .run({
|
|
29
|
-
* input: {
|
|
30
|
-
* authIdentityId: "au_1234",
|
|
31
|
-
* customerData: {
|
|
32
|
-
* first_name: "John",
|
|
33
|
-
* last_name: "Doe",
|
|
34
|
-
* email: "john.doe@example.com",
|
|
35
|
-
* }
|
|
36
|
-
* }
|
|
37
|
-
* })
|
|
38
|
-
*
|
|
39
|
-
* @summary
|
|
40
|
-
*
|
|
41
|
-
* Create or register a customer account.
|
|
42
|
-
*/
|
|
43
|
-
export declare const createCustomerAccountWorkflow: import("@acmekit/framework/workflows-sdk").ReturnWorkflow<CreateCustomerAccountWorkflowInput, CustomerDTO, []>;
|
|
44
|
-
//# sourceMappingURL=create-customer-account.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-customer-account.d.ts","sourceRoot":"","sources":["../../../src/customer/workflows/create-customer-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAW9E;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C;;OAEG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,YAAY,EAAE,iBAAiB,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,+BAA+B,4BAA4B,CAAA;AACxE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,6BAA6B,gHAiCzC,CAAA"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCustomerAccountWorkflow = exports.createCustomerAccountWorkflowId = void 0;
|
|
4
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
5
|
-
const auth_1 = require("../../auth");
|
|
6
|
-
const validate_customer_account_creation_1 = require("../steps/validate-customer-account-creation");
|
|
7
|
-
const create_customers_1 = require("./create-customers");
|
|
8
|
-
exports.createCustomerAccountWorkflowId = "create-customer-account";
|
|
9
|
-
/**
|
|
10
|
-
* This workflow creates a customer and attaches it to an auth identity. It's used by the
|
|
11
|
-
* [Register Customer Store API Route](https://docs.acmekit.com/api/store#customers_postcustomers).
|
|
12
|
-
*
|
|
13
|
-
* You can create an auth identity first using the [Retrieve Registration JWT Token API Route](https://docs.acmekit.com/api/store#auth_postactor_typeauth_provider_register).
|
|
14
|
-
* Learn more about basic authentication flows in [this documentation](https://docs.acmekit.com/resources/commerce-modules/auth/authentication-route).
|
|
15
|
-
*
|
|
16
|
-
* You can use this workflow within your customizations or your own custom workflows, allowing you to
|
|
17
|
-
* register or create customer accounts within your custom flows.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* const { result } = await createCustomerAccountWorkflow(container)
|
|
21
|
-
* .run({
|
|
22
|
-
* input: {
|
|
23
|
-
* authIdentityId: "au_1234",
|
|
24
|
-
* customerData: {
|
|
25
|
-
* first_name: "John",
|
|
26
|
-
* last_name: "Doe",
|
|
27
|
-
* email: "john.doe@example.com",
|
|
28
|
-
* }
|
|
29
|
-
* }
|
|
30
|
-
* })
|
|
31
|
-
*
|
|
32
|
-
* @summary
|
|
33
|
-
*
|
|
34
|
-
* Create or register a customer account.
|
|
35
|
-
*/
|
|
36
|
-
exports.createCustomerAccountWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.createCustomerAccountWorkflowId, (input) => {
|
|
37
|
-
(0, validate_customer_account_creation_1.validateCustomerAccountCreation)(input);
|
|
38
|
-
const customerData = (0, workflows_sdk_1.transform)({ input }, (data) => {
|
|
39
|
-
return {
|
|
40
|
-
...data.input.customerData,
|
|
41
|
-
has_account: !!data.input.authIdentityId,
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
const customers = create_customers_1.createCustomersWorkflow.runAsStep({
|
|
45
|
-
input: {
|
|
46
|
-
customersData: [customerData],
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
const customer = (0, workflows_sdk_1.transform)(customers, (customers) => customers[0]);
|
|
50
|
-
(0, auth_1.setAuthAppMetadataStep)({
|
|
51
|
-
authIdentityId: input.authIdentityId,
|
|
52
|
-
actorType: "customer",
|
|
53
|
-
value: customer.id,
|
|
54
|
-
});
|
|
55
|
-
return new workflows_sdk_1.WorkflowResponse(customer);
|
|
56
|
-
});
|
|
57
|
-
//# sourceMappingURL=create-customer-account.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-customer-account.js","sourceRoot":"","sources":["../../../src/customer/workflows/create-customer-account.ts"],"names":[],"mappings":";;;AACA,oEAKyC;AACzC,qCAAmD;AACnD,oGAA6F;AAC7F,yDAA4D;AAgB/C,QAAA,+BAA+B,GAAG,yBAAyB,CAAA;AACxE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACU,QAAA,6BAA6B,GAAG,IAAA,8BAAc,EACzD,uCAA+B,EAC/B,CACE,KAAuD,EACxB,EAAE;IACjC,IAAA,oEAA+B,EAAC,KAAK,CAAC,CAAA;IAEtC,MAAM,YAAY,GAAG,IAAA,yBAAS,EAAC,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;QACjD,OAAO;YACL,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY;YAC1B,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc;SACzC,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,SAAS,GAAG,0CAAuB,CAAC,SAAS,CAAC;QAClD,KAAK,EAAE;YACL,aAAa,EAAE,CAAC,YAAY,CAAC;SAC9B;KACF,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,IAAA,yBAAS,EACxB,SAAS,EACT,CAAC,SAAwB,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAC3C,CAAA;IAED,IAAA,6BAAsB,EAAC;QACrB,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,SAAS,EAAE,UAAU;QACrB,KAAK,EAAE,QAAQ,CAAC,EAAE;KACnB,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,QAAQ,CAAC,CAAA;AACvC,CAAC,CACF,CAAA"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { AdditionalData, CreateCustomerDTO } from "@acmekit/framework/types";
|
|
2
|
-
import { WorkflowData } from "@acmekit/framework/workflows-sdk";
|
|
3
|
-
/**
|
|
4
|
-
* The data to create one or more customers, along with custom data that's passed to the workflow's hooks.
|
|
5
|
-
*/
|
|
6
|
-
export type CreateCustomersWorkflowInput = {
|
|
7
|
-
/**
|
|
8
|
-
* The customers to create.
|
|
9
|
-
*/
|
|
10
|
-
customersData: CreateCustomerDTO[];
|
|
11
|
-
} & AdditionalData;
|
|
12
|
-
export declare const createCustomersWorkflowId = "create-customers";
|
|
13
|
-
/**
|
|
14
|
-
* This workflow creates one or more customers. It's used by the [Create Customer Admin API Route](https://docs.acmekit.com/api/admin#customers_postcustomers).
|
|
15
|
-
*
|
|
16
|
-
* This workflow has a hook that allows you to perform custom actions on the created customer. You can see an example in [this guide](https://docs.acmekit.com/resources/commerce-modules/customer/extend).
|
|
17
|
-
*
|
|
18
|
-
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around creating customers.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* const { result } = await createCustomersWorkflow(container)
|
|
22
|
-
* .run({
|
|
23
|
-
* input: {
|
|
24
|
-
* customersData: [
|
|
25
|
-
* {
|
|
26
|
-
* first_name: "John",
|
|
27
|
-
* last_name: "Doe",
|
|
28
|
-
* email: "john.doe@example.com",
|
|
29
|
-
* },
|
|
30
|
-
* ],
|
|
31
|
-
* additional_data: {
|
|
32
|
-
* position_name: "Editor",
|
|
33
|
-
* }
|
|
34
|
-
* }
|
|
35
|
-
* })
|
|
36
|
-
*
|
|
37
|
-
* @summary
|
|
38
|
-
*
|
|
39
|
-
* Create one or more customers.
|
|
40
|
-
*
|
|
41
|
-
* @property hooks.customersCreated - This hook is executed after the customers are created. You can consume this hook to perform custom actions on the created customers.
|
|
42
|
-
*/
|
|
43
|
-
export declare const createCustomersWorkflow: import("@acmekit/framework/workflows-sdk").ReturnWorkflow<CreateCustomersWorkflowInput, import("@acmekit/framework/types").CustomerDTO[], [import("@acmekit/framework/workflows-sdk").Hook<"customersCreated", {
|
|
44
|
-
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[]> & {
|
|
45
|
-
config(config: {
|
|
46
|
-
name?: string;
|
|
47
|
-
} & Omit<import("@acmekit/orchestration").TransactionStepsDefinition, "next" | "uuid" | "action">): WorkflowData<import("@acmekit/framework/types").CustomerDTO[]>;
|
|
48
|
-
} & import("@acmekit/framework/workflows-sdk").StepFunctionReturnConfig<import("@acmekit/framework/types").CustomerDTO[]>;
|
|
49
|
-
additional_data: ((Record<string, unknown> | WorkflowData<Record<string, unknown> | undefined>) & Record<string, unknown>) | undefined;
|
|
50
|
-
}, unknown>]>;
|
|
51
|
-
//# sourceMappingURL=create-customers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-customers.d.ts","sourceRoot":"","sources":["../../../src/customer/workflows/create-customers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACL,YAAY,EAKb,MAAM,kCAAkC,CAAA;AAIzC;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,aAAa,EAAE,iBAAiB,EAAE,CAAA;CACnC,GAAG,cAAc,CAAA;AAElB,eAAO,MAAM,yBAAyB,qBAAqB,CAAA;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,uBAAuB;;;gBAuBrB,CAAA;;;;aAId,CAAA"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCustomersWorkflow = exports.createCustomersWorkflowId = 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.createCustomersWorkflowId = "create-customers";
|
|
9
|
-
/**
|
|
10
|
-
* This workflow creates one or more customers. It's used by the [Create Customer Admin API Route](https://docs.acmekit.com/api/admin#customers_postcustomers).
|
|
11
|
-
*
|
|
12
|
-
* This workflow has a hook that allows you to perform custom actions on the created customer. You can see an example in [this guide](https://docs.acmekit.com/resources/commerce-modules/customer/extend).
|
|
13
|
-
*
|
|
14
|
-
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around creating customers.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* const { result } = await createCustomersWorkflow(container)
|
|
18
|
-
* .run({
|
|
19
|
-
* input: {
|
|
20
|
-
* customersData: [
|
|
21
|
-
* {
|
|
22
|
-
* first_name: "John",
|
|
23
|
-
* last_name: "Doe",
|
|
24
|
-
* email: "john.doe@example.com",
|
|
25
|
-
* },
|
|
26
|
-
* ],
|
|
27
|
-
* additional_data: {
|
|
28
|
-
* position_name: "Editor",
|
|
29
|
-
* }
|
|
30
|
-
* }
|
|
31
|
-
* })
|
|
32
|
-
*
|
|
33
|
-
* @summary
|
|
34
|
-
*
|
|
35
|
-
* Create one or more customers.
|
|
36
|
-
*
|
|
37
|
-
* @property hooks.customersCreated - This hook is executed after the customers are created. You can consume this hook to perform custom actions on the created customers.
|
|
38
|
-
*/
|
|
39
|
-
exports.createCustomersWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.createCustomersWorkflowId, (input) => {
|
|
40
|
-
const createdCustomers = (0, steps_1.createCustomersStep)(input.customersData);
|
|
41
|
-
const customersCreated = (0, workflows_sdk_1.createHook)("customersCreated", {
|
|
42
|
-
customers: createdCustomers,
|
|
43
|
-
additional_data: input.additional_data,
|
|
44
|
-
});
|
|
45
|
-
const customerIdEvents = (0, workflows_sdk_1.transform)({ createdCustomers }, ({ createdCustomers }) => {
|
|
46
|
-
return createdCustomers.map((v) => {
|
|
47
|
-
return { id: v.id };
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
(0, emit_event_1.emitEventStep)({
|
|
51
|
-
eventName: utils_1.CustomerWorkflowEvents.CREATED,
|
|
52
|
-
data: customerIdEvents,
|
|
53
|
-
});
|
|
54
|
-
return new workflows_sdk_1.WorkflowResponse(createdCustomers, {
|
|
55
|
-
hooks: [customersCreated],
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
//# sourceMappingURL=create-customers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-customers.js","sourceRoot":"","sources":["../../../src/customer/workflows/create-customers.ts"],"names":[],"mappings":";;;AAIA,oDAAiE;AACjE,oEAMyC;AACzC,8DAA6D;AAC7D,oCAA8C;AAYjC,QAAA,yBAAyB,GAAG,kBAAkB,CAAA;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACU,QAAA,uBAAuB,GAAG,IAAA,8BAAc,EACnD,iCAAyB,EACzB,CAAC,KAAiD,EAAE,EAAE;IACpD,MAAM,gBAAgB,GAAG,IAAA,2BAAmB,EAAC,KAAK,CAAC,aAAa,CAAC,CAAA;IACjE,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,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAChC,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAA;QACrB,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,47 +0,0 @@
|
|
|
1
|
-
import { WorkflowData } from "@acmekit/framework/workflows-sdk";
|
|
2
|
-
/**
|
|
3
|
-
* The details of the addresses to delete.
|
|
4
|
-
*/
|
|
5
|
-
export type DeleteCustomerAddressesWorkflowInput = {
|
|
6
|
-
/**
|
|
7
|
-
* The IDs of the addresses to delete.
|
|
8
|
-
*/
|
|
9
|
-
ids: string[];
|
|
10
|
-
};
|
|
11
|
-
export declare const deleteCustomerAddressesWorkflowId = "delete-customer-addresses";
|
|
12
|
-
/**
|
|
13
|
-
* This workflow deletes one or more customer addresses. It's used by the
|
|
14
|
-
* [Remove Customer Addresses Admin API Route](https://docs.acmekit.com/api/admin#customers_deletecustomersidaddressesaddress_id)
|
|
15
|
-
* and the [Remove Customer Addresses Store API Route](https://docs.acmekit.com/api/store#customers_deletecustomersmeaddressesaddress_id).
|
|
16
|
-
*
|
|
17
|
-
* :::note
|
|
18
|
-
*
|
|
19
|
-
* This workflow deletes addresses created by the [Customer Module](https://docs.acmekit.com/resources/commerce-modules/customer)
|
|
20
|
-
* only. So, you can't delete addresses attached to a cart, for example. To do that, use the workflow
|
|
21
|
-
* relevant to that module.
|
|
22
|
-
*
|
|
23
|
-
* :::
|
|
24
|
-
*
|
|
25
|
-
* You can use this workflow within your customizations or your own custom workflows, allowing you to
|
|
26
|
-
* delete customer addresses in your custom flows.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* const { result } = await deleteCustomerAddressesWorkflow(container)
|
|
30
|
-
* .run({
|
|
31
|
-
* input: {
|
|
32
|
-
* ids: [
|
|
33
|
-
* "cuaddress_123"
|
|
34
|
-
* ]
|
|
35
|
-
* }
|
|
36
|
-
* })
|
|
37
|
-
*
|
|
38
|
-
* @summary
|
|
39
|
-
*
|
|
40
|
-
* Delete one or more customer addresses.
|
|
41
|
-
*
|
|
42
|
-
* @property hooks.addressesDeleted - This hook is executed after the addresses are deleted. You can consume this hook to perform custom actions.
|
|
43
|
-
*/
|
|
44
|
-
export declare const deleteCustomerAddressesWorkflow: import("@acmekit/framework/workflows-sdk").ReturnWorkflow<DeleteCustomerAddressesWorkflowInput, never, [import("@acmekit/framework/workflows-sdk").Hook<"addressesDeleted", {
|
|
45
|
-
ids: (string[] | WorkflowData<string[]>) & string[];
|
|
46
|
-
}, unknown>]>;
|
|
47
|
-
//# sourceMappingURL=delete-addresses.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-addresses.d.ts","sourceRoot":"","sources":["../../../src/customer/workflows/delete-addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAIb,MAAM,kCAAkC,CAAA;AAGzC;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD;;OAEG;IACH,GAAG,EAAE,MAAM,EAAE,CAAA;CACd,CAAA;AAED,eAAO,MAAM,iCAAiC,8BAA8B,CAAA;AAC5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,+BAA+B;;aAY3C,CAAA"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteCustomerAddressesWorkflow = exports.deleteCustomerAddressesWorkflowId = void 0;
|
|
4
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
5
|
-
const steps_1 = require("../steps");
|
|
6
|
-
exports.deleteCustomerAddressesWorkflowId = "delete-customer-addresses";
|
|
7
|
-
/**
|
|
8
|
-
* This workflow deletes one or more customer addresses. It's used by the
|
|
9
|
-
* [Remove Customer Addresses Admin API Route](https://docs.acmekit.com/api/admin#customers_deletecustomersidaddressesaddress_id)
|
|
10
|
-
* and the [Remove Customer Addresses Store API Route](https://docs.acmekit.com/api/store#customers_deletecustomersmeaddressesaddress_id).
|
|
11
|
-
*
|
|
12
|
-
* :::note
|
|
13
|
-
*
|
|
14
|
-
* This workflow deletes addresses created by the [Customer Module](https://docs.acmekit.com/resources/commerce-modules/customer)
|
|
15
|
-
* only. So, you can't delete addresses attached to a cart, for example. To do that, use the workflow
|
|
16
|
-
* relevant to that module.
|
|
17
|
-
*
|
|
18
|
-
* :::
|
|
19
|
-
*
|
|
20
|
-
* You can use this workflow within your customizations or your own custom workflows, allowing you to
|
|
21
|
-
* delete customer addresses in your custom flows.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* const { result } = await deleteCustomerAddressesWorkflow(container)
|
|
25
|
-
* .run({
|
|
26
|
-
* input: {
|
|
27
|
-
* ids: [
|
|
28
|
-
* "cuaddress_123"
|
|
29
|
-
* ]
|
|
30
|
-
* }
|
|
31
|
-
* })
|
|
32
|
-
*
|
|
33
|
-
* @summary
|
|
34
|
-
*
|
|
35
|
-
* Delete one or more customer addresses.
|
|
36
|
-
*
|
|
37
|
-
* @property hooks.addressesDeleted - This hook is executed after the addresses are deleted. You can consume this hook to perform custom actions.
|
|
38
|
-
*/
|
|
39
|
-
exports.deleteCustomerAddressesWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.deleteCustomerAddressesWorkflowId, (input) => {
|
|
40
|
-
const deletedAddresses = (0, steps_1.deleteCustomerAddressesStep)(input.ids);
|
|
41
|
-
const addressesDeleted = (0, workflows_sdk_1.createHook)("addressesDeleted", {
|
|
42
|
-
ids: input.ids,
|
|
43
|
-
});
|
|
44
|
-
return new workflows_sdk_1.WorkflowResponse(deletedAddresses, {
|
|
45
|
-
hooks: [addressesDeleted],
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=delete-addresses.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-addresses.js","sourceRoot":"","sources":["../../../src/customer/workflows/delete-addresses.ts"],"names":[],"mappings":";;;AAAA,oEAKyC;AACzC,oCAAsD;AAYzC,QAAA,iCAAiC,GAAG,2BAA2B,CAAA;AAC5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACU,QAAA,+BAA+B,GAAG,IAAA,8BAAc,EAC3D,yCAAiC,EACjC,CAAC,KAAyD,EAAE,EAAE;IAC5D,MAAM,gBAAgB,GAAG,IAAA,mCAA2B,EAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC/D,MAAM,gBAAgB,GAAG,IAAA,0BAAU,EAAC,kBAAkB,EAAE;QACtD,GAAG,EAAE,KAAK,CAAC,GAAG;KACf,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,gBAAgB,EAAE;QAC5C,KAAK,EAAE,CAAC,gBAAgB,CAAC;KAC1B,CAAC,CAAA;AACJ,CAAC,CACF,CAAA"}
|