@adonis-agora/payments 1.0.0-rc.11 → 1.0.0-rc.13
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/CHANGELOG.md +17 -0
- package/dist/commands/main.d.ts +23 -3
- package/dist/commands/main.d.ts.map +1 -1
- package/dist/commands/main.js +39 -1
- package/dist/commands/main.js.map +1 -1
- package/dist/commands/payments_audit_list.d.ts +15 -0
- package/dist/commands/payments_audit_list.d.ts.map +1 -0
- package/dist/commands/payments_audit_list.js +55 -0
- package/dist/commands/payments_audit_list.js.map +1 -0
- package/dist/commands/payments_customers_list.d.ts +14 -0
- package/dist/commands/payments_customers_list.d.ts.map +1 -0
- package/dist/commands/payments_customers_list.js +50 -0
- package/dist/commands/payments_customers_list.js.map +1 -0
- package/dist/commands/payments_disputes_evidence.d.ts +20 -0
- package/dist/commands/payments_disputes_evidence.d.ts.map +1 -0
- package/dist/commands/payments_disputes_evidence.js +77 -0
- package/dist/commands/payments_disputes_evidence.js.map +1 -0
- package/dist/commands/payments_disputes_list.d.ts +16 -0
- package/dist/commands/payments_disputes_list.d.ts.map +1 -0
- package/dist/commands/payments_disputes_list.js +48 -0
- package/dist/commands/payments_disputes_list.js.map +1 -0
- package/dist/commands/payments_disputes_resolve.d.ts +15 -0
- package/dist/commands/payments_disputes_resolve.d.ts.map +1 -0
- package/dist/commands/payments_disputes_resolve.js +53 -0
- package/dist/commands/payments_disputes_resolve.js.map +1 -0
- package/dist/commands/payments_organizations_list.d.ts +11 -0
- package/dist/commands/payments_organizations_list.d.ts.map +1 -0
- package/dist/commands/payments_organizations_list.js +36 -0
- package/dist/commands/payments_organizations_list.js.map +1 -0
- package/dist/commands/payments_overview.d.ts +11 -0
- package/dist/commands/payments_overview.d.ts.map +1 -0
- package/dist/commands/payments_overview.js +48 -0
- package/dist/commands/payments_overview.js.map +1 -0
- package/dist/commands/payments_payments_list.d.ts +15 -0
- package/dist/commands/payments_payments_list.d.ts.map +1 -0
- package/dist/commands/payments_payments_list.js +62 -0
- package/dist/commands/payments_payments_list.js.map +1 -0
- package/dist/commands/payments_payments_refund.d.ts +14 -0
- package/dist/commands/payments_payments_refund.d.ts.map +1 -0
- package/dist/commands/payments_payments_refund.js +46 -0
- package/dist/commands/payments_payments_refund.js.map +1 -0
- package/dist/commands/payments_payments_show.d.ts +9 -0
- package/dist/commands/payments_payments_show.d.ts.map +1 -0
- package/dist/commands/payments_payments_show.js +67 -0
- package/dist/commands/payments_payments_show.js.map +1 -0
- package/dist/commands/payments_providers_list.d.ts +11 -0
- package/dist/commands/payments_providers_list.d.ts.map +1 -0
- package/dist/commands/payments_providers_list.js +35 -0
- package/dist/commands/payments_providers_list.js.map +1 -0
- package/dist/commands/payments_subscriptions_cancel.d.ts +14 -0
- package/dist/commands/payments_subscriptions_cancel.d.ts.map +1 -0
- package/dist/commands/payments_subscriptions_cancel.js +42 -0
- package/dist/commands/payments_subscriptions_cancel.js.map +1 -0
- package/dist/commands/payments_subscriptions_list.d.ts +13 -0
- package/dist/commands/payments_subscriptions_list.d.ts.map +1 -0
- package/dist/commands/payments_subscriptions_list.js +49 -0
- package/dist/commands/payments_subscriptions_list.js.map +1 -0
- package/dist/commands/payments_subscriptions_reprice.d.ts +16 -0
- package/dist/commands/payments_subscriptions_reprice.d.ts.map +1 -0
- package/dist/commands/payments_subscriptions_reprice.js +56 -0
- package/dist/commands/payments_subscriptions_reprice.js.map +1 -0
- package/dist/commands/payments_subscriptions_resume.d.ts +12 -0
- package/dist/commands/payments_subscriptions_resume.d.ts.map +1 -0
- package/dist/commands/payments_subscriptions_resume.js +31 -0
- package/dist/commands/payments_subscriptions_resume.js.map +1 -0
- package/dist/commands/payments_subscriptions_show.d.ts +9 -0
- package/dist/commands/payments_subscriptions_show.d.ts.map +1 -0
- package/dist/commands/payments_subscriptions_show.js +66 -0
- package/dist/commands/payments_subscriptions_show.js.map +1 -0
- package/dist/commands/payments_webhook_events_list.d.ts +13 -0
- package/dist/commands/payments_webhook_events_list.d.ts.map +1 -0
- package/dist/commands/payments_webhook_events_list.js +42 -0
- package/dist/commands/payments_webhook_events_list.js.map +1 -0
- package/dist/commands/payments_webhook_events_retry.d.ts +13 -0
- package/dist/commands/payments_webhook_events_retry.d.ts.map +1 -0
- package/dist/commands/payments_webhook_events_retry.js +34 -0
- package/dist/commands/payments_webhook_events_retry.js.map +1 -0
- package/dist/providers/dashboard_provider.d.ts +4 -16
- package/dist/providers/dashboard_provider.d.ts.map +1 -1
- package/dist/providers/dashboard_provider.js +32 -137
- package/dist/providers/dashboard_provider.js.map +1 -1
- package/dist/src/billing/billing_store.d.ts +8 -0
- package/dist/src/billing/billing_store.d.ts.map +1 -1
- package/dist/src/billing/billing_store.js +8 -0
- package/dist/src/billing/billing_store.js.map +1 -1
- package/dist/src/cli/console_command.d.ts +85 -0
- package/dist/src/cli/console_command.d.ts.map +1 -0
- package/dist/src/cli/console_command.js +265 -0
- package/dist/src/cli/console_command.js.map +1 -0
- package/dist/src/dashboard/actions.d.ts +45 -0
- package/dist/src/dashboard/actions.d.ts.map +1 -1
- package/dist/src/dashboard/actions.js +40 -1
- package/dist/src/dashboard/actions.js.map +1 -1
- package/dist/src/dashboard/api_core.d.ts +148 -0
- package/dist/src/dashboard/api_core.d.ts.map +1 -0
- package/dist/src/dashboard/api_core.js +172 -0
- package/dist/src/dashboard/api_core.js.map +1 -0
- package/dist/src/dashboard/console_shell.d.ts +8 -4
- package/dist/src/dashboard/console_shell.d.ts.map +1 -1
- package/dist/src/dashboard/console_shell.js +89 -31
- package/dist/src/dashboard/console_shell.js.map +1 -1
- package/dist/src/dashboard/dev_tools.d.ts.map +1 -1
- package/dist/src/dashboard/dev_tools.js +3 -16
- package/dist/src/dashboard/dev_tools.js.map +1 -1
- package/dist/src/dashboard/handlers.d.ts +53 -7
- package/dist/src/dashboard/handlers.d.ts.map +1 -1
- package/dist/src/dashboard/handlers.js +472 -10
- package/dist/src/dashboard/handlers.js.map +1 -1
- package/dist/src/dashboard/index.d.ts +6 -4
- package/dist/src/dashboard/index.d.ts.map +1 -1
- package/dist/src/dashboard/index.js +5 -3
- package/dist/src/dashboard/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @adonis-agora/payments
|
|
2
2
|
|
|
3
|
+
## 1.0.0-rc.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#242](https://github.com/DavideCarvalho/adonis-agora-payments/pull/242) [`383b4d0`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/383b4d00022de7dfc8a0e8155e20bb2d17bb51de) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Console footer: the signed-in user's role now shows when no `viewer` hook is set. The structural read of `ctx.auth.user` takes `role`, `roles` (strings, `{ name }` or authz `{ role }` rows) and `globalRoles`, plus the global roles of authkit's per-request identity on `ctx.authkit` (read structurally, 250 ms cap). One role is shown: an admin-like one first, else the first.
|
|
8
|
+
|
|
9
|
+
## 1.0.0-rc.12
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#241](https://github.com/DavideCarvalho/adonis-agora-payments/pull/241) [`d1f2756`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/d1f27561b3fe8bed8e2fa844bcb55982ec8a5479) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Operate billing from the terminal: every console read and action now has a `payments:<noun>:<verb>` ace command that serves the console's own handler (same filters, refusals, organization scope and audit trail).
|
|
14
|
+
|
|
15
|
+
- Reads: `payments:overview`, `payments:payments:list|show`, `payments:subscriptions:list|show`, `payments:customers:list`, `payments:disputes:list`, `payments:webhook-events:list`, `payments:audit:list`, `payments:providers:list`, `payments:organizations:list`. `--json` prints the console's `{ data, meta }`; `--tenant` narrows to one organization; lists take `--page`/`--size`.
|
|
16
|
+
- Actions: `payments:payments:refund`, `payments:subscriptions:cancel|resume|reprice`, `payments:disputes:resolve|evidence`, `payments:webhook-events:retry`. Each validates first, asks for confirmation unless `--force` (and refuses without a terminal), takes `--dry-run` to show what would happen without sending or writing anything, and records `cli:<os user>` plus `--note` in the audit trail.
|
|
17
|
+
- New console handlers behind the commands: `cancelSubscription`, `resumeSubscription`, `repriceSubscription` (through `manager.subscriptions()`) and `submitDisputeEvidence` (through the dispute's gateway), with audit actions `subscription.canceled|resumed|repriced` and `dispute.evidence_submitted`. The refund, retry and resolve handlers accept `{ dryRun: true }`, and refund takes a `note`.
|
|
18
|
+
- `serveConsoleRoute`, `CONSOLE_ROUTES`, `createConsoleActions` and `consoleCapabilities` (from `@adonis-agora/payments/dashboard`) are the one core the console API, its dev tools and the commands go through. `ProviderCapabilities` gains `updateSubscription`.
|
|
19
|
+
|
|
3
20
|
## 1.0.0-rc.11
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/dist/commands/main.d.ts
CHANGED
|
@@ -1,19 +1,39 @@
|
|
|
1
1
|
import { ListLoader } from '@adonisjs/core/ace';
|
|
2
2
|
import AgoraDoctor from './agora_doctor.js';
|
|
3
3
|
import MakeBillable from './make_billable.js';
|
|
4
|
+
import PaymentsAuditList from './payments_audit_list.js';
|
|
5
|
+
import PaymentsCustomersList from './payments_customers_list.js';
|
|
6
|
+
import PaymentsDisputesEvidence from './payments_disputes_evidence.js';
|
|
7
|
+
import PaymentsDisputesList from './payments_disputes_list.js';
|
|
8
|
+
import PaymentsDisputesResolve from './payments_disputes_resolve.js';
|
|
4
9
|
import PaymentsHealth from './payments_health.js';
|
|
10
|
+
import PaymentsOrganizationsList from './payments_organizations_list.js';
|
|
11
|
+
import PaymentsOverview from './payments_overview.js';
|
|
12
|
+
import PaymentsPaymentsList from './payments_payments_list.js';
|
|
13
|
+
import PaymentsPaymentsRefund from './payments_payments_refund.js';
|
|
14
|
+
import PaymentsPaymentsShow from './payments_payments_show.js';
|
|
15
|
+
import PaymentsProvidersList from './payments_providers_list.js';
|
|
5
16
|
import PaymentsRenew from './payments_renew.js';
|
|
17
|
+
import PaymentsSubscriptionsCancel from './payments_subscriptions_cancel.js';
|
|
18
|
+
import PaymentsSubscriptionsList from './payments_subscriptions_list.js';
|
|
19
|
+
import PaymentsSubscriptionsReprice from './payments_subscriptions_reprice.js';
|
|
20
|
+
import PaymentsSubscriptionsResume from './payments_subscriptions_resume.js';
|
|
21
|
+
import PaymentsSubscriptionsShow from './payments_subscriptions_show.js';
|
|
6
22
|
import PaymentsSync from './payments_sync.js';
|
|
7
23
|
import PaymentsWebhook from './payments_webhook.js';
|
|
24
|
+
import PaymentsWebhookEventsList from './payments_webhook_events_list.js';
|
|
25
|
+
import PaymentsWebhookEventsRetry from './payments_webhook_events_retry.js';
|
|
8
26
|
/**
|
|
9
27
|
* The commands barrel for `@adonis-agora/payments`. Registered in an app's `adonisrc` via
|
|
10
28
|
* `rcFile.addCommand('@adonis-agora/payments/commands')` (done by this package's
|
|
11
29
|
* `configure`). The ace kernel imports this module and treats it as a commands loader: a
|
|
12
30
|
* {@link ListLoader} over the payments commands (`make:billable`, `make:webhook-handler`,
|
|
13
|
-
* `payments:webhook`, `payments:sync`, `payments:renew`, `payments:health`,
|
|
31
|
+
* `payments:webhook`, `payments:sync`, `payments:renew`, `payments:health`, `agora:doctor`,
|
|
32
|
+
* `payments:doctor`, and the console's operator commands `payments:<noun>:<verb>`) provides their
|
|
33
|
+
* metadata and constructors.
|
|
14
34
|
*/
|
|
15
|
-
declare const loader: ListLoader<typeof AgoraDoctor | typeof MakeBillable | typeof PaymentsHealth | typeof PaymentsRenew | typeof PaymentsSync | typeof PaymentsWebhook>;
|
|
35
|
+
declare const loader: ListLoader<typeof AgoraDoctor | typeof MakeBillable | typeof PaymentsAuditList | typeof PaymentsCustomersList | typeof PaymentsDisputesEvidence | typeof PaymentsDisputesList | typeof PaymentsDisputesResolve | typeof PaymentsHealth | typeof PaymentsOrganizationsList | typeof PaymentsOverview | typeof PaymentsPaymentsList | typeof PaymentsPaymentsRefund | typeof PaymentsPaymentsShow | typeof PaymentsProvidersList | typeof PaymentsRenew | typeof PaymentsSubscriptionsCancel | typeof PaymentsSubscriptionsList | typeof PaymentsSubscriptionsReprice | typeof PaymentsSubscriptionsResume | typeof PaymentsSubscriptionsShow | typeof PaymentsSync | typeof PaymentsWebhook | typeof PaymentsWebhookEventsList | typeof PaymentsWebhookEventsRetry>;
|
|
16
36
|
export declare const getMetaData: () => Promise<import("@adonisjs/core/types/ace").CommandMetaData[]>;
|
|
17
|
-
export declare const getCommand: (metaData: import("@adonisjs/core/types/ace").CommandMetaData) => Promise<typeof AgoraDoctor | typeof MakeBillable | typeof PaymentsHealth | typeof PaymentsRenew | typeof PaymentsSync | typeof PaymentsWebhook | null>;
|
|
37
|
+
export declare const getCommand: (metaData: import("@adonisjs/core/types/ace").CommandMetaData) => Promise<typeof AgoraDoctor | typeof MakeBillable | typeof PaymentsAuditList | typeof PaymentsCustomersList | typeof PaymentsDisputesEvidence | typeof PaymentsDisputesList | typeof PaymentsDisputesResolve | typeof PaymentsHealth | typeof PaymentsOrganizationsList | typeof PaymentsOverview | typeof PaymentsPaymentsList | typeof PaymentsPaymentsRefund | typeof PaymentsPaymentsShow | typeof PaymentsProvidersList | typeof PaymentsRenew | typeof PaymentsSubscriptionsCancel | typeof PaymentsSubscriptionsList | typeof PaymentsSubscriptionsReprice | typeof PaymentsSubscriptionsResume | typeof PaymentsSubscriptionsShow | typeof PaymentsSync | typeof PaymentsWebhook | typeof PaymentsWebhookEventsList | typeof PaymentsWebhookEventsRetry | null>;
|
|
18
38
|
export default loader;
|
|
19
39
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../commands/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,YAAY,MAAM,oBAAoB,CAAC;
|
|
1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CAAC;eAE1C,MAAM"}
|
package/dist/commands/main.js
CHANGED
|
@@ -2,17 +2,37 @@ import { ListLoader } from '@adonisjs/core/ace';
|
|
|
2
2
|
import AgoraDoctor from './agora_doctor.js';
|
|
3
3
|
import MakeBillable from './make_billable.js';
|
|
4
4
|
import MakeWebhookHandler from './make_webhook_handler.js';
|
|
5
|
+
import PaymentsAuditList from './payments_audit_list.js';
|
|
6
|
+
import PaymentsCustomersList from './payments_customers_list.js';
|
|
7
|
+
import PaymentsDisputesEvidence from './payments_disputes_evidence.js';
|
|
8
|
+
import PaymentsDisputesList from './payments_disputes_list.js';
|
|
9
|
+
import PaymentsDisputesResolve from './payments_disputes_resolve.js';
|
|
5
10
|
import PaymentsDoctor from './payments_doctor.js';
|
|
6
11
|
import PaymentsHealth from './payments_health.js';
|
|
12
|
+
import PaymentsOrganizationsList from './payments_organizations_list.js';
|
|
13
|
+
import PaymentsOverview from './payments_overview.js';
|
|
14
|
+
import PaymentsPaymentsList from './payments_payments_list.js';
|
|
15
|
+
import PaymentsPaymentsRefund from './payments_payments_refund.js';
|
|
16
|
+
import PaymentsPaymentsShow from './payments_payments_show.js';
|
|
17
|
+
import PaymentsProvidersList from './payments_providers_list.js';
|
|
7
18
|
import PaymentsRenew from './payments_renew.js';
|
|
19
|
+
import PaymentsSubscriptionsCancel from './payments_subscriptions_cancel.js';
|
|
20
|
+
import PaymentsSubscriptionsList from './payments_subscriptions_list.js';
|
|
21
|
+
import PaymentsSubscriptionsReprice from './payments_subscriptions_reprice.js';
|
|
22
|
+
import PaymentsSubscriptionsResume from './payments_subscriptions_resume.js';
|
|
23
|
+
import PaymentsSubscriptionsShow from './payments_subscriptions_show.js';
|
|
8
24
|
import PaymentsSync from './payments_sync.js';
|
|
9
25
|
import PaymentsWebhook from './payments_webhook.js';
|
|
26
|
+
import PaymentsWebhookEventsList from './payments_webhook_events_list.js';
|
|
27
|
+
import PaymentsWebhookEventsRetry from './payments_webhook_events_retry.js';
|
|
10
28
|
/**
|
|
11
29
|
* The commands barrel for `@adonis-agora/payments`. Registered in an app's `adonisrc` via
|
|
12
30
|
* `rcFile.addCommand('@adonis-agora/payments/commands')` (done by this package's
|
|
13
31
|
* `configure`). The ace kernel imports this module and treats it as a commands loader: a
|
|
14
32
|
* {@link ListLoader} over the payments commands (`make:billable`, `make:webhook-handler`,
|
|
15
|
-
* `payments:webhook`, `payments:sync`, `payments:renew`, `payments:health`,
|
|
33
|
+
* `payments:webhook`, `payments:sync`, `payments:renew`, `payments:health`, `agora:doctor`,
|
|
34
|
+
* `payments:doctor`, and the console's operator commands `payments:<noun>:<verb>`) provides their
|
|
35
|
+
* metadata and constructors.
|
|
16
36
|
*/
|
|
17
37
|
const loader = new ListLoader([
|
|
18
38
|
MakeBillable,
|
|
@@ -23,6 +43,24 @@ const loader = new ListLoader([
|
|
|
23
43
|
PaymentsHealth,
|
|
24
44
|
AgoraDoctor,
|
|
25
45
|
PaymentsDoctor,
|
|
46
|
+
PaymentsOverview,
|
|
47
|
+
PaymentsPaymentsList,
|
|
48
|
+
PaymentsPaymentsShow,
|
|
49
|
+
PaymentsPaymentsRefund,
|
|
50
|
+
PaymentsSubscriptionsList,
|
|
51
|
+
PaymentsSubscriptionsShow,
|
|
52
|
+
PaymentsSubscriptionsCancel,
|
|
53
|
+
PaymentsSubscriptionsResume,
|
|
54
|
+
PaymentsSubscriptionsReprice,
|
|
55
|
+
PaymentsCustomersList,
|
|
56
|
+
PaymentsDisputesList,
|
|
57
|
+
PaymentsDisputesResolve,
|
|
58
|
+
PaymentsDisputesEvidence,
|
|
59
|
+
PaymentsWebhookEventsList,
|
|
60
|
+
PaymentsWebhookEventsRetry,
|
|
61
|
+
PaymentsAuditList,
|
|
62
|
+
PaymentsProvidersList,
|
|
63
|
+
PaymentsOrganizationsList,
|
|
26
64
|
]);
|
|
27
65
|
export const getMetaData = loader.getMetaData.bind(loader);
|
|
28
66
|
export const getCommand = loader.getCommand.bind(loader);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../commands/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,kBAAkB,MAAM,2BAA2B,CAAC;AAC3D,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,eAAe,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../commands/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,kBAAkB,MAAM,2BAA2B,CAAC;AAC3D,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AACzD,OAAO,qBAAqB,MAAM,8BAA8B,CAAC;AACjE,OAAO,wBAAwB,MAAM,iCAAiC,CAAC;AACvE,OAAO,oBAAoB,MAAM,6BAA6B,CAAC;AAC/D,OAAO,uBAAuB,MAAM,gCAAgC,CAAC;AACrE,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,yBAAyB,MAAM,kCAAkC,CAAC;AACzE,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,oBAAoB,MAAM,6BAA6B,CAAC;AAC/D,OAAO,sBAAsB,MAAM,+BAA+B,CAAC;AACnE,OAAO,oBAAoB,MAAM,6BAA6B,CAAC;AAC/D,OAAO,qBAAqB,MAAM,8BAA8B,CAAC;AACjE,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,2BAA2B,MAAM,oCAAoC,CAAC;AAC7E,OAAO,yBAAyB,MAAM,kCAAkC,CAAC;AACzE,OAAO,4BAA4B,MAAM,qCAAqC,CAAC;AAC/E,OAAO,2BAA2B,MAAM,oCAAoC,CAAC;AAC7E,OAAO,yBAAyB,MAAM,kCAAkC,CAAC;AACzE,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,eAAe,MAAM,uBAAuB,CAAC;AACpD,OAAO,yBAAyB,MAAM,mCAAmC,CAAC;AAC1E,OAAO,0BAA0B,MAAM,oCAAoC,CAAC;AAE5E;;;;;;;;GAQG;AACH,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC;IAC5B,YAAY;IACZ,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,aAAa;IACb,cAAc;IACd,WAAW;IACX,cAAc;IACd,gBAAgB;IAChB,oBAAoB;IACpB,oBAAoB;IACpB,sBAAsB;IACtB,yBAAyB;IACzB,yBAAyB;IACzB,2BAA2B;IAC3B,2BAA2B;IAC3B,4BAA4B;IAC5B,qBAAqB;IACrB,oBAAoB;IACpB,uBAAuB;IACvB,wBAAwB;IACxB,yBAAyB;IACzB,0BAA0B;IAC1B,iBAAiB;IACjB,qBAAqB;IACrB,yBAAyB;CAC1B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PaymentsConsoleCommand } from '../src/cli/console_command.js';
|
|
2
|
+
/** `node ace payments:audit:list` — the billing audit trail: who refunded, resolved, retried… */
|
|
3
|
+
export default class PaymentsAuditList extends PaymentsConsoleCommand {
|
|
4
|
+
static commandName: string;
|
|
5
|
+
static description: string;
|
|
6
|
+
action?: string;
|
|
7
|
+
actor?: string;
|
|
8
|
+
provider?: string;
|
|
9
|
+
subjectType?: string;
|
|
10
|
+
subjectId?: string;
|
|
11
|
+
page?: number;
|
|
12
|
+
size?: number;
|
|
13
|
+
protected handle(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=payments_audit_list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments_audit_list.d.ts","sourceRoot":"","sources":["../../commands/payments_audit_list.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAG9E,iGAAiG;AACjG,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,sBAAsB;IACnE,OAAgB,WAAW,SAAyB;IACpD,OAAgB,WAAW,SACoE;IAGvF,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,MAAM,CAAC;IAEtB,UAAgB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAqBtC;CACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { flags } from '@adonisjs/core/ace';
|
|
8
|
+
import { money, PaymentsConsoleCommand } from '../src/cli/console_command.js';
|
|
9
|
+
import { CONSOLE_ROUTES } from '../src/dashboard/api_core.js';
|
|
10
|
+
/** `node ace payments:audit:list` — the billing audit trail: who refunded, resolved, retried… */
|
|
11
|
+
export default class PaymentsAuditList extends PaymentsConsoleCommand {
|
|
12
|
+
static commandName = 'payments:audit:list';
|
|
13
|
+
static description = 'List the billing audit trail: refunds, dispute resolutions, retries and refused deliveries';
|
|
14
|
+
async handle() {
|
|
15
|
+
const query = this.listQuery({
|
|
16
|
+
action: this.action,
|
|
17
|
+
actor: this.actor,
|
|
18
|
+
provider: this.provider,
|
|
19
|
+
subjectType: this.subjectType,
|
|
20
|
+
subjectId: this.subjectId,
|
|
21
|
+
}, { page: this.page, size: this.size });
|
|
22
|
+
const body = this.bodyOf(await this.serve(CONSOLE_ROUTES.audit, { query }));
|
|
23
|
+
this.printList(body, [
|
|
24
|
+
['action', (r) => r.action],
|
|
25
|
+
['actor', (r) => r.actor ?? 'unattributed'],
|
|
26
|
+
['subject', (r) => (r.subjectType !== null ? `${r.subjectType}:${r.subjectId}` : null)],
|
|
27
|
+
['provider', (r) => r.provider],
|
|
28
|
+
['amount', (r) => money(r.amount, r.currency)],
|
|
29
|
+
['message', (r) => r.message],
|
|
30
|
+
['at', (r) => r.createdAt],
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
__decorate([
|
|
35
|
+
flags.string({ description: 'Action, e.g. payment.refunded, webhook.rejected' })
|
|
36
|
+
], PaymentsAuditList.prototype, "action", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
flags.string({ description: 'Who did it (exact), e.g. cli:deploy' })
|
|
39
|
+
], PaymentsAuditList.prototype, "actor", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
flags.string({ description: 'Gateway name, e.g. stripe, asaas' })
|
|
42
|
+
], PaymentsAuditList.prototype, "provider", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
flags.string({ description: 'Subject type: payment, dispute, subscription, webhook…' })
|
|
45
|
+
], PaymentsAuditList.prototype, "subjectType", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
flags.string({ description: 'Subject id (exact)' })
|
|
48
|
+
], PaymentsAuditList.prototype, "subjectId", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
flags.number({ description: 'Page number, 1-based' })
|
|
51
|
+
], PaymentsAuditList.prototype, "page", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
flags.number({ description: 'Rows per page (default 50, at most 200)' })
|
|
54
|
+
], PaymentsAuditList.prototype, "size", void 0);
|
|
55
|
+
//# sourceMappingURL=payments_audit_list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments_audit_list.js","sourceRoot":"","sources":["../../commands/payments_audit_list.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,iGAAiG;AACjG,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,sBAAsB;IACnE,MAAM,CAAU,WAAW,GAAG,qBAAqB,CAAC;IACpD,MAAM,CAAU,WAAW,GACzB,4FAA4F,CAAC;IAuBrF,KAAK,CAAC,MAAM;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAC1B;YACE,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,EACD,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI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AE,CAAC;mDACxC;AAGlB;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,wDAAwD,EAAE,CAAC;sDAC3D;AAGrB;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;oDACzB;AAGnB;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;+CAChC;AAGd;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;+CACnD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PaymentsConsoleCommand } from '../src/cli/console_command.js';
|
|
2
|
+
/** `node ace payments:customers:list` — the gateway-customer → app-owner mapping. */
|
|
3
|
+
export default class PaymentsCustomersList extends PaymentsConsoleCommand {
|
|
4
|
+
static commandName: string;
|
|
5
|
+
static description: string;
|
|
6
|
+
provider?: string;
|
|
7
|
+
ownerType?: string;
|
|
8
|
+
ownerId?: string;
|
|
9
|
+
gatewayId?: string;
|
|
10
|
+
page?: number;
|
|
11
|
+
size?: number;
|
|
12
|
+
protected handle(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=payments_customers_list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments_customers_list.d.ts","sourceRoot":"","sources":["../../commands/payments_customers_list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAGvE,qFAAqF;AACrF,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,sBAAsB;IACvE,OAAgB,WAAW,SAA6B;IACxD,OAAgB,WAAW,SACkD;IAGrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,MAAM,CAAC;IAEtB,UAAgB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAmBtC;CACF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { flags } from '@adonisjs/core/ace';
|
|
8
|
+
import { PaymentsConsoleCommand } from '../src/cli/console_command.js';
|
|
9
|
+
import { CONSOLE_ROUTES } from '../src/dashboard/api_core.js';
|
|
10
|
+
/** `node ace payments:customers:list` — the gateway-customer → app-owner mapping. */
|
|
11
|
+
export default class PaymentsCustomersList extends PaymentsConsoleCommand {
|
|
12
|
+
static commandName = 'payments:customers:list';
|
|
13
|
+
static description = 'List billing customers: which app owner each gateway customer belongs to';
|
|
14
|
+
async handle() {
|
|
15
|
+
const query = this.listQuery({
|
|
16
|
+
provider: this.provider,
|
|
17
|
+
ownerType: this.ownerType,
|
|
18
|
+
ownerId: this.ownerId,
|
|
19
|
+
gatewayId: this.gatewayId,
|
|
20
|
+
}, { page: this.page, size: this.size });
|
|
21
|
+
const body = this.bodyOf(await this.serve(CONSOLE_ROUTES.customers, { query }));
|
|
22
|
+
this.printList(body, [
|
|
23
|
+
['gateway id', (r) => r.gatewayId],
|
|
24
|
+
['provider', (r) => r.provider],
|
|
25
|
+
['owner', (r) => (r.ownerType !== null ? `${r.ownerType}:${r.ownerId}` : null)],
|
|
26
|
+
['email', (r) => r.email],
|
|
27
|
+
['name', (r) => r.name],
|
|
28
|
+
['created', (r) => r.createdAt],
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
__decorate([
|
|
33
|
+
flags.string({ description: 'Gateway name, e.g. stripe, asaas' })
|
|
34
|
+
], PaymentsCustomersList.prototype, "provider", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
flags.string({ description: 'Owner type, e.g. user, organization' })
|
|
37
|
+
], PaymentsCustomersList.prototype, "ownerType", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
flags.string({ description: 'Owner id (pair it with --owner-type)' })
|
|
40
|
+
], PaymentsCustomersList.prototype, "ownerId", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
flags.string({ description: 'Gateway customer id (exact)' })
|
|
43
|
+
], PaymentsCustomersList.prototype, "gatewayId", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
flags.number({ description: 'Page number, 1-based' })
|
|
46
|
+
], PaymentsCustomersList.prototype, "page", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
flags.number({ description: 'Rows per page (default 50, at most 200)' })
|
|
49
|
+
], PaymentsCustomersList.prototype, "size", void 0);
|
|
50
|
+
//# sourceMappingURL=payments_customers_list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments_customers_list.js","sourceRoot":"","sources":["../../commands/payments_customers_list.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,qFAAqF;AACrF,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,sBAAsB;IACvE,MAAM,CAAU,WAAW,GAAG,yBAAyB,CAAC;IACxD,MAAM,CAAU,WAAW,GACzB,0EAA0E,CAAC;IAoBnE,KAAK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,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;wDAC1C;AAGnB;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;sDAC7C;AAGjB;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;wDAClC;AAGnB;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;mDAChC;AAGd;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;mDACnD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PaymentsActionCommand } from '../src/cli/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace payments:disputes:evidence <gatewayId> --file=evidence.json` — submit evidence for an
|
|
4
|
+
* open dispute through its gateway (a representment). MOST GATEWAYS ACCEPT IT ONCE: asks for
|
|
5
|
+
* confirmation unless `--force`; `--dry-run` checks everything and sends nothing.
|
|
6
|
+
*
|
|
7
|
+
* `--file` is a JSON `DisputeEvidence` (`explanation`, `documents: [{ kind, id }]` of files already
|
|
8
|
+
* uploaded to the gateway, `priorUndisputedPayments`, …); `--explanation` sets or overrides the
|
|
9
|
+
* free-text explanation.
|
|
10
|
+
*/
|
|
11
|
+
export default class PaymentsDisputesEvidence extends PaymentsActionCommand {
|
|
12
|
+
static commandName: string;
|
|
13
|
+
static description: string;
|
|
14
|
+
gatewayId: string;
|
|
15
|
+
file?: string;
|
|
16
|
+
explanation?: string;
|
|
17
|
+
protected handle(): Promise<void>;
|
|
18
|
+
private readEvidence;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=payments_disputes_evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments_disputes_evidence.d.ts","sourceRoot":"","sources":["../../commands/payments_disputes_evidence.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAGhF;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,qBAAqB;IACzE,OAAgB,WAAW,SAAgC;IAC3D,OAAgB,WAAW,SACuD;IAG1E,SAAS,EAAE,MAAM,CAAC;IAGlB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,WAAW,CAAC,EAAE,MAAM,CAAC;IAE7B,UAAgB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAoBtC;YAEa,YAAY;CAuB3B"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { readFile } from 'node:fs/promises';
|
|
8
|
+
import { args, flags } from '@adonisjs/core/ace';
|
|
9
|
+
import { CliError, PaymentsActionCommand } from '../src/cli/console_command.js';
|
|
10
|
+
import { CONSOLE_ROUTES } from '../src/dashboard/api_core.js';
|
|
11
|
+
/**
|
|
12
|
+
* `node ace payments:disputes:evidence <gatewayId> --file=evidence.json` — submit evidence for an
|
|
13
|
+
* open dispute through its gateway (a representment). MOST GATEWAYS ACCEPT IT ONCE: asks for
|
|
14
|
+
* confirmation unless `--force`; `--dry-run` checks everything and sends nothing.
|
|
15
|
+
*
|
|
16
|
+
* `--file` is a JSON `DisputeEvidence` (`explanation`, `documents: [{ kind, id }]` of files already
|
|
17
|
+
* uploaded to the gateway, `priorUndisputedPayments`, …); `--explanation` sets or overrides the
|
|
18
|
+
* free-text explanation.
|
|
19
|
+
*/
|
|
20
|
+
export default class PaymentsDisputesEvidence extends PaymentsActionCommand {
|
|
21
|
+
static commandName = 'payments:disputes:evidence';
|
|
22
|
+
static description = 'Submit evidence for an open dispute through its gateway (most accept it once)';
|
|
23
|
+
async handle() {
|
|
24
|
+
const evidence = await this.readEvidence();
|
|
25
|
+
const req = {
|
|
26
|
+
params: { gatewayId: this.gatewayId },
|
|
27
|
+
body: { evidence, ...this.noteBody() },
|
|
28
|
+
};
|
|
29
|
+
const preview = await this.preview(CONSOLE_ROUTES.evidence, req, (dry) => {
|
|
30
|
+
const d = dry.dispute;
|
|
31
|
+
const fields = dry.evidence.fields;
|
|
32
|
+
return `Submit evidence (${fields.join(', ')}) for ${d.status} dispute ${this.gatewayId} to ${d.provider}. Most gateways accept evidence ONCE.`;
|
|
33
|
+
});
|
|
34
|
+
if (preview === null)
|
|
35
|
+
return;
|
|
36
|
+
const body = this.bodyOf(await this.serve(CONSOLE_ROUTES.evidence, req));
|
|
37
|
+
if (this.json)
|
|
38
|
+
return this.printJson(body);
|
|
39
|
+
const dispute = body.dispute;
|
|
40
|
+
this.logger.success(`Evidence submitted for dispute ${this.gatewayId} (gateway status: ${dispute.gatewayStatus}).`);
|
|
41
|
+
this.logger.info(String(body.note));
|
|
42
|
+
}
|
|
43
|
+
async readEvidence() {
|
|
44
|
+
let evidence = {};
|
|
45
|
+
if (this.file !== undefined) {
|
|
46
|
+
let raw;
|
|
47
|
+
try {
|
|
48
|
+
raw = await readFile(this.file, 'utf8');
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
throw new CliError(`Cannot read ${this.file}: ${error instanceof Error ? error.message : String(error)}`);
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
evidence = JSON.parse(raw);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
throw new CliError(`${this.file} is not valid JSON.`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (this.explanation !== undefined)
|
|
61
|
+
evidence = { ...evidence, explanation: this.explanation };
|
|
62
|
+
if (this.file === undefined && this.explanation === undefined) {
|
|
63
|
+
throw new CliError('Give the evidence with --file=<evidence.json> and/or --explanation.');
|
|
64
|
+
}
|
|
65
|
+
return evidence;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
__decorate([
|
|
69
|
+
args.string({ description: 'Gateway dispute id' })
|
|
70
|
+
], PaymentsDisputesEvidence.prototype, "gatewayId", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
flags.string({ description: 'Path to a JSON file with the evidence (DisputeEvidence)' })
|
|
73
|
+
], PaymentsDisputesEvidence.prototype, "file", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
flags.string({ description: 'Free-text explanation (sets or overrides the file one)' })
|
|
76
|
+
], PaymentsDisputesEvidence.prototype, "explanation", void 0);
|
|
77
|
+
//# sourceMappingURL=payments_disputes_evidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments_disputes_evidence.js","sourceRoot":"","sources":["../../commands/payments_disputes_evidence.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,qBAAqB;IACzE,MAAM,CAAU,WAAW,GAAG,4BAA4B,CAAC;IAC3D,MAAM,CAAU,WAAW,GACzB,+EAA+E,CAAC;IAWxE,KAAK,CAAC,MAAM;QACpB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QAC3C,MAAM,GAAG,GAAG;YACV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,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAC1C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,QAAQ,CAChB,eAAe,IAAI,CAAC,IAAI,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACtF,CAAC;YACJ,CAAC;YACD,IAAI,CAAC;gBACH,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA4B,CAAC;YACxD,CAAC;YAAC,MAAM,CAAC;gBACP,MAAM,IAAI,QAAQ,CAAC,GAAG,IAAI,CAAC,IAAI,qBAAqB,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;QACD,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS;YAAE,QAAQ,GAAG,EAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;QAC9F,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9D,MAAM,IAAI,QAAQ,CAAC,qEAAqE,CAAC,CAAC;QAC5F,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AArDS;IADP,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;2DACzB;AAGlB;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;sDACnE;AAGd;IADP,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,wDAAwD,EAAE,CAAC;6DAC3D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PaymentsConsoleCommand } from '../src/cli/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace payments:disputes:list` — chargebacks, newest first; `--due-within=<hours>` lists only
|
|
4
|
+
* the OPEN ones whose evidence window closes within that many hours, soonest first.
|
|
5
|
+
*/
|
|
6
|
+
export default class PaymentsDisputesList extends PaymentsConsoleCommand {
|
|
7
|
+
static commandName: string;
|
|
8
|
+
static description: string;
|
|
9
|
+
status?: string;
|
|
10
|
+
provider?: string;
|
|
11
|
+
dueWithin?: number;
|
|
12
|
+
page?: number;
|
|
13
|
+
size?: number;
|
|
14
|
+
protected handle(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=payments_disputes_list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments_disputes_list.d.ts","sourceRoot":"","sources":["../../commands/payments_disputes_list.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAG9E;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,sBAAsB;IACtE,OAAgB,WAAW,SAA4B;IACvD,OAAgB,WAAW,SAC2D;IAG9E,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,IAAI,CAAC,EAAE,MAAM,CAAC;IAEtB,UAAgB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAiBtC;CACF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { flags } from '@adonisjs/core/ace';
|
|
8
|
+
import { money, PaymentsConsoleCommand } from '../src/cli/console_command.js';
|
|
9
|
+
import { CONSOLE_ROUTES } from '../src/dashboard/api_core.js';
|
|
10
|
+
/**
|
|
11
|
+
* `node ace payments:disputes:list` — chargebacks, newest first; `--due-within=<hours>` lists only
|
|
12
|
+
* the OPEN ones whose evidence window closes within that many hours, soonest first.
|
|
13
|
+
*/
|
|
14
|
+
export default class PaymentsDisputesList extends PaymentsConsoleCommand {
|
|
15
|
+
static commandName = 'payments:disputes:list';
|
|
16
|
+
static description = 'List disputes; --due-within=<hours> for the open evidence windows closing soonest';
|
|
17
|
+
async handle() {
|
|
18
|
+
const query = this.listQuery({ status: this.status, provider: this.provider, dueWithin: this.dueWithin }, { page: this.page, size: this.size });
|
|
19
|
+
const body = this.bodyOf(await this.serve(CONSOLE_ROUTES.disputes, { query }));
|
|
20
|
+
this.printList(body, [
|
|
21
|
+
['gateway id', (r) => r.gatewayId],
|
|
22
|
+
['payment', (r) => r.paymentGatewayId],
|
|
23
|
+
['provider', (r) => r.provider],
|
|
24
|
+
['status', (r) => r.status],
|
|
25
|
+
['amount', (r) => money(r.amount, r.currency)],
|
|
26
|
+
['reason', (r) => r.reason],
|
|
27
|
+
// `null` is "the gateway sent no deadline", never "no hurry".
|
|
28
|
+
['evidence due', (r) => r.evidenceDueBy ?? 'no deadline given'],
|
|
29
|
+
['opened', (r) => r.openedAt],
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
__decorate([
|
|
34
|
+
flags.string({ description: 'Dispute status (warning, open, under_review, lost, won…)' })
|
|
35
|
+
], PaymentsDisputesList.prototype, "status", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
flags.string({ description: 'Gateway name, e.g. stripe, asaas' })
|
|
38
|
+
], PaymentsDisputesList.prototype, "provider", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
flags.number({ description: 'Only open disputes whose evidence is due within these hours' })
|
|
41
|
+
], PaymentsDisputesList.prototype, "dueWithin", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
flags.number({ description: 'Page number, 1-based' })
|
|
44
|
+
], PaymentsDisputesList.prototype, "page", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
flags.number({ description: 'Rows per page (default 50, at most 200)' })
|
|
47
|
+
], PaymentsDisputesList.prototype, "size", void 0);
|
|
48
|
+
//# sourceMappingURL=payments_disputes_list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments_disputes_list.js","sourceRoot":"","sources":["../../commands/payments_disputes_list.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,sBAAsB;IACtE,MAAM,CAAU,WAAW,GAAG,wBAAwB,CAAC;IACvD,MAAM,CAAU,WAAW,GACzB,mFAAmF,CAAC;IAiB5E,KAAK,CAAC,MAAM;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAC1B,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,EAC3E,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CACrC,CAAC;QACF,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC,S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Command } from '../src/cli/console_command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace payments:disputes:resolve <gatewayId> --status=<lost|won|…>` — record how a dispute
|
|
4
|
+
* ENDED at the gateway (for gateways that never send a closing event). Sends nothing to the
|
|
5
|
+
* gateway. Asks for confirmation unless `--force`; `--dry-run` records nothing.
|
|
6
|
+
*/
|
|
7
|
+
export default class PaymentsDisputesResolve extends PaymentsActionCommand {
|
|
8
|
+
static commandName: string;
|
|
9
|
+
static description: string;
|
|
10
|
+
gatewayId: string;
|
|
11
|
+
status: string;
|
|
12
|
+
outcome?: string;
|
|
13
|
+
protected handle(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=payments_disputes_resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments_disputes_resolve.d.ts","sourceRoot":"","sources":["../../commands/payments_disputes_resolve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAItE;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,qBAAqB;IACxE,OAAgB,WAAW,SAA+B;IAC1D,OAAgB,WAAW,SACkD;IAGrE,SAAS,EAAE,MAAM,CAAC;IAMlB,MAAM,EAAE,MAAM,CAAC;IAGf,OAAO,CAAC,EAAE,MAAM,CAAC;IAEzB,UAAgB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAmBtC;CACF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { args, flags } from '@adonisjs/core/ace';
|
|
8
|
+
import { PaymentsActionCommand } from '../src/cli/console_command.js';
|
|
9
|
+
import { CONSOLE_ROUTES } from '../src/dashboard/api_core.js';
|
|
10
|
+
import { DISPUTE_RESOLUTION_STATUSES } from '../src/dashboard/handlers.js';
|
|
11
|
+
/**
|
|
12
|
+
* `node ace payments:disputes:resolve <gatewayId> --status=<lost|won|…>` — record how a dispute
|
|
13
|
+
* ENDED at the gateway (for gateways that never send a closing event). Sends nothing to the
|
|
14
|
+
* gateway. Asks for confirmation unless `--force`; `--dry-run` records nothing.
|
|
15
|
+
*/
|
|
16
|
+
export default class PaymentsDisputesResolve extends PaymentsActionCommand {
|
|
17
|
+
static commandName = 'payments:disputes:resolve';
|
|
18
|
+
static description = 'Record how a dispute ended at the gateway (sends nothing to the gateway)';
|
|
19
|
+
async handle() {
|
|
20
|
+
const req = {
|
|
21
|
+
params: { gatewayId: this.gatewayId },
|
|
22
|
+
body: {
|
|
23
|
+
status: this.status,
|
|
24
|
+
...(this.outcome !== undefined ? { outcome: this.outcome } : {}),
|
|
25
|
+
...this.noteBody(),
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
const preview = await this.preview(CONSOLE_ROUTES.resolve, req, (dry) => {
|
|
29
|
+
const d = dry.dispute;
|
|
30
|
+
return `Close dispute ${this.gatewayId} locally: ${d.previousStatus} → ${d.status} (outcome ${d.outcome}).`;
|
|
31
|
+
});
|
|
32
|
+
if (preview === null)
|
|
33
|
+
return;
|
|
34
|
+
const body = this.bodyOf(await this.serve(CONSOLE_ROUTES.resolve, req));
|
|
35
|
+
if (this.json)
|
|
36
|
+
return this.printJson(body);
|
|
37
|
+
this.logger.success(`Dispute ${this.gatewayId} recorded as ${this.status}.`);
|
|
38
|
+
this.logger.info(String(body.note));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
__decorate([
|
|
42
|
+
args.string({ description: 'Gateway dispute id' })
|
|
43
|
+
], PaymentsDisputesResolve.prototype, "gatewayId", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
flags.string({
|
|
46
|
+
description: `How it ended: ${DISPUTE_RESOLUTION_STATUSES.join(', ')}`,
|
|
47
|
+
required: true,
|
|
48
|
+
})
|
|
49
|
+
], PaymentsDisputesResolve.prototype, "status", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
flags.string({ description: 'Outcome label (default: the status)' })
|
|
52
|
+
], PaymentsDisputesResolve.prototype, "outcome", void 0);
|
|
53
|
+
//# sourceMappingURL=payments_disputes_resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments_disputes_resolve.js","sourceRoot":"","sources":["../../commands/payments_disputes_resolve.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAE3E;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,qBAAqB;IACxE,MAAM,CAAU,WAAW,GAAG,2BAA2B,CAAC;IAC1D,MAAM,CAAU,WAAW,GACzB,0EAA0E,CAAC;IAcnE,KAAK,CAAC,MAAM;QACpB,MAAM,GAAG,GAAG;YACV,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE;YACrC,IAAI,EAAE;gBACJ,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE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command.js';
|
|
2
|
+
/**
|
|
3
|
+
* `node ace payments:organizations:list` — with organizations (tenancy) on, the organizations that
|
|
4
|
+
* own billing customers: the ids `--tenant` takes on the other `payments:*` commands.
|
|
5
|
+
*/
|
|
6
|
+
export default class PaymentsOrganizationsList extends PaymentsConsoleCommand {
|
|
7
|
+
static commandName: string;
|
|
8
|
+
static description: string;
|
|
9
|
+
protected handle(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=payments_organizations_list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payments_organizations_list.d.ts","sourceRoot":"","sources":["../../commands/payments_organizations_list.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAGjF;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,sBAAsB;IAC3E,OAAgB,WAAW,SAAiC;IAC5D,OAAgB,WAAW,SACoD;IAE/E,UAAgB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAwBtC;CACF"}
|