@adonis-agora/payments 1.0.0-rc.0 → 1.0.0-rc.2

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.
Files changed (79) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/assets/spa/assets/index-DeVNvGyC.js +10 -0
  3. package/dist/assets/spa/assets/index-DeVNvGyC.js.map +1 -0
  4. package/dist/assets/spa/index.html +1 -1
  5. package/dist/commands/agora_doctor.d.ts +23 -0
  6. package/dist/commands/agora_doctor.d.ts.map +1 -0
  7. package/dist/commands/agora_doctor.js +110 -0
  8. package/dist/commands/agora_doctor.js.map +1 -0
  9. package/dist/commands/main.d.ts +4 -3
  10. package/dist/commands/main.d.ts.map +1 -1
  11. package/dist/commands/main.js +5 -1
  12. package/dist/commands/main.js.map +1 -1
  13. package/dist/commands/payments_doctor.d.ts +8 -0
  14. package/dist/commands/payments_doctor.d.ts.map +1 -0
  15. package/dist/commands/payments_doctor.js +8 -0
  16. package/dist/commands/payments_doctor.js.map +1 -0
  17. package/dist/configure.d.ts.map +1 -1
  18. package/dist/configure.js +0 -1
  19. package/dist/configure.js.map +1 -1
  20. package/dist/providers/dashboard_provider.d.ts +25 -31
  21. package/dist/providers/dashboard_provider.d.ts.map +1 -1
  22. package/dist/providers/dashboard_provider.js +74 -169
  23. package/dist/providers/dashboard_provider.js.map +1 -1
  24. package/dist/providers/payments_provider.d.ts.map +1 -1
  25. package/dist/providers/payments_provider.js +4 -0
  26. package/dist/providers/payments_provider.js.map +1 -1
  27. package/dist/src/billing/billing_store.d.ts +2 -2
  28. package/dist/src/dashboard/access_denied_page.d.ts +5 -7
  29. package/dist/src/dashboard/access_denied_page.d.ts.map +1 -1
  30. package/dist/src/dashboard/access_denied_page.js +2 -6
  31. package/dist/src/dashboard/access_denied_page.js.map +1 -1
  32. package/dist/src/dashboard/console_authorize.d.ts +77 -0
  33. package/dist/src/dashboard/console_authorize.d.ts.map +1 -0
  34. package/dist/src/dashboard/console_authorize.js +104 -0
  35. package/dist/src/dashboard/console_authorize.js.map +1 -0
  36. package/dist/src/dashboard/define_config.d.ts +24 -49
  37. package/dist/src/dashboard/define_config.d.ts.map +1 -1
  38. package/dist/src/dashboard/define_config.js +1 -67
  39. package/dist/src/dashboard/define_config.js.map +1 -1
  40. package/dist/src/dashboard/handlers.d.ts +3 -5
  41. package/dist/src/dashboard/handlers.d.ts.map +1 -1
  42. package/dist/src/dashboard/handlers.js +2 -2
  43. package/dist/src/dashboard/handlers.js.map +1 -1
  44. package/dist/src/dashboard/index.d.ts +4 -7
  45. package/dist/src/dashboard/index.d.ts.map +1 -1
  46. package/dist/src/dashboard/index.js +2 -5
  47. package/dist/src/dashboard/index.js.map +1 -1
  48. package/dist/src/dashboard/spa.d.ts +2 -13
  49. package/dist/src/dashboard/spa.d.ts.map +1 -1
  50. package/dist/src/dashboard/spa.js +2 -4
  51. package/dist/src/dashboard/spa.js.map +1 -1
  52. package/dist/src/doctor/agora_doctor.d.ts +116 -0
  53. package/dist/src/doctor/agora_doctor.d.ts.map +1 -0
  54. package/dist/src/doctor/agora_doctor.js +685 -0
  55. package/dist/src/doctor/agora_doctor.js.map +1 -0
  56. package/dist/src/doctor/checks.d.ts +46 -0
  57. package/dist/src/doctor/checks.d.ts.map +1 -0
  58. package/dist/src/doctor/checks.js +254 -0
  59. package/dist/src/doctor/checks.js.map +1 -0
  60. package/dist/src/doctor/index.d.ts +9 -0
  61. package/dist/src/doctor/index.d.ts.map +1 -0
  62. package/dist/src/doctor/index.js +8 -0
  63. package/dist/src/doctor/index.js.map +1 -0
  64. package/dist/stubs/config/payments_dashboard.stub +12 -23
  65. package/package.json +9 -3
  66. package/dist/assets/spa/assets/index-CyiEHJ5F.js +0 -10
  67. package/dist/assets/spa/assets/index-CyiEHJ5F.js.map +0 -1
  68. package/dist/src/dashboard/auth.d.ts +0 -136
  69. package/dist/src/dashboard/auth.d.ts.map +0 -1
  70. package/dist/src/dashboard/auth.js +0 -152
  71. package/dist/src/dashboard/auth.js.map +0 -1
  72. package/dist/src/dashboard/login_page.d.ts +0 -36
  73. package/dist/src/dashboard/login_page.d.ts.map +0 -1
  74. package/dist/src/dashboard/login_page.js +0 -158
  75. package/dist/src/dashboard/login_page.js.map +0 -1
  76. package/dist/src/dashboard/session_cookie.d.ts +0 -42
  77. package/dist/src/dashboard/session_cookie.d.ts.map +0 -1
  78. package/dist/src/dashboard/session_cookie.js +0 -97
  79. package/dist/src/dashboard/session_cookie.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @adonis-agora/payments
