cabloy 5.1.175 → 5.1.177

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 (22) hide show
  1. package/.cabloy-version +1 -1
  2. package/.claude/scheduled_tasks.lock +1 -1
  3. package/CHANGELOG.md +14 -0
  4. package/package.json +1 -1
  5. package/repo-docs/backend/menu-guide.md +37 -3
  6. package/repo-docs/fullstack/a-pay-payment-suite.md +31 -17
  7. package/zova/pnpm-lock.yaml +15382 -0
  8. package/zova/src/suite/a-commerce/modules/commerce-trade/package.json +3 -1
  9. package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/payment/controller.tsx +1 -1
  10. package/zova/src/suite/cabloy-basic/modules/basic-pay/package.json +60 -0
  11. package/zova/src/{suite-vendor/a-pay/modules/a-pay → suite/cabloy-basic/modules/basic-pay}/src/.metadata/component/paymentNextAction.ts +2 -2
  12. package/zova/src/suite/cabloy-basic/modules/basic-pay/src/.metadata/index.ts +68 -0
  13. package/zova/src/suite/cabloy-basic/modules/basic-pay/src/.metadata/this.ts +2 -0
  14. package/zova/src/{suite-vendor/a-pay/modules/a-pay → suite/cabloy-basic/modules/basic-pay}/src/component/paymentNextAction/controller.tsx +7 -19
  15. package/zova/src/suite/cabloy-basic/modules/basic-pay/src/index.ts +1 -0
  16. package/zova/src/suite/cabloy-basic/modules/basic-pay/tsconfig.build.json +13 -0
  17. package/zova/src/suite/cabloy-basic/modules/basic-pay/tsconfig.json +5 -0
  18. package/zova/src/suite/cabloy-basic/package.json +1 -0
  19. package/zova/src/suite-vendor/a-pay/modules/a-pay/package.json +1 -1
  20. package/zova/src/suite-vendor/a-pay/modules/a-pay/src/.metadata/index.ts +4 -46
  21. package/zova/src/suite-vendor/a-pay/modules/a-pay/src/types/payment.ts +13 -0
  22. package/zova/src/suite-vendor/a-pay/package.json +2 -2
package/.cabloy-version CHANGED
@@ -1 +1 @@
1
- 5.1.175
1
+ 5.1.177
@@ -1 +1 @@
1
- {"sessionId":"4dc366c1-f1a5-45c5-a2e1-5c89e5694587","pid":67516,"procStart":"Sat Sep 12 08:03:56 2026","acquiredAt":1789284193785}
1
+ {"sessionId":"6217847e-59ab-4e60-bb87-bbecdd19f760","pid":92862,"procStart":"Sat Sep 19 06:45:25 2026","acquiredAt":1789807599408}
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.1.177
4
+
5
+ ### Improvements
6
+
7
+ - Update the menu guide documentation.
8
+ - Refresh the pnpm lockfile.
9
+
10
+ ## 5.1.176
11
+
12
+ ### Improvements
13
+
14
+ - Refactor a-pay.
15
+ - Add a pnpm lockfile.
16
+
3
17
  ## 5.1.175
4
18
 
5
19
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cabloy",
3
- "version": "5.1.175",
3
+ "version": "5.1.177",
4
4
  "gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
5
5
  "description": "A Node.js fullstack framework",
