@etohq/core-flows 1.4.0 → 1.5.1-alpha.0
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 +17 -0
- package/dist/api-key/steps/create-api-keys.d.ts.map +1 -1
- package/dist/api-key/steps/create-api-keys.js +11 -0
- package/dist/api-key/steps/create-api-keys.js.map +1 -1
- package/dist/api-key/steps/delete-api-keys.d.ts +5 -1
- package/dist/api-key/steps/delete-api-keys.d.ts.map +1 -1
- package/dist/api-key/steps/delete-api-keys.js.map +1 -1
- package/dist/api-key/steps/revoke-api-keys.d.ts +19 -0
- package/dist/api-key/steps/revoke-api-keys.d.ts.map +1 -1
- package/dist/api-key/steps/revoke-api-keys.js +10 -0
- package/dist/api-key/steps/revoke-api-keys.js.map +1 -1
- package/dist/api-key/steps/update-api-keys.d.ts +19 -0
- package/dist/api-key/steps/update-api-keys.d.ts.map +1 -1
- package/dist/api-key/steps/update-api-keys.js +10 -0
- package/dist/api-key/steps/update-api-keys.js.map +1 -1
- package/dist/api-key/workflows/create-api-keys.d.ts +41 -2
- package/dist/api-key/workflows/create-api-keys.d.ts.map +1 -1
- package/dist/api-key/workflows/create-api-keys.js +30 -2
- package/dist/api-key/workflows/create-api-keys.js.map +1 -1
- package/dist/api-key/workflows/delete-api-keys.d.ts +23 -1
- package/dist/api-key/workflows/delete-api-keys.d.ts.map +1 -1
- package/dist/api-key/workflows/delete-api-keys.js +17 -1
- package/dist/api-key/workflows/delete-api-keys.js.map +1 -1
- package/dist/api-key/workflows/link-sales-channels-to-publishable-key.d.ts +32 -0
- package/dist/api-key/workflows/link-sales-channels-to-publishable-key.d.ts.map +1 -0
- package/dist/api-key/workflows/link-sales-channels-to-publishable-key.js +33 -0
- package/dist/api-key/workflows/link-sales-channels-to-publishable-key.js.map +1 -0
- package/dist/api-key/workflows/revoke-api-keys.d.ts +38 -2
- package/dist/api-key/workflows/revoke-api-keys.d.ts.map +1 -1
- package/dist/api-key/workflows/revoke-api-keys.js +24 -1
- package/dist/api-key/workflows/revoke-api-keys.js.map +1 -1
- package/dist/api-key/workflows/update-api-keys.d.ts +36 -2
- package/dist/api-key/workflows/update-api-keys.d.ts.map +1 -1
- package/dist/api-key/workflows/update-api-keys.js +22 -1
- package/dist/api-key/workflows/update-api-keys.js.map +1 -1
- package/dist/auth/steps/set-auth-app-metadata.d.ts +30 -1
- package/dist/auth/steps/set-auth-app-metadata.d.ts.map +1 -1
- package/dist/auth/steps/set-auth-app-metadata.js +30 -1
- package/dist/auth/steps/set-auth-app-metadata.js.map +1 -1
- package/dist/auth/workflows/generate-reset-password-token.d.ts +32 -1
- package/dist/auth/workflows/generate-reset-password-token.d.ts.map +1 -1
- package/dist/auth/workflows/generate-reset-password-token.js +30 -5
- package/dist/auth/workflows/generate-reset-password-token.js.map +1 -1
- package/dist/common/index.d.ts +1 -2
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +1 -2
- package/dist/common/index.js.map +1 -1
- package/dist/common/steps/create-entities.d.ts +33 -1
- package/dist/common/steps/create-entities.d.ts.map +1 -1
- package/dist/common/steps/create-entities.js +17 -1
- package/dist/common/steps/create-entities.js.map +1 -1
- package/dist/common/steps/create-remote-links.d.ts +8 -23
- package/dist/common/steps/create-remote-links.d.ts.map +1 -1
- package/dist/common/steps/create-remote-links.js +8 -23
- package/dist/common/steps/create-remote-links.js.map +1 -1
- package/dist/common/steps/delete-entities.d.ts +26 -1
- package/dist/common/steps/delete-entities.d.ts.map +1 -1
- package/dist/common/steps/delete-entities.js +9 -1
- package/dist/common/steps/delete-entities.js.map +1 -1
- package/dist/common/steps/dismiss-remote-links.d.ts +8 -23
- package/dist/common/steps/dismiss-remote-links.d.ts.map +1 -1
- package/dist/common/steps/dismiss-remote-links.js +8 -23
- package/dist/common/steps/dismiss-remote-links.js.map +1 -1
- package/dist/common/steps/emit-event.d.ts +5 -17
- package/dist/common/steps/emit-event.d.ts.map +1 -1
- package/dist/common/steps/emit-event.js +5 -17
- package/dist/common/steps/emit-event.js.map +1 -1
- package/dist/common/steps/remove-remote-links.d.ts +5 -20
- package/dist/common/steps/remove-remote-links.d.ts.map +1 -1
- package/dist/common/steps/remove-remote-links.js +5 -20
- package/dist/common/steps/remove-remote-links.js.map +1 -1
- package/dist/common/steps/update-remote-links.d.ts +22 -0
- package/dist/common/steps/update-remote-links.d.ts.map +1 -1
- package/dist/common/steps/update-remote-links.js +22 -0
- package/dist/common/steps/update-remote-links.js.map +1 -1
- package/dist/common/steps/use-query-graph.d.ts +8 -20
- package/dist/common/steps/use-query-graph.d.ts.map +1 -1
- package/dist/common/steps/use-query-graph.js +7 -19
- package/dist/common/steps/use-query-graph.js.map +1 -1
- package/dist/common/steps/use-remote-query.d.ts +34 -70
- package/dist/common/steps/use-remote-query.d.ts.map +1 -1
- package/dist/common/steps/use-remote-query.js +34 -70
- package/dist/common/steps/use-remote-query.js.map +1 -1
- package/dist/common/workflows/batch-links.d.ts +51 -0
- package/dist/common/workflows/batch-links.d.ts.map +1 -1
- package/dist/common/workflows/batch-links.js +51 -0
- package/dist/common/workflows/batch-links.js.map +1 -1
- package/dist/common/workflows/create-links.d.ts +25 -0
- package/dist/common/workflows/create-links.d.ts.map +1 -1
- package/dist/common/workflows/create-links.js +25 -0
- package/dist/common/workflows/create-links.js.map +1 -1
- package/dist/common/workflows/dismiss-links.d.ts +25 -0
- package/dist/common/workflows/dismiss-links.d.ts.map +1 -1
- package/dist/common/workflows/dismiss-links.js +25 -0
- package/dist/common/workflows/dismiss-links.js.map +1 -1
- package/dist/common/workflows/update-links.d.ts +30 -0
- package/dist/common/workflows/update-links.d.ts.map +1 -1
- package/dist/common/workflows/update-links.js +30 -0
- package/dist/common/workflows/update-links.js.map +1 -1
- package/dist/file/steps/delete-files.d.ts +13 -2
- package/dist/file/steps/delete-files.d.ts.map +1 -1
- package/dist/file/steps/delete-files.js +8 -1
- package/dist/file/steps/delete-files.js.map +1 -1
- package/dist/file/steps/upload-files.d.ts +40 -1
- package/dist/file/steps/upload-files.d.ts.map +1 -1
- package/dist/file/steps/upload-files.js +14 -1
- package/dist/file/steps/upload-files.js.map +1 -1
- package/dist/file/workflows/delete-files.d.ts +20 -1
- package/dist/file/workflows/delete-files.d.ts.map +1 -1
- package/dist/file/workflows/delete-files.js +20 -1
- package/dist/file/workflows/delete-files.js.map +1 -1
- package/dist/file/workflows/upload-files.d.ts +51 -1
- package/dist/file/workflows/upload-files.d.ts.map +1 -1
- package/dist/file/workflows/upload-files.js +25 -1
- package/dist/file/workflows/upload-files.js.map +1 -1
- package/dist/invite/index.d.ts +3 -0
- package/dist/invite/index.d.ts.map +1 -0
- package/dist/invite/index.js +19 -0
- package/dist/invite/index.js.map +1 -0
- package/dist/invite/steps/create-invites.d.ts +14 -0
- package/dist/invite/steps/create-invites.d.ts.map +1 -0
- package/dist/invite/steps/create-invites.js +28 -0
- package/dist/invite/steps/create-invites.js.map +1 -0
- package/dist/invite/steps/delete-invites.d.ts +10 -0
- package/dist/invite/steps/delete-invites.d.ts.map +1 -0
- package/dist/invite/steps/delete-invites.js +21 -0
- package/dist/invite/steps/delete-invites.js.map +1 -0
- package/dist/invite/steps/index.d.ts +5 -0
- package/dist/invite/steps/index.d.ts.map +1 -0
- package/dist/invite/steps/index.js +21 -0
- package/dist/invite/steps/index.js.map +1 -0
- package/dist/invite/steps/refresh-invite-tokens.d.ts +10 -0
- package/dist/invite/steps/refresh-invite-tokens.d.ts.map +1 -0
- package/dist/invite/steps/refresh-invite-tokens.js +15 -0
- package/dist/invite/steps/refresh-invite-tokens.js.map +1 -0
- package/dist/invite/steps/validate-token.d.ts +11 -0
- package/dist/invite/steps/validate-token.d.ts.map +1 -0
- package/dist/invite/steps/validate-token.js +16 -0
- package/dist/invite/steps/validate-token.js.map +1 -0
- package/dist/invite/workflows/accept-invite.d.ts +33 -0
- package/dist/invite/workflows/accept-invite.d.ts.map +1 -0
- package/dist/invite/workflows/accept-invite.js +70 -0
- package/dist/invite/workflows/accept-invite.js.map +1 -0
- package/dist/invite/workflows/create-invites.d.ts +27 -0
- package/dist/invite/workflows/create-invites.d.ts.map +1 -0
- package/dist/invite/workflows/create-invites.js +45 -0
- package/dist/invite/workflows/create-invites.js.map +1 -0
- package/dist/invite/workflows/delete-invites.d.ts +23 -0
- package/dist/invite/workflows/delete-invites.d.ts.map +1 -0
- package/dist/invite/workflows/delete-invites.js +40 -0
- package/dist/invite/workflows/delete-invites.js.map +1 -0
- package/dist/invite/workflows/index.d.ts +5 -0
- package/dist/invite/workflows/index.d.ts.map +1 -0
- package/dist/invite/workflows/index.js +21 -0
- package/dist/invite/workflows/index.js.map +1 -0
- package/dist/invite/workflows/refresh-invite-tokens.d.ts +27 -0
- package/dist/invite/workflows/refresh-invite-tokens.d.ts.map +1 -0
- package/dist/invite/workflows/refresh-invite-tokens.js +45 -0
- package/dist/invite/workflows/refresh-invite-tokens.js.map +1 -0
- package/dist/locking/acquire-lock.d.ts +23 -0
- package/dist/locking/acquire-lock.d.ts.map +1 -0
- package/dist/locking/acquire-lock.js +61 -0
- package/dist/locking/acquire-lock.js.map +1 -0
- package/dist/locking/index.d.ts +3 -0
- package/dist/locking/index.d.ts.map +1 -0
- package/dist/locking/index.js +19 -0
- package/dist/locking/index.js.map +1 -0
- package/dist/locking/release-lock.d.ts +19 -0
- package/dist/locking/release-lock.d.ts.map +1 -0
- package/dist/locking/release-lock.js +31 -0
- package/dist/locking/release-lock.js.map +1 -0
- package/dist/notification/steps/notify-on-failure.d.ts +52 -2
- package/dist/notification/steps/notify-on-failure.d.ts.map +1 -1
- package/dist/notification/steps/notify-on-failure.js +12 -2
- package/dist/notification/steps/notify-on-failure.js.map +1 -1
- package/dist/notification/steps/send-notifications.d.ts +38 -0
- package/dist/notification/steps/send-notifications.d.ts.map +1 -1
- package/dist/notification/steps/send-notifications.js.map +1 -1
- package/dist/payment/steps/authorize-payment-session.d.ts +19 -3
- package/dist/payment/steps/authorize-payment-session.d.ts.map +1 -1
- package/dist/payment/steps/authorize-payment-session.js +10 -1
- package/dist/payment/steps/authorize-payment-session.js.map +1 -1
- package/dist/payment/steps/cancel-payment.d.ts +6 -0
- package/dist/payment/steps/cancel-payment.d.ts.map +1 -1
- package/dist/payment/steps/cancel-payment.js.map +1 -1
- package/dist/payment/steps/capture-payment.d.ts +14 -2
- package/dist/payment/steps/capture-payment.d.ts.map +1 -1
- package/dist/payment/steps/capture-payment.js +4 -1
- package/dist/payment/steps/capture-payment.js.map +1 -1
- package/dist/payment/steps/complete-cart-after-payment.d.ts +15 -0
- package/dist/payment/steps/complete-cart-after-payment.d.ts.map +1 -0
- package/dist/payment/steps/complete-cart-after-payment.js +20 -0
- package/dist/payment/steps/complete-cart-after-payment.js.map +1 -0
- package/dist/payment/steps/refund-payment.d.ts +14 -2
- package/dist/payment/steps/refund-payment.d.ts.map +1 -1
- package/dist/payment/steps/refund-payment.js +4 -1
- package/dist/payment/steps/refund-payment.js.map +1 -1
- package/dist/payment/steps/refund-payments.d.ts +22 -5
- package/dist/payment/steps/refund-payments.d.ts.map +1 -1
- package/dist/payment/steps/refund-payments.js.map +1 -1
- package/dist/payment-collection/steps/cancel-payment.d.ts +15 -0
- package/dist/payment-collection/steps/cancel-payment.d.ts.map +1 -0
- package/dist/payment-collection/steps/cancel-payment.js +33 -0
- package/dist/payment-collection/steps/cancel-payment.js.map +1 -0
- package/dist/payment-collection/steps/create-payment-account-holder.d.ts +18 -0
- package/dist/payment-collection/steps/create-payment-account-holder.d.ts.map +1 -0
- package/dist/payment-collection/steps/create-payment-account-holder.js +37 -0
- package/dist/payment-collection/steps/create-payment-account-holder.js.map +1 -0
- package/dist/payment-collection/steps/create-payment-session.d.ts +31 -2
- package/dist/payment-collection/steps/create-payment-session.d.ts.map +1 -1
- package/dist/payment-collection/steps/create-payment-session.js +1 -0
- package/dist/payment-collection/steps/create-payment-session.js.map +1 -1
- package/dist/payment-collection/steps/create-refund-reasons.d.ts +6 -2
- package/dist/payment-collection/steps/create-refund-reasons.d.ts.map +1 -1
- package/dist/payment-collection/steps/create-refund-reasons.js.map +1 -1
- package/dist/payment-collection/steps/delete-payment-sessions.d.ts +7 -1
- package/dist/payment-collection/steps/delete-payment-sessions.d.ts.map +1 -1
- package/dist/payment-collection/steps/delete-payment-sessions.js +1 -1
- package/dist/payment-collection/steps/delete-payment-sessions.js.map +1 -1
- package/dist/payment-collection/steps/delete-refund-reasons.d.ts +5 -1
- package/dist/payment-collection/steps/delete-refund-reasons.d.ts.map +1 -1
- package/dist/payment-collection/steps/delete-refund-reasons.js.map +1 -1
- package/dist/payment-collection/steps/index.d.ts +1 -0
- package/dist/payment-collection/steps/index.d.ts.map +1 -1
- package/dist/payment-collection/steps/index.js +1 -0
- package/dist/payment-collection/steps/index.js.map +1 -1
- package/dist/payment-collection/steps/update-payment-collection.d.ts +21 -2
- package/dist/payment-collection/steps/update-payment-collection.d.ts.map +1 -1
- package/dist/payment-collection/steps/update-payment-collection.js +10 -0
- package/dist/payment-collection/steps/update-payment-collection.js.map +1 -1
- package/dist/payment-collection/steps/update-refund-reasons.d.ts +6 -2
- package/dist/payment-collection/steps/update-refund-reasons.d.ts.map +1 -1
- package/dist/payment-collection/steps/update-refund-reasons.js.map +1 -1
- package/dist/payment-collection/steps/validate-deleted-payment-sessions.d.ts +16 -0
- package/dist/payment-collection/steps/validate-deleted-payment-sessions.d.ts.map +1 -1
- package/dist/payment-collection/steps/validate-deleted-payment-sessions.js +7 -0
- package/dist/payment-collection/steps/validate-deleted-payment-sessions.js.map +1 -1
- package/dist/payment-collection/workflows/cancel-payment-collection.d.ts +23 -0
- package/dist/payment-collection/workflows/cancel-payment-collection.d.ts.map +1 -0
- package/dist/payment-collection/workflows/cancel-payment-collection.js +66 -0
- package/dist/payment-collection/workflows/cancel-payment-collection.js.map +1 -0
- package/dist/payment-collection/workflows/create-payment-session.d.ts +42 -3
- package/dist/payment-collection/workflows/create-payment-session.d.ts.map +1 -1
- package/dist/payment-collection/workflows/create-payment-session.js +81 -3
- package/dist/payment-collection/workflows/create-payment-session.js.map +1 -1
- package/dist/payment-collection/workflows/create-refund-reasons.d.ts +32 -5
- package/dist/payment-collection/workflows/create-refund-reasons.d.ts.map +1 -1
- package/dist/payment-collection/workflows/create-refund-reasons.js +21 -1
- package/dist/payment-collection/workflows/create-refund-reasons.js.map +1 -1
- package/dist/payment-collection/workflows/delete-payment-sessions.d.ts +23 -1
- package/dist/payment-collection/workflows/delete-payment-sessions.d.ts.map +1 -1
- package/dist/payment-collection/workflows/delete-payment-sessions.js +17 -1
- package/dist/payment-collection/workflows/delete-payment-sessions.js.map +1 -1
- package/dist/payment-collection/workflows/delete-refund-reasons.d.ts +27 -4
- package/dist/payment-collection/workflows/delete-refund-reasons.d.ts.map +1 -1
- package/dist/payment-collection/workflows/delete-refund-reasons.js +17 -1
- package/dist/payment-collection/workflows/delete-refund-reasons.js.map +1 -1
- package/dist/payment-collection/workflows/index.d.ts +1 -0
- package/dist/payment-collection/workflows/index.d.ts.map +1 -1
- package/dist/payment-collection/workflows/index.js +1 -0
- package/dist/payment-collection/workflows/index.js.map +1 -1
- package/dist/payment-collection/workflows/update-refund-reasons.d.ts +30 -3
- package/dist/payment-collection/workflows/update-refund-reasons.d.ts.map +1 -1
- package/dist/payment-collection/workflows/update-refund-reasons.js +20 -1
- package/dist/payment-collection/workflows/update-refund-reasons.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/user/steps/create-users.d.ts +11 -1
- package/dist/user/steps/create-users.d.ts.map +1 -1
- package/dist/user/steps/create-users.js +11 -1
- package/dist/user/steps/create-users.js.map +1 -1
- package/dist/user/steps/delete-users.d.ts +6 -2
- package/dist/user/steps/delete-users.d.ts.map +1 -1
- package/dist/user/steps/delete-users.js +1 -1
- package/dist/user/steps/delete-users.js.map +1 -1
- package/dist/user/steps/update-users.d.ts +9 -1
- package/dist/user/steps/update-users.d.ts.map +1 -1
- package/dist/user/steps/update-users.js +9 -1
- package/dist/user/steps/update-users.js.map +1 -1
- package/dist/user/workflows/create-user-account.d.ts +33 -1
- package/dist/user/workflows/create-user-account.d.ts.map +1 -1
- package/dist/user/workflows/create-user-account.js +24 -1
- package/dist/user/workflows/create-user-account.js.map +1 -1
- package/dist/user/workflows/create-users.d.ts +25 -1
- package/dist/user/workflows/create-users.d.ts.map +1 -1
- package/dist/user/workflows/create-users.js +25 -1
- package/dist/user/workflows/create-users.js.map +1 -1
- package/dist/user/workflows/delete-users.d.ts +20 -1
- package/dist/user/workflows/delete-users.d.ts.map +1 -1
- package/dist/user/workflows/delete-users.js +26 -3
- package/dist/user/workflows/delete-users.js.map +1 -1
- package/dist/user/workflows/remove-user-account.d.ts +23 -1
- package/dist/user/workflows/remove-user-account.d.ts.map +1 -1
- package/dist/user/workflows/remove-user-account.js +17 -1
- package/dist/user/workflows/remove-user-account.js.map +1 -1
- package/dist/user/workflows/update-users.d.ts +22 -1
- package/dist/user/workflows/update-users.d.ts.map +1 -1
- package/dist/user/workflows/update-users.js +22 -1
- package/dist/user/workflows/update-users.js.map +1 -1
- package/package.json +10 -10
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cancelPaymentCollectionWorkflow = exports.cancelPaymentCollectionWorkflowId = void 0;
|
|
4
|
+
const utils_1 = require("@etohq/framework/utils");
|
|
5
|
+
const workflows_sdk_1 = require("@etohq/framework/workflows-sdk");
|
|
6
|
+
const common_1 = require("../../common");
|
|
7
|
+
const update_payment_collection_1 = require("../steps/update-payment-collection");
|
|
8
|
+
const cancel_payment_1 = require("../steps/cancel-payment");
|
|
9
|
+
const validatePaymentCollectionCancellationStep = (0, workflows_sdk_1.createStep)("validate-payment-collection-cancellation", async (input) => {
|
|
10
|
+
const { paymentCollection } = input;
|
|
11
|
+
if (paymentCollection.status === utils_1.PaymentCollectionStatus.COMPLETED) {
|
|
12
|
+
throw new utils_1.EtoError(utils_1.EtoError.Types.NOT_ALLOWED, "Cannot cancel a completed payment collection");
|
|
13
|
+
}
|
|
14
|
+
if (paymentCollection.status == utils_1.PaymentCollectionStatus.CANCELED) {
|
|
15
|
+
throw new utils_1.EtoError(utils_1.EtoError.Types.NOT_ALLOWED, "Payment collection is already canceled");
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
exports.cancelPaymentCollectionWorkflowId = "cancel-payment-collection";
|
|
19
|
+
/**
|
|
20
|
+
* This workflow cancels a payment collection that is either not paid or authorized.
|
|
21
|
+
*
|
|
22
|
+
* Payment colelction that is completed or already canceled cannot be canceled.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* const data = cancelPaymentCollectionStep({
|
|
26
|
+
* payment_collection_id: "paycol_123",
|
|
27
|
+
* })
|
|
28
|
+
*/
|
|
29
|
+
exports.cancelPaymentCollectionWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.cancelPaymentCollectionWorkflowId, (input) => {
|
|
30
|
+
const paymentCollectionQuery = (0, common_1.useQueryGraphStep)({
|
|
31
|
+
entity: "payment_collection",
|
|
32
|
+
fields: [
|
|
33
|
+
"id",
|
|
34
|
+
"status",
|
|
35
|
+
"payments.id",
|
|
36
|
+
"payments.captured_at",
|
|
37
|
+
"captured_amount",
|
|
38
|
+
],
|
|
39
|
+
filters: { id: input.payment_collection_id },
|
|
40
|
+
}).config({ name: "get-payment-collection" });
|
|
41
|
+
const paymentCollection = (0, workflows_sdk_1.transform)({ paymentCollectionQuery }, ({ paymentCollectionQuery }) => paymentCollectionQuery.data[0]);
|
|
42
|
+
validatePaymentCollectionCancellationStep({
|
|
43
|
+
paymentCollection,
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Only cancel authorized payments, not captured payments.
|
|
47
|
+
*/
|
|
48
|
+
const authorizedPaymentIds = (0, workflows_sdk_1.transform)({ paymentCollection }, ({ paymentCollection }) => paymentCollection.payments
|
|
49
|
+
?.filter((p) => !p.captured_at)
|
|
50
|
+
.map((p) => p.id) ?? []);
|
|
51
|
+
const status = (0, workflows_sdk_1.transform)({ paymentCollection }, ({ paymentCollection }) => paymentCollection.captured_amount > 0
|
|
52
|
+
? utils_1.PaymentCollectionStatus.PARTIALLY_CAPTURED
|
|
53
|
+
: utils_1.PaymentCollectionStatus.CANCELED);
|
|
54
|
+
const updatedPaymentCollections = (0, update_payment_collection_1.updatePaymentCollectionStep)({
|
|
55
|
+
selector: { id: paymentCollection.id },
|
|
56
|
+
update: {
|
|
57
|
+
status: status,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
(0, cancel_payment_1.cancelPaymentStep)({
|
|
61
|
+
ids: authorizedPaymentIds,
|
|
62
|
+
});
|
|
63
|
+
const resultPaymentCollection = (0, workflows_sdk_1.transform)({ updatedPaymentCollections }, ({ updatedPaymentCollections }) => updatedPaymentCollections[0]);
|
|
64
|
+
return new workflows_sdk_1.WorkflowResponse(resultPaymentCollection);
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=cancel-payment-collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel-payment-collection.js","sourceRoot":"","sources":["../../../src/payment-collection/workflows/cancel-payment-collection.ts"],"names":[],"mappings":";;;AACA,kDAA0E;AAC1E,kEAMuC;AACvC,yCAAgD;AAChD,kFAAgF;AAChF,4DAA2D;AAE3D,MAAM,yCAAyC,GAAG,IAAA,0BAAU,EAC1D,0CAA0C,EAC1C,KAAK,EAAE,KAAkD,EAAE,EAAE;IAC3D,MAAM,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAA;IAEnC,IAAI,iBAAiB,CAAC,MAAM,KAAK,+BAAuB,CAAC,SAAS,EAAE,CAAC;QACnE,MAAM,IAAI,gBAAQ,CAChB,gBAAQ,CAAC,KAAK,CAAC,WAAW,EAC1B,8CAA8C,CAC/C,CAAA;IACH,CAAC;IAED,IAAI,iBAAiB,CAAC,MAAM,IAAI,+BAAuB,CAAC,QAAQ,EAAE,CAAC;QACjE,MAAM,IAAI,gBAAQ,CAChB,gBAAQ,CAAC,KAAK,CAAC,WAAW,EAC1B,wCAAwC,CACzC,CAAA;IACH,CAAC;AACH,CAAC,CACF,CAAA;AAYY,QAAA,iCAAiC,GAAG,2BAA2B,CAAA;AAC5E;;;;;;;;;GASG;AACU,QAAA,+BAA+B,GAAG,IAAA,8BAAc,EAC3D,yCAAiC,EACjC,CACE,KAAyD,EACjB,EAAE;IAC1C,MAAM,sBAAsB,GAAG,IAAA,0BAAiB,EAAC;QAC/C,MAAM,EAAE,oBAAoB;QAC5B,MAAM,EAAE;YACN,IAAI;YACJ,QAAQ;YACR,aAAa;YACb,sBAAsB;YACtB,iBAAiB;SAClB;QACD,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,qBAAqB,EAAE;KAC7C,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,CAAA;IAE7C,MAAM,iBAAiB,GAAG,IAAA,yBAAS,EACjC,EAAE,sBAAsB,EAAE,EAC1B,CAAC,EAAE,sBAAsB,EAAE,EAAE,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,CAC/D,CAAA;IAED,yCAAyC,CAAC;QACxC,iBAAiB;KAClB,CAAC,CAAA;IAEF;;OAEG;IACH,MAAM,oBAAoB,GAAG,IAAA,yBAAS,EACpC,EAAE,iBAAiB,EAAE,EACrB,CAAC,EAAE,iBAAiB,EAAE,EAAE,EAAE,CACxB,iBAAiB,CAAC,QAAQ;QACxB,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;SAC9B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAC5B,CAAA;IAED,MAAM,MAAM,GAAG,IAAA,yBAAS,EAAC,EAAE,iBAAiB,EAAE,EAAE,CAAC,EAAE,iBAAiB,EAAE,EAAE,EAAE,CACxE,iBAAiB,CAAC,eAAe,GAAG,CAAC;QACnC,CAAC,CAAC,+BAAuB,CAAC,kBAAkB;QAC5C,CAAC,CAAC,+BAAuB,CAAC,QAAQ,CACrC,CAAA;IAED,MAAM,yBAAyB,GAAG,IAAA,uDAA2B,EAAC;QAC5D,QAAQ,EAAE,EAAE,EAAE,EAAE,iBAAiB,CAAC,EAAE,EAAE;QACtC,MAAM,EAAE;YACN,MAAM,EAAE,MAAM;SACf;KACF,CAAC,CAAA;IAEF,IAAA,kCAAiB,EAAC;QAChB,GAAG,EAAE,oBAAoB;KAC1B,CAAC,CAAA;IAEF,MAAM,uBAAuB,GAAG,IAAA,yBAAS,EACvC,EAAE,yBAAyB,EAAE,EAC7B,CAAC,EAAE,yBAAyB,EAAE,EAAE,EAAE,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAChE,CAAA;IAED,OAAO,IAAI,gCAAgB,CAAC,uBAAuB,CAAC,CAAA;AACtD,CAAC,CACF,CAAA"}
|
|
@@ -1,13 +1,52 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PaymentSessionDTO } from "@etohq/framework/types";
|
|
2
|
+
/**
|
|
3
|
+
* The data to create payment sessions.
|
|
4
|
+
*/
|
|
2
5
|
export interface CreatePaymentSessionsWorkflowInput {
|
|
6
|
+
/**
|
|
7
|
+
* The ID of the payment collection to create payment sessions for.
|
|
8
|
+
*/
|
|
3
9
|
payment_collection_id: string;
|
|
10
|
+
/**
|
|
11
|
+
* The ID of the payment provider that the payment sessions are associated with.
|
|
12
|
+
* This provider is used to later process the payment sessions and their payments.
|
|
13
|
+
*/
|
|
4
14
|
provider_id: string;
|
|
15
|
+
/**
|
|
16
|
+
* The ID of the customer that the payment session should be associated with.
|
|
17
|
+
*/
|
|
18
|
+
customer_id?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Custom data relevant for the payment provider to process the payment session.
|
|
21
|
+
* Learn more in [this documentation](https://docs.etohq.com/resources/commerce-modules/payment/payment-session#data-property).
|
|
22
|
+
*/
|
|
5
23
|
data?: Record<string, unknown>;
|
|
6
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Additional context that's useful for the payment provider to process the payment session.
|
|
26
|
+
* Currently all of the context is calculated within the workflow.
|
|
27
|
+
*/
|
|
28
|
+
context?: Record<string, unknown>;
|
|
7
29
|
}
|
|
8
30
|
export declare const createPaymentSessionsWorkflowId = "create-payment-sessions";
|
|
9
31
|
/**
|
|
10
|
-
* This workflow creates payment sessions.
|
|
32
|
+
* This workflow creates payment sessions. It's used by the
|
|
33
|
+
* [Initialize Payment Session Store API Route](https://docs.etohq.com/api/store#payment-collections_postpaymentcollectionsidpaymentsessions).
|
|
34
|
+
*
|
|
35
|
+
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
36
|
+
* to create payment sessions in your custom flows.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* const { result } = await createPaymentSessionsWorkflow(container)
|
|
40
|
+
* .run({
|
|
41
|
+
* input: {
|
|
42
|
+
* payment_collection_id: "paycol_123",
|
|
43
|
+
* provider_id: "pp_system"
|
|
44
|
+
* }
|
|
45
|
+
* })
|
|
46
|
+
*
|
|
47
|
+
* @summary
|
|
48
|
+
*
|
|
49
|
+
* Create payment sessions.
|
|
11
50
|
*/
|
|
12
51
|
export declare const createPaymentSessionsWorkflow: import("@etohq/framework/workflows-sdk").ReturnWorkflow<CreatePaymentSessionsWorkflowInput, PaymentSessionDTO, []>;
|
|
13
52
|
//# sourceMappingURL=create-payment-session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-payment-session.d.ts","sourceRoot":"","sources":["../../../src/payment-collection/workflows/create-payment-session.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"create-payment-session.d.ts","sourceRoot":"","sources":["../../../src/payment-collection/workflows/create-payment-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAClB,MAAM,wBAAwB,CAAA;AAiB/B;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD;;OAEG;IACH,qBAAqB,EAAE,MAAM,CAAA;IAC7B;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAE9B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClC;AAED,eAAO,MAAM,+BAA+B,4BAA4B,CAAA;AACxE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,6BAA6B,oHAmIzC,CAAA"}
|
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPaymentSessionsWorkflow = exports.createPaymentSessionsWorkflowId = void 0;
|
|
4
|
+
const utils_1 = require("@etohq/framework/utils");
|
|
4
5
|
const workflows_sdk_1 = require("@etohq/framework/workflows-sdk");
|
|
5
6
|
const common_1 = require("../../common");
|
|
6
7
|
const steps_1 = require("../steps");
|
|
7
8
|
const delete_payment_sessions_1 = require("./delete-payment-sessions");
|
|
8
9
|
exports.createPaymentSessionsWorkflowId = "create-payment-sessions";
|
|
9
10
|
/**
|
|
10
|
-
* This workflow creates payment sessions.
|
|
11
|
+
* This workflow creates payment sessions. It's used by the
|
|
12
|
+
* [Initialize Payment Session Store API Route](https://docs.etohq.com/api/store#payment-collections_postpaymentcollectionsidpaymentsessions).
|
|
13
|
+
*
|
|
14
|
+
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
15
|
+
* to create payment sessions in your custom flows.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const { result } = await createPaymentSessionsWorkflow(container)
|
|
19
|
+
* .run({
|
|
20
|
+
* input: {
|
|
21
|
+
* payment_collection_id: "paycol_123",
|
|
22
|
+
* provider_id: "pp_system"
|
|
23
|
+
* }
|
|
24
|
+
* })
|
|
25
|
+
*
|
|
26
|
+
* @summary
|
|
27
|
+
*
|
|
28
|
+
* Create payment sessions.
|
|
11
29
|
*/
|
|
12
30
|
exports.createPaymentSessionsWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.createPaymentSessionsWorkflowId, (input) => {
|
|
13
31
|
const paymentCollection = (0, common_1.useRemoteQueryStep)({
|
|
@@ -15,13 +33,73 @@ exports.createPaymentSessionsWorkflow = (0, workflows_sdk_1.createWorkflow)(expo
|
|
|
15
33
|
fields: ["id", "amount", "currency_code", "payment_sessions.*"],
|
|
16
34
|
variables: { id: input.payment_collection_id },
|
|
17
35
|
list: false,
|
|
36
|
+
}).config({ name: "get-payment-collection" });
|
|
37
|
+
const { paymentCustomer, accountHolder, existingAccountHolder } = (0, workflows_sdk_1.when)("customer-id-exists", { input }, (data) => {
|
|
38
|
+
return !!data.input.customer_id;
|
|
39
|
+
}).then(() => {
|
|
40
|
+
const customer = (0, common_1.useRemoteQueryStep)({
|
|
41
|
+
entry_point: "customer",
|
|
42
|
+
fields: [
|
|
43
|
+
"id",
|
|
44
|
+
"email",
|
|
45
|
+
"company_name",
|
|
46
|
+
"first_name",
|
|
47
|
+
"last_name",
|
|
48
|
+
"phone",
|
|
49
|
+
"addresses.*",
|
|
50
|
+
"account_holders.*",
|
|
51
|
+
"metadata",
|
|
52
|
+
],
|
|
53
|
+
variables: { id: input.customer_id },
|
|
54
|
+
list: false,
|
|
55
|
+
}).config({ name: "get-customer" });
|
|
56
|
+
const paymentCustomer = (0, workflows_sdk_1.transform)({ customer }, (data) => {
|
|
57
|
+
return {
|
|
58
|
+
...data.customer,
|
|
59
|
+
billing_address: data.customer.addresses?.find((a) => a.is_default_billing) ??
|
|
60
|
+
data.customer.addresses?.[0],
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
const existingAccountHolder = (0, workflows_sdk_1.transform)({ customer, input }, (data) => {
|
|
64
|
+
return data.customer.account_holders.find((ac) => ac.provider_id === data.input.provider_id);
|
|
65
|
+
});
|
|
66
|
+
const accountHolderInput = (0, workflows_sdk_1.transform)({ existingAccountHolder, input, paymentCustomer }, (data) => {
|
|
67
|
+
return {
|
|
68
|
+
provider_id: data.input.provider_id,
|
|
69
|
+
context: {
|
|
70
|
+
// The module is idempotent, so if there already is a linked account holder, the module will simply return it back.
|
|
71
|
+
account_holder: data.existingAccountHolder,
|
|
72
|
+
customer: data.paymentCustomer,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
const accountHolder = (0, steps_1.createPaymentAccountHolderStep)(accountHolderInput);
|
|
77
|
+
return { paymentCustomer, accountHolder, existingAccountHolder };
|
|
18
78
|
});
|
|
19
|
-
|
|
79
|
+
(0, workflows_sdk_1.when)("account-holder-created", { paymentCustomer, accountHolder, input, existingAccountHolder }, ({ existingAccountHolder, accountHolder }) => {
|
|
80
|
+
return !(0, utils_1.isPresent)(existingAccountHolder) && (0, utils_1.isPresent)(accountHolder);
|
|
81
|
+
}).then(() => {
|
|
82
|
+
(0, common_1.createRemoteLinkStep)([
|
|
83
|
+
{
|
|
84
|
+
[utils_1.Modules.CUSTOMER]: {
|
|
85
|
+
customer_id: paymentCustomer.id,
|
|
86
|
+
},
|
|
87
|
+
[utils_1.Modules.PAYMENT]: {
|
|
88
|
+
account_holder_id: accountHolder.id,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
]);
|
|
92
|
+
});
|
|
93
|
+
const paymentSessionInput = (0, workflows_sdk_1.transform)({ paymentCollection, paymentCustomer, accountHolder, input }, (data) => {
|
|
20
94
|
return {
|
|
21
95
|
payment_collection_id: data.input.payment_collection_id,
|
|
22
96
|
provider_id: data.input.provider_id,
|
|
23
97
|
data: data.input.data,
|
|
24
|
-
context:
|
|
98
|
+
context: {
|
|
99
|
+
...data.input.context,
|
|
100
|
+
customer: data.paymentCustomer,
|
|
101
|
+
account_holder: data.accountHolder,
|
|
102
|
+
},
|
|
25
103
|
amount: data.paymentCollection.amount,
|
|
26
104
|
currency_code: data.paymentCollection.currency_code,
|
|
27
105
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-payment-session.js","sourceRoot":"","sources":["../../../src/payment-collection/workflows/create-payment-session.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"create-payment-session.js","sourceRoot":"","sources":["../../../src/payment-collection/workflows/create-payment-session.ts"],"names":[],"mappings":";;;AAKA,kDAA2D;AAC3D,kEAOuC;AACvC,yCAAuE;AACvE,oCAGiB;AACjB,uEAAyE;AAgC5D,QAAA,+BAA+B,GAAG,yBAAyB,CAAA;AACxE;;;;;;;;;;;;;;;;;;;GAmBG;AACU,QAAA,6BAA6B,GAAG,IAAA,8BAAc,EACzD,uCAA+B,EAC/B,CACE,KAAuD,EAClB,EAAE;IACvC,MAAM,iBAAiB,GAAG,IAAA,2BAAkB,EAAC;QAC3C,WAAW,EAAE,oBAAoB;QACjC,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,oBAAoB,CAAC;QAC/D,SAAS,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,qBAAqB,EAAE;QAC9C,IAAI,EAAE,KAAK;KACZ,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,CAAA;IAE7C,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,qBAAqB,EAAE,GAAG,IAAA,oBAAI,EACpE,oBAAoB,EACpB,EAAE,KAAK,EAAE,EACT,CAAC,IAAI,EAAE,EAAE;QACP,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAA;IACjC,CAAC,CACF,CAAC,IAAI,CAAC,GAAG,EAAE;QACV,MAAM,QAAQ,GACZ,IAAA,2BAAkB,EAAC;YACjB,WAAW,EAAE,UAAU;YACvB,MAAM,EAAE;gBACN,IAAI;gBACJ,OAAO;gBACP,cAAc;gBACd,YAAY;gBACZ,WAAW;gBACX,OAAO;gBACP,aAAa;gBACb,mBAAmB;gBACnB,UAAU;aACX;YACD,SAAS,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAA;QAErC,MAAM,eAAe,GAAG,IAAA,yBAAS,EAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;YACvD,OAAO;gBACL,GAAG,IAAI,CAAC,QAAQ;gBAChB,eAAe,EACb,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC;oBAC1D,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;aAC/B,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,MAAM,qBAAqB,GAAG,IAAA,yBAAS,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;YACpE,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CACvC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,KAAK,IAAI,CAAC,KAAK,CAAC,WAAW,CAClD,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,MAAM,kBAAkB,GAAG,IAAA,yBAAS,EAClC,EAAE,qBAAqB,EAAE,KAAK,EAAE,eAAe,EAAE,EACjD,CAAC,IAAI,EAAE,EAAE;YACP,OAAO;gBACL,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;gBACnC,OAAO,EAAE;oBACP,mHAAmH;oBACnH,cAAc,EAAE,IAAI,CAAC,qBAAqB;oBAC1C,QAAQ,EAAE,IAAI,CAAC,eAAe;iBAC/B;aACF,CAAA;QACH,CAAC,CACF,CAAA;QAED,MAAM,aAAa,GAAG,IAAA,sCAA8B,EAAC,kBAAkB,CAAC,CAAA;QAExE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,qBAAqB,EAAE,CAAA;IAClE,CAAC,CAAC,CAAA;IAEF,IAAA,oBAAI,EACF,wBAAwB,EACxB,EAAE,eAAe,EAAE,aAAa,EAAE,KAAK,EAAE,qBAAqB,EAAE,EAChE,CAAC,EAAE,qBAAqB,EAAE,aAAa,EAAE,EAAE,EAAE;QAC3C,OAAO,CAAC,IAAA,iBAAS,EAAC,qBAAqB,CAAC,IAAI,IAAA,iBAAS,EAAC,aAAa,CAAC,CAAA;IACtE,CAAC,CACF,CAAC,IAAI,CAAC,GAAG,EAAE;QACV,IAAA,6BAAoB,EAAC;YACnB;gBACE,CAAC,eAAO,CAAC,QAAQ,CAAC,EAAE;oBAClB,WAAW,EAAE,eAAe,CAAC,EAAE;iBAChC;gBACD,CAAC,eAAO,CAAC,OAAO,CAAC,EAAE;oBACjB,iBAAiB,EAAE,aAAa,CAAC,EAAE;iBACpC;aACF;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,MAAM,mBAAmB,GAAG,IAAA,yBAAS,EACnC,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,KAAK,EAAE,EAC5D,CAAC,IAAI,EAAE,EAAE;QACP,OAAO;YACL,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB;YACvD,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;YACnC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACrB,OAAO,EAAE;gBACP,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO;gBACrB,QAAQ,EAAE,IAAI,CAAC,eAAe;gBAC9B,cAAc,EAAE,IAAI,CAAC,aAAa;aACnC;YACD,MAAM,EAAE,IAAI,CAAC,iBAAiB,CAAC,MAAM;YACrC,aAAa,EAAE,IAAI,CAAC,iBAAiB,CAAC,aAAa;SACpD,CAAA;IACH,CAAC,CACF,CAAA;IAED,MAAM,yBAAyB,GAAG,IAAA,yBAAS,EACzC,EAAE,iBAAiB,EAAE,EACrB,CAAC,IAAI,EAAE,EAAE;QACP,OAAO;YACL,GAAG,EACD,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE;SACrE,CAAA;IACH,CAAC,CACF,CAAA;IAED,6EAA6E;IAC7E,6EAA6E;IAC7E,8EAA8E;IAC9E,+BAA+B;IAC/B,MAAM,CAAC,OAAO,CAAC,GAAG,IAAA,2BAAW,EAC3B,IAAA,gCAAwB,EAAC,mBAAmB,CAAC,EAC7C,uDAA6B,CAAC,SAAS,CAAC;QACtC,KAAK,EAAE,yBAAyB;KACjC,CAAC,CACH,CAAA;IAED,OAAO,IAAI,gCAAgB,CAAC,OAAO,CAAC,CAAA;AACtC,CAAC,CACF,CAAA"}
|
|
@@ -1,9 +1,36 @@
|
|
|
1
|
-
import { CreateRefundReasonDTO, RefundReasonDTO } from "@etohq/types";
|
|
2
|
-
export declare const createRefundReasonsWorkflowId = "create-refund-reasons-workflow";
|
|
1
|
+
import { CreateRefundReasonDTO, RefundReasonDTO } from "@etohq/framework/types";
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
* The data to create refund reasons.
|
|
5
4
|
*/
|
|
6
|
-
export
|
|
5
|
+
export type CreateRefundReasonsWorkflowInput = {
|
|
6
|
+
/**
|
|
7
|
+
* The refund reasons to create.
|
|
8
|
+
*/
|
|
7
9
|
data: CreateRefundReasonDTO[];
|
|
8
|
-
}
|
|
10
|
+
};
|
|
11
|
+
export declare const createRefundReasonsWorkflowId = "create-refund-reasons-workflow";
|
|
12
|
+
/**
|
|
13
|
+
* This workflow creates one or more refund reasons. It's used by the
|
|
14
|
+
* [Create Refund Reason Admin API Route](https://docs.etohq.com/api/admin#refund-reasons_postrefundreasons).
|
|
15
|
+
*
|
|
16
|
+
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
17
|
+
* to create refund reasons in your custom flows.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const { result } = await createRefundReasonsWorkflow(container)
|
|
21
|
+
* .run({
|
|
22
|
+
* input: {
|
|
23
|
+
* data: [
|
|
24
|
+
* {
|
|
25
|
+
* label: "damaged",
|
|
26
|
+
* }
|
|
27
|
+
* ]
|
|
28
|
+
* }
|
|
29
|
+
* })
|
|
30
|
+
*
|
|
31
|
+
* @summary
|
|
32
|
+
*
|
|
33
|
+
* Create refund reasons.
|
|
34
|
+
*/
|
|
35
|
+
export declare const createRefundReasonsWorkflow: import("@etohq/framework/workflows-sdk").ReturnWorkflow<CreateRefundReasonsWorkflowInput, RefundReasonDTO[], []>;
|
|
9
36
|
//# sourceMappingURL=create-refund-reasons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-refund-reasons.d.ts","sourceRoot":"","sources":["../../../src/payment-collection/workflows/create-refund-reasons.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,eAAe,EAChB,MAAM,
|
|
1
|
+
{"version":3,"file":"create-refund-reasons.d.ts","sourceRoot":"","sources":["../../../src/payment-collection/workflows/create-refund-reasons.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,eAAe,EAChB,MAAM,wBAAwB,CAAA;AAQ/B;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;OAEG;IACH,IAAI,EAAE,qBAAqB,EAAE,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,6BAA6B,mCAAmC,CAAA;AAC7E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,2BAA2B,kHAOvC,CAAA"}
|
|
@@ -5,7 +5,27 @@ const workflows_sdk_1 = require("@etohq/framework/workflows-sdk");
|
|
|
5
5
|
const create_refund_reasons_1 = require("../steps/create-refund-reasons");
|
|
6
6
|
exports.createRefundReasonsWorkflowId = "create-refund-reasons-workflow";
|
|
7
7
|
/**
|
|
8
|
-
* This workflow creates one or more refund reasons.
|
|
8
|
+
* This workflow creates one or more refund reasons. It's used by the
|
|
9
|
+
* [Create Refund Reason Admin API Route](https://docs.etohq.com/api/admin#refund-reasons_postrefundreasons).
|
|
10
|
+
*
|
|
11
|
+
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
12
|
+
* to create refund reasons in your custom flows.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const { result } = await createRefundReasonsWorkflow(container)
|
|
16
|
+
* .run({
|
|
17
|
+
* input: {
|
|
18
|
+
* data: [
|
|
19
|
+
* {
|
|
20
|
+
* label: "damaged",
|
|
21
|
+
* }
|
|
22
|
+
* ]
|
|
23
|
+
* }
|
|
24
|
+
* })
|
|
25
|
+
*
|
|
26
|
+
* @summary
|
|
27
|
+
*
|
|
28
|
+
* Create refund reasons.
|
|
9
29
|
*/
|
|
10
30
|
exports.createRefundReasonsWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.createRefundReasonsWorkflowId, (input) => {
|
|
11
31
|
return new workflows_sdk_1.WorkflowResponse((0, create_refund_reasons_1.createRefundReasonStep)(input.data));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-refund-reasons.js","sourceRoot":"","sources":["../../../src/payment-collection/workflows/create-refund-reasons.ts"],"names":[],"mappings":";;;AAIA,kEAIuC;AACvC,0EAAuE;
|
|
1
|
+
{"version":3,"file":"create-refund-reasons.js","sourceRoot":"","sources":["../../../src/payment-collection/workflows/create-refund-reasons.ts"],"names":[],"mappings":";;;AAIA,kEAIuC;AACvC,0EAAuE;AAY1D,QAAA,6BAA6B,GAAG,gCAAgC,CAAA;AAC7E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACU,QAAA,2BAA2B,GAAG,IAAA,8BAAc,EACvD,qCAA6B,EAC7B,CACE,KAAqD,EAChB,EAAE;IACvC,OAAO,IAAI,gCAAgB,CAAC,IAAA,8CAAsB,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;AACjE,CAAC,CACF,CAAA"}
|
|
@@ -1,9 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The data to delete payment sessions.
|
|
3
|
+
*/
|
|
1
4
|
export interface DeletePaymentSessionsWorkflowInput {
|
|
5
|
+
/**
|
|
6
|
+
* The IDs of the payment sessions to delete.
|
|
7
|
+
*/
|
|
2
8
|
ids: string[];
|
|
3
9
|
}
|
|
4
10
|
export declare const deletePaymentSessionsWorkflowId = "delete-payment-sessions";
|
|
5
11
|
/**
|
|
6
|
-
* This workflow deletes one or more payment sessions.
|
|
12
|
+
* This workflow deletes one or more payment sessions. It's used by other workflows, like
|
|
13
|
+
* {@link refreshPaymentCollectionForCartWorkflow} to delete payment sessions when the cart's total changes.
|
|
14
|
+
*
|
|
15
|
+
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
16
|
+
* to delete payment sessions in your custom flows.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* const { result } = await deletePaymentSessionsWorkflow(container)
|
|
20
|
+
* .run({
|
|
21
|
+
* input: {
|
|
22
|
+
* ids: ["payses_123"]
|
|
23
|
+
* }
|
|
24
|
+
* })
|
|
25
|
+
*
|
|
26
|
+
* @summary
|
|
27
|
+
*
|
|
28
|
+
* Delete payment sessions.
|
|
7
29
|
*/
|
|
8
30
|
export declare const deletePaymentSessionsWorkflow: import("@etohq/framework/workflows-sdk").ReturnWorkflow<DeletePaymentSessionsWorkflowInput, string[], []>;
|
|
9
31
|
//# sourceMappingURL=delete-payment-sessions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-payment-sessions.d.ts","sourceRoot":"","sources":["../../../src/payment-collection/workflows/delete-payment-sessions.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,kCAAkC;IACjD,GAAG,EAAE,MAAM,EAAE,CAAA;CACd;AAED,eAAO,MAAM,+BAA+B,4BAA4B,CAAA;AACxE
|
|
1
|
+
{"version":3,"file":"delete-payment-sessions.d.ts","sourceRoot":"","sources":["../../../src/payment-collection/workflows/delete-payment-sessions.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD;;OAEG;IACH,GAAG,EAAE,MAAM,EAAE,CAAA;CACd;AAED,eAAO,MAAM,+BAA+B,4BAA4B,CAAA;AACxE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,2GAYzC,CAAA"}
|
|
@@ -5,7 +5,23 @@ const workflows_sdk_1 = require("@etohq/framework/workflows-sdk");
|
|
|
5
5
|
const steps_1 = require("../steps");
|
|
6
6
|
exports.deletePaymentSessionsWorkflowId = "delete-payment-sessions";
|
|
7
7
|
/**
|
|
8
|
-
* This workflow deletes one or more payment sessions.
|
|
8
|
+
* This workflow deletes one or more payment sessions. It's used by other workflows, like
|
|
9
|
+
* {@link refreshPaymentCollectionForCartWorkflow} to delete payment sessions when the cart's total changes.
|
|
10
|
+
*
|
|
11
|
+
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
12
|
+
* to delete payment sessions in your custom flows.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const { result } = await deletePaymentSessionsWorkflow(container)
|
|
16
|
+
* .run({
|
|
17
|
+
* input: {
|
|
18
|
+
* ids: ["payses_123"]
|
|
19
|
+
* }
|
|
20
|
+
* })
|
|
21
|
+
*
|
|
22
|
+
* @summary
|
|
23
|
+
*
|
|
24
|
+
* Delete payment sessions.
|
|
9
25
|
*/
|
|
10
26
|
exports.deletePaymentSessionsWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.deletePaymentSessionsWorkflowId, (input) => {
|
|
11
27
|
const idsDeleted = (0, steps_1.deletePaymentSessionsStep)({ ids: input.ids });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-payment-sessions.js","sourceRoot":"","sources":["../../../src/payment-collection/workflows/delete-payment-sessions.ts"],"names":[],"mappings":";;;AAAA,kEAIuC;AACvC,oCAGiB;
|
|
1
|
+
{"version":3,"file":"delete-payment-sessions.js","sourceRoot":"","sources":["../../../src/payment-collection/workflows/delete-payment-sessions.ts"],"names":[],"mappings":";;;AAAA,kEAIuC;AACvC,oCAGiB;AAYJ,QAAA,+BAA+B,GAAG,yBAAyB,CAAA;AACxE;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,6BAA6B,GAAG,IAAA,8BAAc,EACzD,uCAA+B,EAC/B,CAAC,KAAuD,EAAE,EAAE;IAC1D,MAAM,UAAU,GAAG,IAAA,iCAAyB,EAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAA;IAEhE,IAAA,0CAAkC,EAAC;QACjC,WAAW,EAAE,KAAK,CAAC,GAAG;QACtB,UAAU;KACX,CAAC,CAAA;IAEF,OAAO,IAAI,gCAAgB,CAAC,UAAU,CAAC,CAAA;AACzC,CAAC,CACF,CAAA"}
|
|
@@ -1,8 +1,31 @@
|
|
|
1
|
-
export declare const deleteRefundReasonsWorkflowId = "delete-refund-reasons-workflow";
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* The data to delete refund reasons.
|
|
4
3
|
*/
|
|
5
|
-
export
|
|
4
|
+
export type DeleteRefundReasonsWorkflowInput = {
|
|
5
|
+
/**
|
|
6
|
+
* The refund reasons to delete.
|
|
7
|
+
*/
|
|
6
8
|
ids: string[];
|
|
7
|
-
}
|
|
9
|
+
};
|
|
10
|
+
export declare const deleteRefundReasonsWorkflowId = "delete-refund-reasons-workflow";
|
|
11
|
+
/**
|
|
12
|
+
* This workflow deletes one or more refund reasons. It's used by the
|
|
13
|
+
* [Delete Refund Reason Admin API Route](https://docs.etohq.com/api/admin#refund-reasons_deleterefundreasonsid).
|
|
14
|
+
*
|
|
15
|
+
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
16
|
+
* to delete refund reasons in your custom flows.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* const { result } = await deleteRefundReasonsWorkflow(container)
|
|
20
|
+
* .run({
|
|
21
|
+
* input: {
|
|
22
|
+
* ids: ["refres_123"]
|
|
23
|
+
* }
|
|
24
|
+
* })
|
|
25
|
+
*
|
|
26
|
+
* @summary
|
|
27
|
+
*
|
|
28
|
+
* Delete refund reasons.
|
|
29
|
+
*/
|
|
30
|
+
export declare const deleteRefundReasonsWorkflow: import("@etohq/framework/workflows-sdk").ReturnWorkflow<DeleteRefundReasonsWorkflowInput, void, []>;
|
|
8
31
|
//# sourceMappingURL=delete-refund-reasons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-refund-reasons.d.ts","sourceRoot":"","sources":["../../../src/payment-collection/workflows/delete-refund-reasons.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,6BAA6B,mCAAmC,CAAA;AAC7E
|
|
1
|
+
{"version":3,"file":"delete-refund-reasons.d.ts","sourceRoot":"","sources":["../../../src/payment-collection/workflows/delete-refund-reasons.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;OAEG;IACH,GAAG,EAAE,MAAM,EAAE,CAAA;CACd,CAAA;AAED,eAAO,MAAM,6BAA6B,mCAAmC,CAAA;AAC7E;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,2BAA2B,qGAKvC,CAAA"}
|
|
@@ -5,7 +5,23 @@ const workflows_sdk_1 = require("@etohq/framework/workflows-sdk");
|
|
|
5
5
|
const steps_1 = require("../steps");
|
|
6
6
|
exports.deleteRefundReasonsWorkflowId = "delete-refund-reasons-workflow";
|
|
7
7
|
/**
|
|
8
|
-
* This workflow deletes one or more refund reasons.
|
|
8
|
+
* This workflow deletes one or more refund reasons. It's used by the
|
|
9
|
+
* [Delete Refund Reason Admin API Route](https://docs.etohq.com/api/admin#refund-reasons_deleterefundreasonsid).
|
|
10
|
+
*
|
|
11
|
+
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
12
|
+
* to delete refund reasons in your custom flows.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const { result } = await deleteRefundReasonsWorkflow(container)
|
|
16
|
+
* .run({
|
|
17
|
+
* input: {
|
|
18
|
+
* ids: ["refres_123"]
|
|
19
|
+
* }
|
|
20
|
+
* })
|
|
21
|
+
*
|
|
22
|
+
* @summary
|
|
23
|
+
*
|
|
24
|
+
* Delete refund reasons.
|
|
9
25
|
*/
|
|
10
26
|
exports.deleteRefundReasonsWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.deleteRefundReasonsWorkflowId, (input) => {
|
|
11
27
|
return new workflows_sdk_1.WorkflowResponse((0, steps_1.deleteRefundReasonsStep)(input.ids));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-refund-reasons.js","sourceRoot":"","sources":["../../../src/payment-collection/workflows/delete-refund-reasons.ts"],"names":[],"mappings":";;;AAAA,kEAIuC;AACvC,oCAAkD;
|
|
1
|
+
{"version":3,"file":"delete-refund-reasons.js","sourceRoot":"","sources":["../../../src/payment-collection/workflows/delete-refund-reasons.ts"],"names":[],"mappings":";;;AAAA,kEAIuC;AACvC,oCAAkD;AAYrC,QAAA,6BAA6B,GAAG,gCAAgC,CAAA;AAC7E;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,2BAA2B,GAAG,IAAA,8BAAc,EACvD,qCAA6B,EAC7B,CAAC,KAAqD,EAA0B,EAAE;IAChF,OAAO,IAAI,gCAAgB,CAAC,IAAA,+BAAuB,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;AACjE,CAAC,CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/payment-collection/workflows/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/payment-collection/workflows/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA"}
|
|
@@ -17,5 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./create-payment-session"), exports);
|
|
18
18
|
__exportStar(require("./create-refund-reasons"), exports);
|
|
19
19
|
__exportStar(require("./delete-payment-sessions"), exports);
|
|
20
|
+
__exportStar(require("./delete-refund-reasons"), exports);
|
|
20
21
|
__exportStar(require("./update-refund-reasons"), exports);
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/payment-collection/workflows/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAwC;AACxC,0DAAuC;AACvC,4DAAyC;AACzC,0DAAuC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/payment-collection/workflows/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAwC;AACxC,0DAAuC;AACvC,4DAAyC;AACzC,0DAAuC;AACvC,0DAAuC"}
|
|
@@ -1,7 +1,34 @@
|
|
|
1
|
-
import { RefundReasonDTO, UpdateRefundReasonDTO } from "@etohq/types";
|
|
1
|
+
import { RefundReasonDTO, UpdateRefundReasonDTO } from "@etohq/framework/types";
|
|
2
|
+
/**
|
|
3
|
+
* The refund reasons to update.
|
|
4
|
+
*/
|
|
5
|
+
export type UpdateRefundReasonsWorkflowInput = UpdateRefundReasonDTO[];
|
|
6
|
+
/**
|
|
7
|
+
* The updated refund reasons.
|
|
8
|
+
*/
|
|
9
|
+
export type UpdateRefundReasonsWorkflowOutput = RefundReasonDTO[];
|
|
2
10
|
export declare const updateRefundReasonsWorkflowId = "update-refund-reasons";
|
|
3
11
|
/**
|
|
4
|
-
* This workflow updates one or more refund reasons.
|
|
12
|
+
* This workflow updates one or more refund reasons. It's used by the
|
|
13
|
+
* [Update Refund Reason Admin API Route](https://docs.etohq.com/api/admin#refund-reasons_postrefundreasonsid).
|
|
14
|
+
*
|
|
15
|
+
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
16
|
+
* to update refund reasons in your custom flows.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* const { result } = await updateRefundReasonsWorkflow(container)
|
|
20
|
+
* .run({
|
|
21
|
+
* input: [
|
|
22
|
+
* {
|
|
23
|
+
* id: "refres_123",
|
|
24
|
+
* label: "Damaged",
|
|
25
|
+
* }
|
|
26
|
+
* ]
|
|
27
|
+
* })
|
|
28
|
+
*
|
|
29
|
+
* @summary
|
|
30
|
+
*
|
|
31
|
+
* Update refund reasons.
|
|
5
32
|
*/
|
|
6
|
-
export declare const updateRefundReasonsWorkflow: import("@etohq/framework/workflows-sdk").ReturnWorkflow<
|
|
33
|
+
export declare const updateRefundReasonsWorkflow: import("@etohq/framework/workflows-sdk").ReturnWorkflow<UpdateRefundReasonsWorkflowInput, UpdateRefundReasonsWorkflowOutput, []>;
|
|
7
34
|
//# sourceMappingURL=update-refund-reasons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-refund-reasons.d.ts","sourceRoot":"","sources":["../../../src/payment-collection/workflows/update-refund-reasons.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,qBAAqB,EACtB,MAAM,
|
|
1
|
+
{"version":3,"file":"update-refund-reasons.d.ts","sourceRoot":"","sources":["../../../src/payment-collection/workflows/update-refund-reasons.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,qBAAqB,EACtB,MAAM,wBAAwB,CAAA;AAQ/B;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG,qBAAqB,EAAE,CAAA;AAEtE;;GAEG;AACH,MAAM,MAAM,iCAAiC,GAAG,eAAe,EAAE,CAAA;AAEjE,eAAO,MAAM,6BAA6B,0BAA0B,CAAA;AACpE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,2BAA2B,kIAOvC,CAAA"}
|
|
@@ -5,7 +5,26 @@ const workflows_sdk_1 = require("@etohq/framework/workflows-sdk");
|
|
|
5
5
|
const steps_1 = require("../steps");
|
|
6
6
|
exports.updateRefundReasonsWorkflowId = "update-refund-reasons";
|
|
7
7
|
/**
|
|
8
|
-
* This workflow updates one or more refund reasons.
|
|
8
|
+
* This workflow updates one or more refund reasons. It's used by the
|
|
9
|
+
* [Update Refund Reason Admin API Route](https://docs.etohq.com/api/admin#refund-reasons_postrefundreasonsid).
|
|
10
|
+
*
|
|
11
|
+
* You can use this workflow within your own customizations or custom workflows, allowing you
|
|
12
|
+
* to update refund reasons in your custom flows.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const { result } = await updateRefundReasonsWorkflow(container)
|
|
16
|
+
* .run({
|
|
17
|
+
* input: [
|
|
18
|
+
* {
|
|
19
|
+
* id: "refres_123",
|
|
20
|
+
* label: "Damaged",
|
|
21
|
+
* }
|
|
22
|
+
* ]
|
|
23
|
+
* })
|
|
24
|
+
*
|
|
25
|
+
* @summary
|
|
26
|
+
*
|
|
27
|
+
* Update refund reasons.
|
|
9
28
|
*/
|
|
10
29
|
exports.updateRefundReasonsWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.updateRefundReasonsWorkflowId, (input) => {
|
|
11
30
|
return new workflows_sdk_1.WorkflowResponse((0, steps_1.updateRefundReasonsStep)(input));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-refund-reasons.js","sourceRoot":"","sources":["../../../src/payment-collection/workflows/update-refund-reasons.ts"],"names":[],"mappings":";;;AAIA,kEAIuC;AACvC,oCAAkD;
|
|
1
|
+
{"version":3,"file":"update-refund-reasons.js","sourceRoot":"","sources":["../../../src/payment-collection/workflows/update-refund-reasons.ts"],"names":[],"mappings":";;;AAIA,kEAIuC;AACvC,oCAAkD;AAYrC,QAAA,6BAA6B,GAAG,uBAAuB,CAAA;AACpE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACU,QAAA,2BAA2B,GAAG,IAAA,8BAAc,EACvD,qCAA6B,EAC7B,CACE,KAAqD,EACA,EAAE;IACvD,OAAO,IAAI,gCAAgB,CAAC,IAAA,+BAAuB,EAAC,KAAK,CAAC,CAAC,CAAA;AAC7D,CAAC,CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/api-key/index.ts","../src/api-key/steps/create-api-keys.ts","../src/api-key/steps/delete-api-keys.ts","../src/api-key/steps/index.ts","../src/api-key/steps/revoke-api-keys.ts","../src/api-key/steps/update-api-keys.ts","../src/api-key/workflows/create-api-keys.ts","../src/api-key/workflows/delete-api-keys.ts","../src/api-key/workflows/index.ts","../src/api-key/workflows/revoke-api-keys.ts","../src/api-key/workflows/update-api-keys.ts","../src/auth/index.ts","../src/auth/steps/index.ts","../src/auth/steps/set-auth-app-metadata.ts","../src/auth/workflows/generate-reset-password-token.ts","../src/auth/workflows/index.ts","../src/common/index.ts","../src/common/steps/create-entities.ts","../src/common/steps/create-remote-links.ts","../src/common/steps/delete-entities.ts","../src/common/steps/dismiss-remote-links.ts","../src/common/steps/emit-event.ts","../src/common/steps/release-event.ts","../src/common/steps/remove-remote-links.ts","../src/common/steps/update-remote-links.ts","../src/common/steps/use-query-graph.ts","../src/common/steps/use-remote-query.ts","../src/common/steps/validate-presence-of.ts","../src/common/workflows/batch-links.ts","../src/common/workflows/create-links.ts","../src/common/workflows/dismiss-links.ts","../src/common/workflows/update-links.ts","../src/file/index.ts","../src/file/steps/delete-files.ts","../src/file/steps/index.ts","../src/file/steps/upload-files.ts","../src/file/workflows/delete-files.ts","../src/file/workflows/index.ts","../src/file/workflows/upload-files.ts","../src/notification/index.ts","../src/notification/steps/index.ts","../src/notification/steps/notify-on-failure.ts","../src/notification/steps/send-notifications.ts","../src/payment/index.ts","../src/payment/steps/authorize-payment-session.ts","../src/payment/steps/cancel-payment.ts","../src/payment/steps/capture-payment.ts","../src/payment/steps/index.ts","../src/payment/steps/refund-payment.ts","../src/payment/steps/refund-payments.ts","../src/payment-collection/index.ts","../src/payment-collection/steps/create-payment-session.ts","../src/payment-collection/steps/create-refund-reasons.ts","../src/payment-collection/steps/delete-payment-sessions.ts","../src/payment-collection/steps/delete-refund-reasons.ts","../src/payment-collection/steps/index.ts","../src/payment-collection/steps/update-payment-collection.ts","../src/payment-collection/steps/update-refund-reasons.ts","../src/payment-collection/steps/validate-deleted-payment-sessions.ts","../src/payment-collection/workflows/create-payment-session.ts","../src/payment-collection/workflows/create-refund-reasons.ts","../src/payment-collection/workflows/delete-payment-sessions.ts","../src/payment-collection/workflows/delete-refund-reasons.ts","../src/payment-collection/workflows/index.ts","../src/payment-collection/workflows/update-refund-reasons.ts","../src/user/index.ts","../src/user/steps/create-users.ts","../src/user/steps/delete-users.ts","../src/user/steps/index.ts","../src/user/steps/update-users.ts","../src/user/workflows/create-user-account.ts","../src/user/workflows/create-users.ts","../src/user/workflows/delete-users.ts","../src/user/workflows/index.ts","../src/user/workflows/remove-user-account.ts","../src/user/workflows/update-users.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["../src/index.ts","../src/api-key/index.ts","../src/api-key/steps/create-api-keys.ts","../src/api-key/steps/delete-api-keys.ts","../src/api-key/steps/index.ts","../src/api-key/steps/revoke-api-keys.ts","../src/api-key/steps/update-api-keys.ts","../src/api-key/workflows/create-api-keys.ts","../src/api-key/workflows/delete-api-keys.ts","../src/api-key/workflows/index.ts","../src/api-key/workflows/revoke-api-keys.ts","../src/api-key/workflows/update-api-keys.ts","../src/auth/index.ts","../src/auth/steps/index.ts","../src/auth/steps/set-auth-app-metadata.ts","../src/auth/workflows/generate-reset-password-token.ts","../src/auth/workflows/index.ts","../src/common/index.ts","../src/common/steps/create-entities.ts","../src/common/steps/create-remote-links.ts","../src/common/steps/delete-entities.ts","../src/common/steps/dismiss-remote-links.ts","../src/common/steps/emit-event.ts","../src/common/steps/release-event.ts","../src/common/steps/remove-remote-links.ts","../src/common/steps/update-remote-links.ts","../src/common/steps/use-query-graph.ts","../src/common/steps/use-remote-query.ts","../src/common/steps/validate-presence-of.ts","../src/common/workflows/batch-links.ts","../src/common/workflows/create-links.ts","../src/common/workflows/dismiss-links.ts","../src/common/workflows/update-links.ts","../src/file/index.ts","../src/file/steps/delete-files.ts","../src/file/steps/index.ts","../src/file/steps/upload-files.ts","../src/file/workflows/delete-files.ts","../src/file/workflows/index.ts","../src/file/workflows/upload-files.ts","../src/invite/index.ts","../src/invite/steps/create-invites.ts","../src/invite/steps/delete-invites.ts","../src/invite/steps/index.ts","../src/invite/steps/refresh-invite-tokens.ts","../src/invite/steps/validate-token.ts","../src/invite/workflows/accept-invite.ts","../src/invite/workflows/create-invites.ts","../src/invite/workflows/delete-invites.ts","../src/invite/workflows/index.ts","../src/invite/workflows/refresh-invite-tokens.ts","../src/locking/acquire-lock.ts","../src/locking/index.ts","../src/locking/release-lock.ts","../src/notification/index.ts","../src/notification/steps/index.ts","../src/notification/steps/notify-on-failure.ts","../src/notification/steps/send-notifications.ts","../src/payment/index.ts","../src/payment/steps/authorize-payment-session.ts","../src/payment/steps/cancel-payment.ts","../src/payment/steps/capture-payment.ts","../src/payment/steps/index.ts","../src/payment/steps/refund-payment.ts","../src/payment/steps/refund-payments.ts","../src/payment-collection/index.ts","../src/payment-collection/steps/cancel-payment.ts","../src/payment-collection/steps/create-payment-account-holder.ts","../src/payment-collection/steps/create-payment-session.ts","../src/payment-collection/steps/create-refund-reasons.ts","../src/payment-collection/steps/delete-payment-sessions.ts","../src/payment-collection/steps/delete-refund-reasons.ts","../src/payment-collection/steps/index.ts","../src/payment-collection/steps/update-payment-collection.ts","../src/payment-collection/steps/update-refund-reasons.ts","../src/payment-collection/steps/validate-deleted-payment-sessions.ts","../src/payment-collection/workflows/cancel-payment-collection.ts","../src/payment-collection/workflows/create-payment-session.ts","../src/payment-collection/workflows/create-refund-reasons.ts","../src/payment-collection/workflows/delete-payment-sessions.ts","../src/payment-collection/workflows/delete-refund-reasons.ts","../src/payment-collection/workflows/index.ts","../src/payment-collection/workflows/update-refund-reasons.ts","../src/user/index.ts","../src/user/steps/create-users.ts","../src/user/steps/delete-users.ts","../src/user/steps/index.ts","../src/user/steps/update-users.ts","../src/user/workflows/create-user-account.ts","../src/user/workflows/create-users.ts","../src/user/workflows/delete-users.ts","../src/user/workflows/index.ts","../src/user/workflows/remove-user-account.ts","../src/user/workflows/update-users.ts"],"version":"5.8.3"}
|