2
2
 
3
+ ## 1.0.0-rc.2
4
+
5
+ ### Minor Changes
6
+
7
+ - [#224](https://github.com/DavideCarvalho/adonis-agora-payments/pull/224) [`2cc413d`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/2cc413d2889a40e6d6f4f443dad315043247be64) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - `node ace agora:doctor` (and `payments:doctor`). The commands barrel now ships the shared Agora health check, and the payments provider registers its checks into the `'agora.doctor'` registry: `payments.webhook-secret`, `payments.webhook-csrf`, `payments.console-gate`, and with `--deep` `payments.tables` and `payments.health` (the `payments:health` report). The new `@adonis-agora/payments/doctor` entry serves `--no-boot`.
8
+
9
+ ## 1.0.0-rc.1
10
+
11
+ ### Major Changes
12
+
13
+ - [#222](https://github.com/DavideCarvalho/adonis-agora-payments/pull/222) [`b57fa20`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/b57fa209cf7da05b6c26eebb8ced5341d85eaa67) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Dashboard `authorize` adopts the shared Agora console contract, and the console behaves like every other Agora console.
14
+
15
+ - `authorize` takes an inline function, an authorizer class (built through the container, so `@inject()` works), or a lazy import `() => import('#policies/console_access')`. An authorizer may answer `{ redirectTo }`: a `302` for page navigations, `401 { error: 'unauthenticated', redirectTo }` for API calls. A throw is a `403`.
16
+ - With `authorize` omitted the console is open outside production and answers every request with `403` in production, and the app logs one warning at boot: ``[@adonis-agora/payments] console has no `authorize` configured: it is open outside production and denies every request in production. Set `authorize` in config/payments_dashboard.ts.``
17
+ - `PAYMENTS_DASHBOARD_TOKEN` is removed, with the `x-payments-token` header and the `?token=` query param, and `defaultAuthorize` is no longer exported. For token access use the new `authorizeByToken({ token: env.get('CONSOLE_TOKEN') })`, which checks `Authorization: Bearer <token>` in constant time and answers `401` otherwise. An empty token throws when the config loads.
18
+ - API denials from `authorize` answer `{ error: 'forbidden' }` (`403`) or `{ error: 'unauthenticated' }` (`401`, was `'unauthorized'`).
19
+ - `dashboardAuth` is removed, with no alias: the built-in login page, `GET|POST <path>/login`, `POST <path>/session`, `GET <path>/logout`, the signed session cookie and its `login`/`session` hooks, and the exports `resolveDashboardAuth`, `performLogin`, `performSession`, `readSession`, `sanitizeReturnTo`, `SESSION_COOKIE_NAME`, `signSessionCookie`, `verifySessionCookie`, `renderLoginPage` and the types `DashboardAuthOptions`, `ResolvedDashboardAuth`, `AuthMode`, `LoginHook`, `LoginOutcome`, `SessionHook`, `SessionOutcome`, `DashboardSession`, `DashboardSessionUser`, `SignOptions`, `VerifyOptions`, `InjectedAuth`. Sign-in is your app's own: gate the console in `authorize` and return `{ redirectTo: '/login' }` for a signed-out visitor. `ResolvedPaymentsDashboardConfig` has no `dashboardAuth`, and the injected page config no `auth`.
20
+ - The console UI has no Sign out link. On a `401` from its API it follows the body's `redirectTo`, or reloads the console page so the server answers the navigation.
21
+ - Refunds and dispute resolutions are recorded against the app's signed-in user (`ctx.auth.user`'s `email`, `name` or `id`), `bearer` for a token caller, else unattributed.
22
+ - The access-denied page drops the `session-required` reason; `loginHref` is only what you pass in `accessDenied`.
23
+
24
+ Exported from `@adonis-agora/payments/dashboard`: `ConsoleAuthorize`, `ConsoleAuthorizer`, `ConsoleAuthorizerClass`, `ConsoleAuthorizeResult`, `resolveConsoleAuthorize`, `authorizeByToken`. `ResolvedPaymentsDashboardConfig['authorize']` is now `ConsoleAuthorize | null`. The payments client endpoint (`config/payments_client.ts`) and payment-driver tokens are unchanged.
25
+
3
26
  ## 1.0.0-rc.0
4
27
 
5
28
  ### Major Changes