@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,20 +0,0 @@
|
|
|
1
|
-
import { CreateCustomerDTO } from "@acmekit/framework/types";
|
|
2
|
-
/**
|
|
3
|
-
* The data to create one or more customers.
|
|
4
|
-
*/
|
|
5
|
-
export type CreateCustomersStepInput = CreateCustomerDTO[];
|
|
6
|
-
export declare const createCustomersStepId = "create-customers";
|
|
7
|
-
/**
|
|
8
|
-
* This step creates one or more customers.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* const data = createCustomersStep([
|
|
12
|
-
* {
|
|
13
|
-
* first_name: "John",
|
|
14
|
-
* last_name: "Doe",
|
|
15
|
-
* email: "customer@example.com",
|
|
16
|
-
* }
|
|
17
|
-
* ])
|
|
18
|
-
*/
|
|
19
|
-
export declare const createCustomersStep: import("@acmekit/framework/workflows-sdk").StepFunction<CreateCustomersStepInput, import("@acmekit/framework/types").CustomerDTO[]>;
|
|
20
|
-
//# sourceMappingURL=create-customers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-customers.d.ts","sourceRoot":"","sources":["../../../src/customer/steps/create-customers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAElB,MAAM,0BAA0B,CAAA;AAIjC;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,EAAE,CAAA;AAE1D,eAAO,MAAM,qBAAqB,qBAAqB,CAAA;AACvD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,qIAqB/B,CAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCustomersStep = exports.createCustomersStepId = void 0;
|
|
4
|
-
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
6
|
-
exports.createCustomersStepId = "create-customers";
|
|
7
|
-
/**
|
|
8
|
-
* This step creates one or more customers.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* const data = createCustomersStep([
|
|
12
|
-
* {
|
|
13
|
-
* first_name: "John",
|
|
14
|
-
* last_name: "Doe",
|
|
15
|
-
* email: "customer@example.com",
|
|
16
|
-
* }
|
|
17
|
-
* ])
|
|
18
|
-
*/
|
|
19
|
-
exports.createCustomersStep = (0, workflows_sdk_1.createStep)(exports.createCustomersStepId, async (data, { container }) => {
|
|
20
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
21
|
-
const createdCustomers = await service.createCustomers(data);
|
|
22
|
-
return new workflows_sdk_1.StepResponse(createdCustomers, createdCustomers.map((createdCustomers) => createdCustomers.id));
|
|
23
|
-
}, async (createdCustomerIds, { container }) => {
|
|
24
|
-
if (!createdCustomerIds?.length) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
28
|
-
await service.deleteCustomers(createdCustomerIds);
|
|
29
|
-
});
|
|
30
|
-
//# sourceMappingURL=create-customers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-customers.js","sourceRoot":"","sources":["../../../src/customer/steps/create-customers.ts"],"names":[],"mappings":";;;AAIA,oDAAkD;AAClD,oEAA2E;AAO9D,QAAA,qBAAqB,GAAG,kBAAkB,CAAA;AACvD;;;;;;;;;;;GAWG;AACU,QAAA,mBAAmB,GAAG,IAAA,0BAAU,EAC3C,6BAAqB,EACrB,KAAK,EAAE,IAA8B,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACtD,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;IAE5D,OAAO,IAAI,4BAAY,CACrB,gBAAgB,EAChB,gBAAgB,CAAC,GAAG,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAChE,CAAA;AACH,CAAC,EACD,KAAK,EAAE,kBAAkB,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAC1C,IAAI,CAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC;QAChC,OAAM;IACR,CAAC;IAED,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,OAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAA;AACnD,CAAC,CACF,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The IDs of the customer addresses to delete.
|
|
3
|
-
*/
|
|
4
|
-
export type DeleteCustomerAddressesStepInput = string[];
|
|
5
|
-
export declare const deleteCustomerAddressesStepId = "delete-customer-addresses";
|
|
6
|
-
/**
|
|
7
|
-
* This step deletes one or more customer addresses.
|
|
8
|
-
*/
|
|
9
|
-
export declare const deleteCustomerAddressesStep: import("@acmekit/framework/workflows-sdk").StepFunction<DeleteCustomerAddressesStepInput, undefined>;
|
|
10
|
-
//# sourceMappingURL=delete-addresses.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-addresses.d.ts","sourceRoot":"","sources":["../../../src/customer/steps/delete-addresses.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG,MAAM,EAAE,CAAA;AAEvD,eAAO,MAAM,6BAA6B,8BAA8B,CAAA;AACxE;;GAEG;AACH,eAAO,MAAM,2BAA2B,sGAqBvC,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteCustomerAddressesStep = exports.deleteCustomerAddressesStepId = void 0;
|
|
4
|
-
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
6
|
-
exports.deleteCustomerAddressesStepId = "delete-customer-addresses";
|
|
7
|
-
/**
|
|
8
|
-
* This step deletes one or more customer addresses.
|
|
9
|
-
*/
|
|
10
|
-
exports.deleteCustomerAddressesStep = (0, workflows_sdk_1.createStep)(exports.deleteCustomerAddressesStepId, async (ids, { container }) => {
|
|
11
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
12
|
-
const existing = await service.listCustomerAddresses({
|
|
13
|
-
id: ids,
|
|
14
|
-
});
|
|
15
|
-
await service.deleteCustomerAddresses(ids);
|
|
16
|
-
return new workflows_sdk_1.StepResponse(void 0, existing);
|
|
17
|
-
}, async (prevAddresses, { container }) => {
|
|
18
|
-
if (!prevAddresses?.length) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
22
|
-
await service.createCustomerAddresses(prevAddresses);
|
|
23
|
-
});
|
|
24
|
-
//# sourceMappingURL=delete-addresses.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-addresses.js","sourceRoot":"","sources":["../../../src/customer/steps/delete-addresses.ts"],"names":[],"mappings":";;;AACA,oDAAkD;AAClD,oEAA2E;AAO9D,QAAA,6BAA6B,GAAG,2BAA2B,CAAA;AACxE;;GAEG;AACU,QAAA,2BAA2B,GAAG,IAAA,0BAAU,EACnD,qCAA6B,EAC7B,KAAK,EAAE,GAAqC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAC7D,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,qBAAqB,CAAC;QACnD,EAAE,EAAE,GAAG;KACR,CAAC,CAAA;IACF,MAAM,OAAO,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAA;IAE1C,OAAO,IAAI,4BAAY,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAA;AAC3C,CAAC,EACD,KAAK,EAAE,aAAa,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACrC,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC;QAC3B,OAAM;IACR,CAAC;IAED,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,OAAO,CAAC,uBAAuB,CAAC,aAAa,CAAC,CAAA;AACtD,CAAC,CACF,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The IDs of the customers to delete.
|
|
3
|
-
*/
|
|
4
|
-
export type DeleteCustomersStepInput = string[];
|
|
5
|
-
export declare const deleteCustomersStepId = "delete-customers";
|
|
6
|
-
/**
|
|
7
|
-
* This step deletes one or more customers.
|
|
8
|
-
*/
|
|
9
|
-
export declare const deleteCustomersStep: import("@acmekit/framework/workflows-sdk").StepFunction<DeleteCustomersStepInput, undefined>;
|
|
10
|
-
//# sourceMappingURL=delete-customers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-customers.d.ts","sourceRoot":"","sources":["../../../src/customer/steps/delete-customers.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,EAAE,CAAA;AAE/C,eAAO,MAAM,qBAAqB,qBAAqB,CAAA;AACvD;;GAEG;AACH,eAAO,MAAM,mBAAmB,8FAkB/B,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteCustomersStep = exports.deleteCustomersStepId = void 0;
|
|
4
|
-
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
6
|
-
exports.deleteCustomersStepId = "delete-customers";
|
|
7
|
-
/**
|
|
8
|
-
* This step deletes one or more customers.
|
|
9
|
-
*/
|
|
10
|
-
exports.deleteCustomersStep = (0, workflows_sdk_1.createStep)(exports.deleteCustomersStepId, async (ids, { container }) => {
|
|
11
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
12
|
-
await service.softDeleteCustomers(ids);
|
|
13
|
-
return new workflows_sdk_1.StepResponse(void 0, ids);
|
|
14
|
-
}, async (prevCustomerIds, { container }) => {
|
|
15
|
-
if (!prevCustomerIds?.length) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
19
|
-
await service.restoreCustomers(prevCustomerIds);
|
|
20
|
-
});
|
|
21
|
-
//# sourceMappingURL=delete-customers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-customers.js","sourceRoot":"","sources":["../../../src/customer/steps/delete-customers.ts"],"names":[],"mappings":";;;AACA,oDAAkD;AAClD,oEAA2E;AAO9D,QAAA,qBAAqB,GAAG,kBAAkB,CAAA;AACvD;;GAEG;AACU,QAAA,mBAAmB,GAAG,IAAA,0BAAU,EAC3C,6BAAqB,EACrB,KAAK,EAAE,GAA6B,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACrD,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAA;IAEtC,OAAO,IAAI,4BAAY,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC,EACD,KAAK,EAAE,eAAe,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACvC,IAAI,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;QAC7B,OAAM;IACR,CAAC;IAED,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAA;AACjD,CAAC,CACF,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from "./create-customers";
|
|
2
|
-
export * from "./update-customers";
|
|
3
|
-
export * from "./delete-customers";
|
|
4
|
-
export * from "./create-addresses";
|
|
5
|
-
export * from "./update-addresses";
|
|
6
|
-
export * from "./delete-addresses";
|
|
7
|
-
export * from "./maybe-unset-default-billing-addresses";
|
|
8
|
-
export * from "./maybe-unset-default-shipping-addresses";
|
|
9
|
-
export * from "./validate-customer-account-creation";
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/customer/steps/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,yCAAyC,CAAA;AACvD,cAAc,0CAA0C,CAAA;AACxD,cAAc,sCAAsC,CAAA"}
|
|
@@ -1,26 +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-customers"), exports);
|
|
18
|
-
__exportStar(require("./update-customers"), exports);
|
|
19
|
-
__exportStar(require("./delete-customers"), exports);
|
|
20
|
-
__exportStar(require("./create-addresses"), exports);
|
|
21
|
-
__exportStar(require("./update-addresses"), exports);
|
|
22
|
-
__exportStar(require("./delete-addresses"), exports);
|
|
23
|
-
__exportStar(require("./maybe-unset-default-billing-addresses"), exports);
|
|
24
|
-
__exportStar(require("./maybe-unset-default-shipping-addresses"), exports);
|
|
25
|
-
__exportStar(require("./validate-customer-account-creation"), exports);
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/customer/steps/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,qDAAkC;AAClC,qDAAkC;AAClC,qDAAkC;AAClC,qDAAkC;AAClC,qDAAkC;AAClC,0EAAuD;AACvD,2EAAwD;AACxD,uEAAoD"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { CreateCustomerAddressDTO, FilterableCustomerAddressProps, UpdateCustomerAddressDTO } from "@acmekit/framework/types";
|
|
2
|
-
/**
|
|
3
|
-
* The addresses being created or updated.
|
|
4
|
-
*/
|
|
5
|
-
export type MaybeUnsetDefaultBillingAddressStepInput = {
|
|
6
|
-
/**
|
|
7
|
-
* The addresses being created. If the address has
|
|
8
|
-
* the `is_default_billing` property set to `true`,
|
|
9
|
-
* the existing default billing address of the customer will be unset.
|
|
10
|
-
*/
|
|
11
|
-
create?: CreateCustomerAddressDTO[];
|
|
12
|
-
/**
|
|
13
|
-
* The addresses being updated.
|
|
14
|
-
*/
|
|
15
|
-
update?: {
|
|
16
|
-
/**
|
|
17
|
-
* The selector to identify the customers to unset their default billing address.
|
|
18
|
-
*/
|
|
19
|
-
selector: FilterableCustomerAddressProps;
|
|
20
|
-
/**
|
|
21
|
-
* The address details to update. The `is_default_billing` property
|
|
22
|
-
* of existing customer addresses are only unset if
|
|
23
|
-
* the `is_default_billing` property in this object is set to `true`.
|
|
24
|
-
*/
|
|
25
|
-
update: UpdateCustomerAddressDTO;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export declare const maybeUnsetDefaultBillingAddressesStepId = "maybe-unset-default-billing-customer-addresses";
|
|
29
|
-
/**
|
|
30
|
-
* This step unsets the `is_default_billing` property of existing customer addresses
|
|
31
|
-
* if the `is_default_billing` property in the addresses in the input is set to `true`.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* const data = maybeUnsetDefaultBillingAddressesStep({
|
|
35
|
-
* create: [{
|
|
36
|
-
* customer_id: "cus_123",
|
|
37
|
-
* first_name: "John",
|
|
38
|
-
* last_name: "Doe",
|
|
39
|
-
* address_1: "123 Main St",
|
|
40
|
-
* city: "Anytown",
|
|
41
|
-
* country_code: "US",
|
|
42
|
-
* postal_code: "12345",
|
|
43
|
-
* phone: "555-555-5555"
|
|
44
|
-
* is_default_billing: true
|
|
45
|
-
* }],
|
|
46
|
-
* update: {
|
|
47
|
-
* selector: {
|
|
48
|
-
* customer_id: "cus_123"
|
|
49
|
-
* },
|
|
50
|
-
* update: {
|
|
51
|
-
* is_default_billing: true
|
|
52
|
-
* }
|
|
53
|
-
* }
|
|
54
|
-
* })
|
|
55
|
-
*/
|
|
56
|
-
export declare const maybeUnsetDefaultBillingAddressesStep: import("@acmekit/framework/workflows-sdk").StepFunction<MaybeUnsetDefaultBillingAddressStepInput, undefined>;
|
|
57
|
-
//# sourceMappingURL=maybe-unset-default-billing-addresses.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-unset-default-billing-addresses.d.ts","sourceRoot":"","sources":["../../../src/customer/steps/maybe-unset-default-billing-addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAE9B,wBAAwB,EACzB,MAAM,0BAA0B,CAAA;AAKjC;;GAEG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD;;;;OAIG;IACH,MAAM,CAAC,EAAE,wBAAwB,EAAE,CAAA;IACnC;;OAEG;IACH,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,QAAQ,EAAE,8BAA8B,CAAA;QACxC;;;;WAIG;QACH,MAAM,EAAE,wBAAwB,CAAA;KACjC,CAAA;CACF,CAAA;AAED,eAAO,MAAM,uCAAuC,mDACF,CAAA;AAClD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,qCAAqC,8GAuCjD,CAAA"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.maybeUnsetDefaultBillingAddressesStep = exports.maybeUnsetDefaultBillingAddressesStepId = void 0;
|
|
4
|
-
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
6
|
-
const utils_2 = require("./utils");
|
|
7
|
-
exports.maybeUnsetDefaultBillingAddressesStepId = "maybe-unset-default-billing-customer-addresses";
|
|
8
|
-
/**
|
|
9
|
-
* This step unsets the `is_default_billing` property of existing customer addresses
|
|
10
|
-
* if the `is_default_billing` property in the addresses in the input is set to `true`.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* const data = maybeUnsetDefaultBillingAddressesStep({
|
|
14
|
-
* create: [{
|
|
15
|
-
* customer_id: "cus_123",
|
|
16
|
-
* first_name: "John",
|
|
17
|
-
* last_name: "Doe",
|
|
18
|
-
* address_1: "123 Main St",
|
|
19
|
-
* city: "Anytown",
|
|
20
|
-
* country_code: "US",
|
|
21
|
-
* postal_code: "12345",
|
|
22
|
-
* phone: "555-555-5555"
|
|
23
|
-
* is_default_billing: true
|
|
24
|
-
* }],
|
|
25
|
-
* update: {
|
|
26
|
-
* selector: {
|
|
27
|
-
* customer_id: "cus_123"
|
|
28
|
-
* },
|
|
29
|
-
* update: {
|
|
30
|
-
* is_default_billing: true
|
|
31
|
-
* }
|
|
32
|
-
* }
|
|
33
|
-
* })
|
|
34
|
-
*/
|
|
35
|
-
exports.maybeUnsetDefaultBillingAddressesStep = (0, workflows_sdk_1.createStep)(exports.maybeUnsetDefaultBillingAddressesStepId, async (data, { container }) => {
|
|
36
|
-
const customerModuleService = container.resolve(utils_1.Modules.CUSTOMER);
|
|
37
|
-
if ((0, utils_1.isDefined)(data.create)) {
|
|
38
|
-
return (0, utils_2.unsetForCreate)(data.create, customerModuleService, "is_default_billing");
|
|
39
|
-
}
|
|
40
|
-
if ((0, utils_1.isDefined)(data.update)) {
|
|
41
|
-
return (0, utils_2.unsetForUpdate)(data.update, customerModuleService, "is_default_billing");
|
|
42
|
-
}
|
|
43
|
-
throw new Error("Invalid step input");
|
|
44
|
-
}, async (addressesToSet, { container }) => {
|
|
45
|
-
if (!addressesToSet?.length) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const customerModuleService = container.resolve(utils_1.Modules.CUSTOMER);
|
|
49
|
-
await customerModuleService.updateCustomerAddresses({ id: addressesToSet }, { is_default_billing: true });
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=maybe-unset-default-billing-addresses.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-unset-default-billing-addresses.js","sourceRoot":"","sources":["../../../src/customer/steps/maybe-unset-default-billing-addresses.ts"],"names":[],"mappings":";;;AAMA,oDAA6D;AAC7D,oEAA6D;AAC7D,mCAAwD;AA6B3C,QAAA,uCAAuC,GAClD,gDAAgD,CAAA;AAClD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACU,QAAA,qCAAqC,GAAG,IAAA,0BAAU,EAC7D,+CAAuC,EACvC,KAAK,EAAE,IAA8C,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACtE,MAAM,qBAAqB,GAAG,SAAS,CAAC,OAAO,CAC7C,eAAO,CAAC,QAAQ,CACjB,CAAA;IAED,IAAI,IAAA,iBAAS,EAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAA,sBAAc,EACnB,IAAI,CAAC,MAAM,EACX,qBAAqB,EACrB,oBAAoB,CACrB,CAAA;IACH,CAAC;IAED,IAAI,IAAA,iBAAS,EAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAA,sBAAc,EACnB,IAAI,CAAC,MAAM,EACX,qBAAqB,EACrB,oBAAoB,CACrB,CAAA;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;AACvC,CAAC,EACD,KAAK,EAAE,cAAc,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACtC,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;QAC5B,OAAM;IACR,CAAC;IAED,MAAM,qBAAqB,GAAG,SAAS,CAAC,OAAO,CAC7C,eAAO,CAAC,QAAQ,CACjB,CAAA;IAED,MAAM,qBAAqB,CAAC,uBAAuB,CACjD,EAAE,EAAE,EAAE,cAAc,EAAE,EACtB,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAC7B,CAAA;AACH,CAAC,CACF,CAAA"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { CreateCustomerAddressDTO, FilterableCustomerAddressProps, UpdateCustomerAddressDTO } from "@acmekit/framework/types";
|
|
2
|
-
/**
|
|
3
|
-
* The addresses being created or updated.
|
|
4
|
-
*/
|
|
5
|
-
export type MaybeUnsetDefaultShippingAddressesStepInput = {
|
|
6
|
-
/**
|
|
7
|
-
* The addresses being created. If the address has
|
|
8
|
-
* the `is_default_shipping` property set to `true`,
|
|
9
|
-
* the existing default shipping address of the customer will be unset.
|
|
10
|
-
*/
|
|
11
|
-
create?: CreateCustomerAddressDTO[];
|
|
12
|
-
/**
|
|
13
|
-
* The addresses being updated.
|
|
14
|
-
*/
|
|
15
|
-
update?: {
|
|
16
|
-
/**
|
|
17
|
-
* The selector to identify the customers to unset their default shipping address.
|
|
18
|
-
*/
|
|
19
|
-
selector: FilterableCustomerAddressProps;
|
|
20
|
-
/**
|
|
21
|
-
* The address details to update. The `is_default_shipping` property
|
|
22
|
-
* of existing customer addresses are only unset if
|
|
23
|
-
* the `is_default_shipping` property in this object is set to `true`.
|
|
24
|
-
*/
|
|
25
|
-
update: UpdateCustomerAddressDTO;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export declare const maybeUnsetDefaultShippingAddressesStepId = "maybe-unset-default-shipping-customer-addresses";
|
|
29
|
-
/**
|
|
30
|
-
* This step unsets the `is_default_billing` property of existing customer addresses
|
|
31
|
-
* if the `is_default_billing` property in the addresses in the input is set to `true`.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* const data = maybeUnsetDefaultShippingAddressesStep({
|
|
35
|
-
* create: [{
|
|
36
|
-
* customer_id: "cus_123",
|
|
37
|
-
* first_name: "John",
|
|
38
|
-
* last_name: "Doe",
|
|
39
|
-
* address_1: "123 Main St",
|
|
40
|
-
* city: "Anytown",
|
|
41
|
-
* country_code: "US",
|
|
42
|
-
* postal_code: "12345",
|
|
43
|
-
* phone: "555-555-5555",
|
|
44
|
-
* is_default_shipping: true
|
|
45
|
-
* }],
|
|
46
|
-
* update: {
|
|
47
|
-
* selector: {
|
|
48
|
-
* customer_id: "cus_123"
|
|
49
|
-
* },
|
|
50
|
-
* update: {
|
|
51
|
-
* is_default_shipping: true
|
|
52
|
-
* }
|
|
53
|
-
* }
|
|
54
|
-
* })
|
|
55
|
-
*/
|
|
56
|
-
export declare const maybeUnsetDefaultShippingAddressesStep: import("@acmekit/framework/workflows-sdk").StepFunction<MaybeUnsetDefaultShippingAddressesStepInput, undefined>;
|
|
57
|
-
//# sourceMappingURL=maybe-unset-default-shipping-addresses.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-unset-default-shipping-addresses.d.ts","sourceRoot":"","sources":["../../../src/customer/steps/maybe-unset-default-shipping-addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAE9B,wBAAwB,EACzB,MAAM,0BAA0B,CAAA;AAKjC;;GAEG;AACH,MAAM,MAAM,2CAA2C,GAAG;IACxD;;;;OAIG;IACH,MAAM,CAAC,EAAE,wBAAwB,EAAE,CAAA;IACnC;;OAEG;IACH,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,QAAQ,EAAE,8BAA8B,CAAA;QACxC;;;;WAIG;QACH,MAAM,EAAE,wBAAwB,CAAA;KACjC,CAAA;CACF,CAAA;AAED,eAAO,MAAM,wCAAwC,oDACF,CAAA;AACnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,sCAAsC,iHAsClD,CAAA"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.maybeUnsetDefaultShippingAddressesStep = exports.maybeUnsetDefaultShippingAddressesStepId = void 0;
|
|
4
|
-
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
6
|
-
const utils_2 = require("./utils");
|
|
7
|
-
exports.maybeUnsetDefaultShippingAddressesStepId = "maybe-unset-default-shipping-customer-addresses";
|
|
8
|
-
/**
|
|
9
|
-
* This step unsets the `is_default_billing` property of existing customer addresses
|
|
10
|
-
* if the `is_default_billing` property in the addresses in the input is set to `true`.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* const data = maybeUnsetDefaultShippingAddressesStep({
|
|
14
|
-
* create: [{
|
|
15
|
-
* customer_id: "cus_123",
|
|
16
|
-
* first_name: "John",
|
|
17
|
-
* last_name: "Doe",
|
|
18
|
-
* address_1: "123 Main St",
|
|
19
|
-
* city: "Anytown",
|
|
20
|
-
* country_code: "US",
|
|
21
|
-
* postal_code: "12345",
|
|
22
|
-
* phone: "555-555-5555",
|
|
23
|
-
* is_default_shipping: true
|
|
24
|
-
* }],
|
|
25
|
-
* update: {
|
|
26
|
-
* selector: {
|
|
27
|
-
* customer_id: "cus_123"
|
|
28
|
-
* },
|
|
29
|
-
* update: {
|
|
30
|
-
* is_default_shipping: true
|
|
31
|
-
* }
|
|
32
|
-
* }
|
|
33
|
-
* })
|
|
34
|
-
*/
|
|
35
|
-
exports.maybeUnsetDefaultShippingAddressesStep = (0, workflows_sdk_1.createStep)(exports.maybeUnsetDefaultShippingAddressesStepId, async (data, { container }) => {
|
|
36
|
-
const customerModuleService = container.resolve(utils_1.Modules.CUSTOMER);
|
|
37
|
-
if ((0, utils_1.isDefined)(data.create)) {
|
|
38
|
-
return (0, utils_2.unsetForCreate)(data.create, customerModuleService, "is_default_shipping");
|
|
39
|
-
}
|
|
40
|
-
if ((0, utils_1.isDefined)(data.update)) {
|
|
41
|
-
return (0, utils_2.unsetForUpdate)(data.update, customerModuleService, "is_default_shipping");
|
|
42
|
-
}
|
|
43
|
-
throw new Error("Invalid step input");
|
|
44
|
-
}, async (addressesToSet, { container }) => {
|
|
45
|
-
if (!addressesToSet?.length) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const customerModuleService = container.resolve(utils_1.Modules.CUSTOMER);
|
|
49
|
-
await customerModuleService.updateCustomerAddresses({ id: addressesToSet }, { is_default_shipping: true });
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=maybe-unset-default-shipping-addresses.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"maybe-unset-default-shipping-addresses.js","sourceRoot":"","sources":["../../../src/customer/steps/maybe-unset-default-shipping-addresses.ts"],"names":[],"mappings":";;;AAMA,oDAA6D;AAC7D,oEAA6D;AAC7D,mCAAwD;AA6B3C,QAAA,wCAAwC,GACnD,iDAAiD,CAAA;AACnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACU,QAAA,sCAAsC,GAAG,IAAA,0BAAU,EAC9D,gDAAwC,EACxC,KAAK,EAAE,IAAiD,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACzE,MAAM,qBAAqB,GAAG,SAAS,CAAC,OAAO,CAC7C,eAAO,CAAC,QAAQ,CACjB,CAAA;IACD,IAAI,IAAA,iBAAS,EAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAA,sBAAc,EACnB,IAAI,CAAC,MAAM,EACX,qBAAqB,EACrB,qBAAqB,CACtB,CAAA;IACH,CAAC;IAED,IAAI,IAAA,iBAAS,EAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,OAAO,IAAA,sBAAc,EACnB,IAAI,CAAC,MAAM,EACX,qBAAqB,EACrB,qBAAqB,CACtB,CAAA;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;AACvC,CAAC,EACD,KAAK,EAAE,cAAc,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACtC,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;QAC5B,OAAM;IACR,CAAC;IAED,MAAM,qBAAqB,GAAG,SAAS,CAAC,OAAO,CAC7C,eAAO,CAAC,QAAQ,CACjB,CAAA;IAED,MAAM,qBAAqB,CAAC,uBAAuB,CACjD,EAAE,EAAE,EAAE,cAAc,EAAE,EACtB,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAC9B,CAAA;AACH,CAAC,CACF,CAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { FilterableCustomerAddressProps, UpdateCustomerAddressDTO } from "@acmekit/framework/types";
|
|
2
|
-
/**
|
|
3
|
-
* The data to update one or more customer addresses.
|
|
4
|
-
*/
|
|
5
|
-
export type UpdateCustomerAddresseStepInput = {
|
|
6
|
-
/**
|
|
7
|
-
* The filters to select the customer addresses to update.
|
|
8
|
-
*/
|
|
9
|
-
selector: FilterableCustomerAddressProps;
|
|
10
|
-
/**
|
|
11
|
-
* The data to update the customer addresses with.
|
|
12
|
-
*/
|
|
13
|
-
update: UpdateCustomerAddressDTO;
|
|
14
|
-
};
|
|
15
|
-
export declare const updateCustomerAddresseStepId = "update-customer-addresses";
|
|
16
|
-
/**
|
|
17
|
-
* This step updates one or more customer addresses.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* const data = updateCustomerAddressesStep({
|
|
21
|
-
* selector: {
|
|
22
|
-
* customer_id: "cus_123"
|
|
23
|
-
* },
|
|
24
|
-
* update: {
|
|
25
|
-
* country_code: "us"
|
|
26
|
-
* }
|
|
27
|
-
* })
|
|
28
|
-
*/
|
|
29
|
-
export declare const updateCustomerAddressesStep: import("@acmekit/framework/workflows-sdk").StepFunction<UpdateCustomerAddresseStepInput, import("@acmekit/framework/types").CustomerAddressDTO[]>;
|
|
30
|
-
//# sourceMappingURL=update-addresses.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-addresses.d.ts","sourceRoot":"","sources":["../../../src/customer/steps/update-addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAE9B,wBAAwB,EACzB,MAAM,0BAA0B,CAAA;AAQjC;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;OAEG;IACH,QAAQ,EAAE,8BAA8B,CAAA;IACxC;;OAEG;IACH,MAAM,EAAE,wBAAwB,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,4BAA4B,8BAA8B,CAAA;AACvE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,2BAA2B,mJAiCvC,CAAA"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateCustomerAddressesStep = exports.updateCustomerAddresseStepId = void 0;
|
|
4
|
-
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
6
|
-
exports.updateCustomerAddresseStepId = "update-customer-addresses";
|
|
7
|
-
/**
|
|
8
|
-
* This step updates one or more customer addresses.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* const data = updateCustomerAddressesStep({
|
|
12
|
-
* selector: {
|
|
13
|
-
* customer_id: "cus_123"
|
|
14
|
-
* },
|
|
15
|
-
* update: {
|
|
16
|
-
* country_code: "us"
|
|
17
|
-
* }
|
|
18
|
-
* })
|
|
19
|
-
*/
|
|
20
|
-
exports.updateCustomerAddressesStep = (0, workflows_sdk_1.createStep)(exports.updateCustomerAddresseStepId, async (data, { container }) => {
|
|
21
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
22
|
-
const { selects, relations } = (0, utils_1.getSelectsAndRelationsFromObjectArray)([
|
|
23
|
-
data.update,
|
|
24
|
-
]);
|
|
25
|
-
const prevCustomers = await service.listCustomerAddresses(data.selector, {
|
|
26
|
-
select: selects,
|
|
27
|
-
relations,
|
|
28
|
-
});
|
|
29
|
-
const customerAddresses = await service.updateCustomerAddresses(data.selector, data.update);
|
|
30
|
-
return new workflows_sdk_1.StepResponse(customerAddresses, prevCustomers);
|
|
31
|
-
}, async (prevCustomerAddresses, { container }) => {
|
|
32
|
-
if (!prevCustomerAddresses) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
36
|
-
await (0, utils_1.promiseAll)(prevCustomerAddresses.map((c) => service.updateCustomerAddresses(c.id, { ...c })));
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=update-addresses.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-addresses.js","sourceRoot":"","sources":["../../../src/customer/steps/update-addresses.ts"],"names":[],"mappings":";;;AAKA,oDAIiC;AACjC,oEAA2E;AAgB9D,QAAA,4BAA4B,GAAG,2BAA2B,CAAA;AACvE;;;;;;;;;;;;GAYG;AACU,QAAA,2BAA2B,GAAG,IAAA,0BAAU,EACnD,oCAA4B,EAC5B,KAAK,EAAE,IAAqC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAC7D,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAA,6CAAqC,EAAC;QACnE,IAAI,CAAC,MAAM;KACZ,CAAC,CAAA;IACF,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,EAAE;QACvE,MAAM,EAAE,OAAO;QACf,SAAS;KACV,CAAC,CAAA;IAEF,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,uBAAuB,CAC7D,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,MAAM,CACZ,CAAA;IAED,OAAO,IAAI,4BAAY,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAA;AAC3D,CAAC,EACD,KAAK,EAAE,qBAAqB,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAC7C,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC3B,OAAM;IACR,CAAC;IAED,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,IAAA,kBAAU,EACd,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAC9B,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAChD,CACF,CAAA;AACH,CAAC,CACF,CAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { CustomerUpdatableFields, FilterableCustomerProps } from "@acmekit/framework/types";
|
|
2
|
-
/**
|
|
3
|
-
* The data to update one or more customers.
|
|
4
|
-
*/
|
|
5
|
-
export type UpdateCustomersStepInput = {
|
|
6
|
-
/**
|
|
7
|
-
* The filters to select the customers to update.
|
|
8
|
-
*/
|
|
9
|
-
selector: FilterableCustomerProps;
|
|
10
|
-
/**
|
|
11
|
-
* The data to update the customers with.
|
|
12
|
-
*/
|
|
13
|
-
update: CustomerUpdatableFields;
|
|
14
|
-
};
|
|
15
|
-
export declare const updateCustomersStepId = "update-customer";
|
|
16
|
-
/**
|
|
17
|
-
* This step updates one or more customers.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* const data = updateCustomersStep({
|
|
21
|
-
* selector: {
|
|
22
|
-
* id: "cus_123"
|
|
23
|
-
* },
|
|
24
|
-
* update: {
|
|
25
|
-
* last_name: "Doe"
|
|
26
|
-
* }
|
|
27
|
-
* })
|
|
28
|
-
*/
|
|
29
|
-
export declare const updateCustomersStep: import("@acmekit/framework/workflows-sdk").StepFunction<UpdateCustomersStepInput, import("@acmekit/framework/types").CustomerDTO[]>;
|
|
30
|
-
//# sourceMappingURL=update-customers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-customers.d.ts","sourceRoot":"","sources":["../../../src/customer/steps/update-customers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EAExB,MAAM,0BAA0B,CAAA;AAQjC;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,QAAQ,EAAE,uBAAuB,CAAA;IACjC;;OAEG;IACH,MAAM,EAAE,uBAAuB,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,qBAAqB,oBAAoB,CAAA;AACtD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,qIAoC/B,CAAA"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateCustomersStep = exports.updateCustomersStepId = void 0;
|
|
4
|
-
const utils_1 = require("@acmekit/framework/utils");
|
|
5
|
-
const workflows_sdk_1 = require("@acmekit/framework/workflows-sdk");
|
|
6
|
-
exports.updateCustomersStepId = "update-customer";
|
|
7
|
-
/**
|
|
8
|
-
* This step updates one or more customers.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* const data = updateCustomersStep({
|
|
12
|
-
* selector: {
|
|
13
|
-
* id: "cus_123"
|
|
14
|
-
* },
|
|
15
|
-
* update: {
|
|
16
|
-
* last_name: "Doe"
|
|
17
|
-
* }
|
|
18
|
-
* })
|
|
19
|
-
*/
|
|
20
|
-
exports.updateCustomersStep = (0, workflows_sdk_1.createStep)(exports.updateCustomersStepId, async (data, { container }) => {
|
|
21
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
22
|
-
const { selects, relations } = (0, utils_1.getSelectsAndRelationsFromObjectArray)([
|
|
23
|
-
data.update,
|
|
24
|
-
]);
|
|
25
|
-
const prevCustomers = await service.listCustomers(data.selector, {
|
|
26
|
-
select: selects,
|
|
27
|
-
relations,
|
|
28
|
-
});
|
|
29
|
-
const customers = await service.updateCustomers(data.selector, data.update);
|
|
30
|
-
return new workflows_sdk_1.StepResponse(customers, prevCustomers);
|
|
31
|
-
}, async (prevCustomers, { container }) => {
|
|
32
|
-
if (!prevCustomers?.length) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const service = container.resolve(utils_1.Modules.CUSTOMER);
|
|
36
|
-
await (0, utils_1.promiseAll)(prevCustomers.map((c) => service.updateCustomers(c.id, {
|
|
37
|
-
first_name: c.first_name,
|
|
38
|
-
last_name: c.last_name,
|
|
39
|
-
email: c.email,
|
|
40
|
-
phone: c.phone,
|
|
41
|
-
metadata: c.metadata,
|
|
42
|
-
})));
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=update-customers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-customers.js","sourceRoot":"","sources":["../../../src/customer/steps/update-customers.ts"],"names":[],"mappings":";;;AAKA,oDAIiC;AACjC,oEAA2E;AAgB9D,QAAA,qBAAqB,GAAG,iBAAiB,CAAA;AACtD;;;;;;;;;;;;GAYG;AACU,QAAA,mBAAmB,GAAG,IAAA,0BAAU,EAC3C,6BAAqB,EACrB,KAAK,EAAE,IAA8B,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACtD,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAA,6CAAqC,EAAC;QACnE,IAAI,CAAC,MAAM;KACZ,CAAC,CAAA;IACF,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE;QAC/D,MAAM,EAAE,OAAO;QACf,SAAS;KACV,CAAC,CAAA;IAEF,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;IAE3E,OAAO,IAAI,4BAAY,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;AACnD,CAAC,EACD,KAAK,EAAE,aAAa,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACrC,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC;QAC3B,OAAM;IACR,CAAC;IAED,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAyB,eAAO,CAAC,QAAQ,CAAC,CAAA;IAE3E,MAAM,IAAA,kBAAU,EACd,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACtB,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,EAAE;QAC5B,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,QAAQ,EAAE,CAAC,CAAC,QAAQ;KACrB,CAAC,CACH,CACF,CAAA;AACH,CAAC,CACF,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/customer/steps/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,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("./unset-address-for-create"), exports);
|
|
18
|
-
__exportStar(require("./unset-address-for-update"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/customer/steps/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA0C;AAC1C,6DAA0C"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { CreateCustomerAddressDTO, ICustomerModuleService } from "@acmekit/framework/types";
|
|
2
|
-
import { StepResponse } from "@acmekit/framework/workflows-sdk";
|
|
3
|
-
export declare const unsetForCreate: (data: CreateCustomerAddressDTO[], customerService: ICustomerModuleService, field: "is_default_billing" | "is_default_shipping") => Promise<StepResponse<undefined, string[]>>;
|
|
4
|
-
//# sourceMappingURL=unset-address-for-create.d.ts.map
|