6
6
  "keywords": [
@@ -55,9 +55,11 @@ This makes menu retrieval part of the broader backend contract surface.
55
55
 
56
56
  In the current repo implementation, the out-of-the-box menu controller is public and delegates directly to `this.scope.service.menu.retrieveMenus(publicPath)`.
57
57
 
58
- ## Static menu visibility
58
+ ## SSR Site targeting
59
59
 
60
- `@SsrMenu(...)` items can declare static role visibility without changing the public menu DTO:
60
+ `@SsrMenu(...)` and `@SsrMenuGroup(...)` use `site` to select the SSR Site onion(s) that receive the declaration. It is a navigation-composition filter, not a site-admission, role-visibility, or backend-authorization decision.
61
+
62
+ Use `site` for navigation owned by one SSR Site or deliberately exclusive to a known subset of sites:
61
63
 
62
64
  ```typescript
63
65
  @SsrMenu({
@@ -66,10 +68,41 @@ In the current repo implementation, the out-of-the-box menu controller is public
66
68
  link: 'presetResource',
67
69
  roles: ['systemAdmin'],
68
70
  },
69
- site: 'basic-siteadmin:admin',
71
+ // This Basic Admin-owned entry intentionally targets one SSR Site.
72
+ site: ['basic-siteadmin:admin'],
73
+ })
74
+ ```
75
+
76
+ For a shared module declaration intended for every compatible SSR Admin site, omit `site`:
77
+
78
+ ```typescript
79
+ @SsrMenu({
80
+ item: {
81
+ title: $locale('SharedOperations'),
82
+ link: 'presetResource',
83
+ roles: ['systemAdmin'],
84
+ },
85
+ // No `site`: the shared declaration is available to compatible SSR Admin sites.
70
86
  })
71
87
  ```
72
88
 
89
+ Do not bind a shared Admin menu or menu group to the current/default Admin site merely to keep a new independent site's navigation narrow. Isolate an independent site through its enabled module composition and site-owned menus/groups. When a shared capability needs genuinely different navigation contracts per site, use an explicit, approved site-specific composition or owner instead of narrowing the shared declaration by default.
90
+
91
+ `site` is distinct from a role's `siteIds`, menu `roles` or role-menu associations, and Passport/RBAC authorization:
92
+
93
+ ```text
94
+ site -> which SSR Site receives a menu/group declaration
95
+ siteIds -> which frontend Site a subject may enter
96
+ roles / role-menu -> which admitted subject may discover a menu leaf
97
+ Passport / RBAC -> which backend actions or data the subject may use
98
+ ```
99
+
100
+ See [Menu Authorization](/backend/menu-authorization) for the site-admission, navigation-disclosure, and backend-authority boundaries.
101
+
102
+ ## Static menu visibility
103
+
104
+ `@SsrMenu(...)` items can declare static role visibility without changing the public menu DTO:
105
+
73
106
  - Omit `roles` to make an item visible to anonymous and authenticated callers.
74
107
  - Use `roles: []` when an item has no static role visibility and is intended to be disclosed only through dynamic Role-menu configuration.
75
108
  - A nonempty `roles` array is visible when the current Passport has at least one matching role name; it can also be disclosed through dynamic Role-menu configuration.
@@ -107,5 +140,6 @@ When editing SSR menu behavior, ask:
107
140
  2. is there a default fallback menu that should remain available?
108
141
  3. does the menu contract belong in backend API design, frontend route design, or both?
109
142
  4. does the active edition affect the menu structure or public path assumptions?
143
+ 5. is this declaration site-owned or deliberately site-exclusive (specify `site`), or shared across compatible SSR Admin sites (omit `site`)?
110
144
 
111
145
  That helps AI keep menu behavior aligned with Cabloy’s shared SSR architecture.
@@ -1,6 +1,6 @@
1
1
  # A-Pay Payment Suite
2
2
 
3
- This guide explains the current payment architecture in Cabloy Basic across Vona, Zova, and the Commerce domain.
3
+ This guide explains the current payment architecture shared by Cabloy Basic and Cabloy Start across Vona, Zova, and the Commerce domain.
4
4
 
5
5
  It is a source-oriented architecture guide for:
6
6
 
@@ -50,12 +50,26 @@ zova/src/suite-vendor/a-pay/
50
50
 
51
51
  The general suite/module organization is described in [Suites and Modules](/fullstack/suites-and-modules). The payment suite follows the vendor-suite layout rather than being a complete user-facing page package.
52
52
 
53
- | Module | Vona responsibility | Zova responsibility |
54
- | ------------ | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
55
- | `a-pay` | Payment sessions, provider operations, callbacks, webhooks, normalized contracts, audit/outbox boundaries | Payment-session API/model, generated contracts, next-action component, redirect coordinator |
56
- | `pay-mock` | Deterministic development/test provider and simulator webhook path | Mock completion mutation used by the Commerce test surface |
57
- | `pay-paypal` | PayPal API, capture, query, refund, and webhook translation | Provider identity and metadata surface; no PayPal SDK execution in the browser |
58
- | `pay-stripe` | Stripe Checkout, query, refund, and webhook translation | Provider identity and metadata surface; no Stripe SDK execution in the browser |
53
+ The shared suite contains payment-domain state and browser-safe coordination only. Presentation is owned by the active edition:
54
+
55
+ ```text
56
+ zova/src/suite/cabloy-basic/modules/basic-pay/
57
+ └── paymentNextAction # DaisyUI and Tailwind CSS presenter
58
+
59
+ zova/src/suite/cabloy-start/modules/start-pay/
60
+ └── paymentNextAction # Vuetify presenter
61
+ ```
62
+
63
+ Each edition module exposes its own `ZPaymentNextAction` wrapper, while consuming the neutral `IPaymentNextActionProps` contract and `ServicePaymentCoordinator` from `a-pay`.
64
+
65
+ | Module | Vona responsibility | Zova responsibility |
66
+ | ------------ | --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
67
+ | `a-pay` | Payment sessions, provider operations, callbacks, webhooks, normalized contracts, audit/outbox boundaries | Payment-session API/model, generated contracts, normalized next-action input, redirect coordinator |
68
+ | `basic-pay` | — | Cabloy Basic next-action presentation using DaisyUI and Tailwind CSS |
69
+ | `start-pay` | — | Cabloy Start next-action presentation using Vuetify |
70
+ | `pay-mock` | Deterministic development/test provider and simulator webhook path | Mock completion mutation used by the Commerce test surface |
71
+ | `pay-paypal` | PayPal API, capture, query, refund, and webhook translation | Provider identity and metadata surface; no PayPal SDK execution in the browser |
72
+ | `pay-stripe` | Stripe Checkout, query, refund, and webhook translation | Provider identity and metadata surface; no Stripe SDK execution in the browser |
59
73
 
60
74
  The actual Web payment page is owned by the Commerce consumer, not by `zova-module-a-pay`:
61
75
 
@@ -143,7 +157,7 @@ The following flow is source-confirmed by the current Commerce and A-Pay impleme
143
157
  6. Commerce navigates to an authenticated Commerce payment route with the payment-session and order identifiers. Callback continuation remains server-selected and allowlisted; do not derive it from provider or browser input.
144
158
  7. The customer starts the session. Zova calls `POST /api/pay/payment-session/{id}/start`; A-Pay claims a provider operation with a stable idempotency key before making the external provider call.
145
159
  8. The provider adapter returns a normalized snapshot and optional `nextAction`. Redirect-capable providers normally return `requires_action` with a redirect action.
146
- 9. Zova renders the generic next-action component. On the client, the redirect coordinator uses `window.location.assign(...)`; it does not call a provider SDK or decide whether the order is paid.
160
+ 9. Zova renders the edition-owned next-action presenter: `ZPaymentNextAction` from `basic-pay` in Cabloy Basic or from `start-pay` in Cabloy Start. On the client, the shared redirect coordinator uses `window.location.assign(...)`; it does not call a provider SDK or decide whether the order is paid.
147
161
  10. The provider returns through the server callback route, or sends a webhook to the public webhook route. A return callback can request confirmation or reconciliation, but cannot assert success.
148
162
  11. A-Pay verifies provider webhook input using the selected server-side client and the raw request body, then correlates provider, client, environment, amount, currency, and identifiers with the persisted session.
149
163
  12. Verified facts are deduplicated and applied to payment state. The state transition, audit entry, and `payment.outcome.v1` outbox record are written durably.
@@ -212,9 +226,9 @@ Read the frontend in Zova’s own roles first:
212
226
  | Zova role | Current A-Pay responsibility |
213
227
  | -------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
214
228
  | `ModelPaymentSession` | Model-owned query and mutation state for `view`, `start`, and `reconcile`, including invalidation after mutations |
215
- | `ControllerPaymentNextAction` | Component-controller behavior for redirect, pending, completed, and embedded action rendering |
229
+ | `IPaymentNextActionProps` | Shared neutral input contract for edition-owned next-action presenters |
216
230
  | `ServicePaymentCoordinator` | Client-only execution of a normalized redirect action |
217
- | `ZPaymentNextAction` | Metadata-backed public component wrapper for the action controller |
231
+ | `basic-pay` / `start-pay` | Edition-owned `ControllerPaymentNextAction` and `ZPaymentNextAction` presentation wrappers |
218
232
  | Commerce payment page controller | Route state, start/reconcile decisions, settlement polling, and order navigation |
219
233
 
220
234
  This is not page-local Vue fetching rewritten with classes. The model bean owns remote query/mutation state; the controller owns interaction and lifecycle decisions; the service bean owns reusable browser-side behavior; the render/component wrapper exposes the controller to consumers.
@@ -223,10 +237,10 @@ The core frontend reading path is:
223
237
 
224
238
  1. `zova/src/suite-vendor/a-pay/modules/a-pay/src/types/payment.ts`
225
239
  2. `zova/src/suite-vendor/a-pay/modules/a-pay/src/model/paymentSession.ts`
226
- 3. `zova/src/suite-vendor/a-pay/modules/a-pay/src/api/paymentSession.ts`
227
- 4. `zova/src/suite-vendor/a-pay/modules/a-pay/src/apiSchema/paymentSession.ts`
240
+ 3. `zova/src/suite-vendor/a-pay/modules/a-pay/src/api/payPaymentSession.ts`
241
+ 4. `zova/src/suite-vendor/a-pay/modules/a-pay/src/apiSchema/payPaymentSession.ts`
228
242
  5. `zova/src/suite-vendor/a-pay/modules/a-pay/src/service/paymentCoordinator.ts`
229
- 6. `zova/src/suite-vendor/a-pay/modules/a-pay/src/component/paymentNextAction/controller.tsx`
243
+ 6. `zova/src/suite/cabloy-basic/modules/basic-pay/src/component/paymentNextAction/controller.tsx` or `zova/src/suite/cabloy-start/modules/start-pay/src/component/paymentNextAction/controller.tsx`
230
244
  7. `zova/src/suite/a-commerce/modules/commerce-trade/src/page/payment/controller.tsx`
231
245
 
232
246
  When a consumer uses `controllerRef` on `ZPaymentNextAction`, it receives the Zova component controller instance. It is not a generic DOM or Vue component reference.
@@ -235,7 +249,7 @@ When a consumer uses `controllerRef` on `ZPaymentNextAction`, it receives the Zo
235
249
 
236
250
  - Keep payment-session query/mutation state in `ModelPaymentSession`.
237
251
  - Consume generated API types and schemas; do not hand-patch generated files.
238
- - Pass the normalized `nextAction` to the generic action component instead of adding provider-specific branches to Commerce pages.
252
+ - Pass the normalized `nextAction` and shared `IPaymentNextActionProps` to the active edition's action component instead of adding provider-specific branches to Commerce pages.
239
253
  - Execute redirects only in the browser.
240
254
  - Keep mock simulator controls limited to mock sessions and development/test surfaces.
241
255
  - Treat payment-session terminal state and Commerce order settlement as separate observations.
@@ -303,10 +317,10 @@ For frontend contracts and consumption:
303
317
 
304
318
  1. `zova/src/suite-vendor/a-pay/modules/a-pay/src/types/payment.ts`
305
319
  2. `zova/src/suite-vendor/a-pay/modules/a-pay/src/model/paymentSession.ts`
306
- 3. `zova/src/suite-vendor/a-pay/modules/a-pay/src/api/paymentSession.ts`
307
- 4. `zova/src/suite-vendor/a-pay/modules/a-pay/src/apiSchema/paymentSession.ts`
320
+ 3. `zova/src/suite-vendor/a-pay/modules/a-pay/src/api/payPaymentSession.ts`
321
+ 4. `zova/src/suite-vendor/a-pay/modules/a-pay/src/apiSchema/payPaymentSession.ts`
308
322
  5. `zova/src/suite-vendor/a-pay/modules/a-pay/src/service/paymentCoordinator.ts`
309
- 6. `zova/src/suite-vendor/a-pay/modules/a-pay/src/component/paymentNextAction/controller.tsx`
323
+ 6. `zova/src/suite/cabloy-basic/modules/basic-pay/src/component/paymentNextAction/controller.tsx` or `zova/src/suite/cabloy-start/modules/start-pay/src/component/paymentNextAction/controller.tsx`
310
324
  7. `zova/src/suite/a-commerce/modules/commerce-trade/src/routes.ts`
311
325
  8. `zova/src/suite/a-commerce/modules/commerce-trade/src/page/checkout/controller.tsx`
312
326
  9. `zova/src/suite/a-commerce/modules/commerce-trade/src/page/payment/controller.tsx`