@stacksjs/defaults 0.75.489 → 0.75.492

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 (153) hide show
  1. package/ai/skills/stacks-actions/SKILL.md +1 -1
  2. package/ai/skills/stacks-dashboard/SKILL.md +20 -2
  3. package/ai/skills/stacks-native/CATALOG.md +9 -9
  4. package/ai/skills/stacks-search-engine/SKILL.md +14 -0
  5. package/app/Actions/Dashboard/Commerce/CommerceCategoriesAction.ts +7 -13
  6. package/app/Actions/Dashboard/Commerce/CommerceCustomerChoicesAction.ts +34 -0
  7. package/app/Actions/Dashboard/Commerce/CommerceDeliveryAction.ts +7 -16
  8. package/app/Actions/Dashboard/Commerce/CommerceGiftCardsAction.ts +21 -15
  9. package/app/Actions/Dashboard/Commerce/CommerceGiftCardsExportAction.ts +41 -0
  10. package/app/Actions/Dashboard/Commerce/CommerceOrderCustomersAction.ts +37 -0
  11. package/app/Actions/Dashboard/Commerce/CommerceOrdersAction.ts +26 -41
  12. package/app/Actions/Dashboard/Commerce/CommerceOrdersExportAction.ts +43 -0
  13. package/app/Actions/Dashboard/Commerce/CommercePaymentsAction.ts +24 -21
  14. package/app/Actions/Dashboard/Commerce/CommercePaymentsExportAction.ts +41 -0
  15. package/app/Actions/Dashboard/Commerce/CommercePosAction.ts +18 -48
  16. package/app/Actions/Dashboard/Commerce/CommercePosProductsAction.ts +39 -0
  17. package/app/Actions/Dashboard/Commerce/CommercePrintLogsAction.ts +14 -104
  18. package/app/Actions/Dashboard/Commerce/CommercePrintLogsExportAction.ts +41 -0
  19. package/app/Actions/Dashboard/Commerce/CommerceProductChoicesAction.ts +32 -0
  20. package/app/Actions/Dashboard/Commerce/CommerceProductsAction.ts +24 -43
  21. package/app/Actions/Dashboard/Commerce/CommerceProductsExportAction.ts +44 -0
  22. package/app/Actions/Dashboard/Commerce/CourierIndexAction.ts +3 -1
  23. package/app/Actions/Dashboard/Commerce/DeliveryRouteIndexAction.ts +23 -12
  24. package/app/Actions/Dashboard/Commerce/DigitalDeliveryIndexAction.ts +3 -1
  25. package/app/Actions/Dashboard/Commerce/LicenseKeyIndexAction.ts +24 -23
  26. package/app/Actions/Dashboard/Commerce/LicenseKeyOptionsAction.ts +35 -16
  27. package/app/Actions/Dashboard/Commerce/ProductUnitIndexAction.ts +23 -19
  28. package/app/Actions/Dashboard/Commerce/ProductVariantIndexAction.ts +25 -18
  29. package/app/Actions/Dashboard/Commerce/ProductWaitlistIndexAction.ts +22 -22
  30. package/app/Actions/Dashboard/Commerce/RestaurantWaitlistIndexAction.ts +22 -17
  31. package/app/Actions/Dashboard/Commerce/ReviewIndexAction.ts +22 -31
  32. package/app/Actions/Dashboard/Commerce/ShippingMethodIndexAction.ts +3 -1
  33. package/app/Actions/Dashboard/Commerce/ShippingRateIndexAction.ts +3 -1
  34. package/app/Actions/Dashboard/Commerce/ShippingZoneIndexAction.ts +3 -1
  35. package/app/Actions/Dashboard/Commerce/commerce-category-list.test.ts +100 -0
  36. package/app/Actions/Dashboard/Commerce/commerce-category-list.ts +26 -0
  37. package/app/Actions/Dashboard/Commerce/commerce-choice-records.ts +56 -0
  38. package/app/Actions/Dashboard/Commerce/commerce-choices.test.ts +88 -0
  39. package/app/Actions/Dashboard/Commerce/commerce-choices.ts +70 -0
  40. package/app/Actions/Dashboard/Commerce/commerce-delivery-overview.test.ts +151 -0
  41. package/app/Actions/Dashboard/Commerce/commerce-delivery-overview.ts +85 -0
  42. package/app/Actions/Dashboard/Commerce/commerce-delivery-route-list.test.ts +153 -0
  43. package/app/Actions/Dashboard/Commerce/commerce-delivery-route-list.ts +180 -0
  44. package/app/Actions/Dashboard/Commerce/commerce-delivery.ts +24 -9
  45. package/app/Actions/Dashboard/Commerce/commerce-gift-card-list.test.ts +221 -0
  46. package/app/Actions/Dashboard/Commerce/commerce-gift-card-list.ts +259 -0
  47. package/app/Actions/Dashboard/Commerce/commerce-license-key-list.test.ts +184 -0
  48. package/app/Actions/Dashboard/Commerce/commerce-license-key-list.ts +217 -0
  49. package/app/Actions/Dashboard/Commerce/commerce-order-list.test.ts +183 -0
  50. package/app/Actions/Dashboard/Commerce/commerce-order-list.ts +278 -0
  51. package/app/Actions/Dashboard/Commerce/commerce-order-records.test.ts +29 -0
  52. package/app/Actions/Dashboard/Commerce/commerce-payment-list.test.ts +180 -0
  53. package/app/Actions/Dashboard/Commerce/commerce-payment-list.ts +272 -0
  54. package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.test.ts +171 -0
  55. package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.ts +152 -0
  56. package/app/Actions/Dashboard/Commerce/commerce-pos.test.ts +1 -12
  57. package/app/Actions/Dashboard/Commerce/commerce-pos.ts +0 -26
  58. package/app/Actions/Dashboard/Commerce/commerce-print-log-list.test.ts +202 -0
  59. package/app/Actions/Dashboard/Commerce/commerce-print-log-list.ts +286 -0
  60. package/app/Actions/Dashboard/Commerce/commerce-product-list.test.ts +174 -0
  61. package/app/Actions/Dashboard/Commerce/commerce-product-list.ts +276 -0
  62. package/app/Actions/Dashboard/Commerce/commerce-product-unit-list.test.ts +146 -0
  63. package/app/Actions/Dashboard/Commerce/commerce-product-unit-list.ts +178 -0
  64. package/app/Actions/Dashboard/Commerce/commerce-product-variant-list.test.ts +165 -0
  65. package/app/Actions/Dashboard/Commerce/commerce-product-variant-list.ts +209 -0
  66. package/app/Actions/Dashboard/Commerce/commerce-product-waitlist-list.test.ts +183 -0
  67. package/app/Actions/Dashboard/Commerce/commerce-product-waitlist-list.ts +170 -0
  68. package/app/Actions/Dashboard/Commerce/commerce-record.ts +21 -0
  69. package/app/Actions/Dashboard/Commerce/commerce-restaurant-waitlist-list.test.ts +189 -0
  70. package/app/Actions/Dashboard/Commerce/commerce-restaurant-waitlist-list.ts +177 -0
  71. package/app/Actions/Dashboard/Commerce/commerce-review-list.test.ts +193 -0
  72. package/app/Actions/Dashboard/Commerce/commerce-review-list.ts +220 -0
  73. package/app/Actions/Dashboard/Commerce/commerce-sql.ts +57 -0
  74. package/app/Actions/Dashboard/Commerce/payment-records.test.ts +16 -0
  75. package/app/Actions/Dashboard/Commerce/product-unit-records.test.ts +0 -13
  76. package/app/Actions/Dashboard/Commerce/product-unit-records.ts +0 -17
  77. package/app/Actions/Dashboard/Commerce/product-variant-records.test.ts +0 -13
  78. package/app/Actions/Dashboard/Commerce/product-variant-records.ts +0 -17
  79. package/app/Actions/Dashboard/Commerce/product-waitlist-records.test.ts +6 -5
  80. package/app/Actions/Dashboard/Commerce/product-waitlist-records.ts +16 -45
  81. package/app/Actions/Dashboard/Commerce/restaurant-waitlist-records.ts +4 -24
  82. package/app/Actions/Dashboard/Content/content-list.ts +10 -0
  83. package/app/Actions/Dashboard/Content/file-listing-metadata.test.ts +46 -0
  84. package/app/Actions/Dashboard/Content/file-manager.ts +51 -10
  85. package/app/Actions/Dashboard/DashboardHomeAction.test.ts +13 -9
  86. package/app/Actions/Dashboard/DashboardHomeAction.ts +42 -21
  87. package/app/Actions/Dashboard/Jobs/JobStatsAction.ts +5 -2
  88. package/app/Actions/Dashboard/Kanban/UsersListAction.ts +13 -9
  89. package/app/Actions/Dashboard/Kanban/kanban-response.test.ts +40 -0
  90. package/app/Actions/Dashboard/Kanban/kanban-response.ts +53 -1
  91. package/app/Actions/Dashboard/Kanban/kanban-users.test.ts +114 -0
  92. package/app/Actions/Dashboard/Kanban/kanban-users.ts +32 -0
  93. package/app/Actions/Dashboard/Models/ModelShowAction.ts +8 -0
  94. package/app/Actions/Dashboard/Models/ModelsIndexAction.ts +16 -2
  95. package/app/Actions/Dashboard/Models/model-migration.test.ts +27 -0
  96. package/app/Actions/Dashboard/Models/model-migration.ts +23 -0
  97. package/app/Actions/Dashboard/Queue/QueueStatsAction.ts +5 -3
  98. package/app/Actions/Dashboard/Queue/QueueWorkersAction.ts +3 -2
  99. package/app/Actions/Dashboard/Queue/worker-snapshots.test.ts +31 -0
  100. package/app/Actions/Dashboard/Queue/worker-snapshots.ts +33 -0
  101. package/app/Actions/Dashboard/named-search.test.ts +36 -0
  102. package/app/Actions/Dashboard/named-search.ts +80 -0
  103. package/app/Models/Request.ts +4 -2
  104. package/functions/commerce/shippings/dashboard-resource.ts +12 -1
  105. package/functions/commerce/shippings/delivery-routes.ts +1 -0
  106. package/functions/commerce/shippings/license-keys.ts +1 -0
  107. package/functions/dashboard-list.test.ts +146 -1
  108. package/functions/dashboard-list.ts +216 -1
  109. package/functions/queue.ts +2 -0
  110. package/ide/vscode/package.json +1 -1
  111. package/package.json +2 -2
  112. package/resources/components/Dashboard/Commerce/CommerceGiftCardBreakdown.stx +38 -12
  113. package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +122 -68
  114. package/resources/components/Dashboard/Commerce/CommerceGiftCardsTable.stx +29 -6
  115. package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +59 -2
  116. package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +126 -80
  117. package/resources/components/Dashboard/Commerce/CommerceOrdersTable.stx +28 -3
  118. package/resources/components/Dashboard/Commerce/CommercePaymentsBreakdown.stx +12 -29
  119. package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +139 -60
  120. package/resources/components/Dashboard/Commerce/CommercePaymentsTable.stx +27 -2
  121. package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +17 -1
  122. package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +47 -3
  123. package/resources/components/Dashboard/Commerce/CommercePosDashboard.stx +59 -49
  124. package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +116 -82
  125. package/resources/components/Dashboard/Commerce/CommerceProductsTable.stx +28 -4
  126. package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +120 -69
  127. package/resources/components/Dashboard/Commerce/CommerceReviewsTable.stx +29 -6
  128. package/resources/components/Dashboard/Commerce/CommerceUnitDialog.stx +63 -8
  129. package/resources/components/Dashboard/Commerce/CommerceUnitsDashboard.stx +48 -60
  130. package/resources/components/Dashboard/Commerce/CommerceUnitsTable.stx +29 -3
  131. package/resources/components/Dashboard/Commerce/CommerceVariantDialog.stx +57 -3
  132. package/resources/components/Dashboard/Commerce/CommerceVariantsDashboard.stx +59 -61
  133. package/resources/components/Dashboard/Commerce/CommerceVariantsTable.stx +28 -2
  134. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesDashboard.stx +79 -52
  135. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +31 -8
  136. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +71 -13
  137. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysDashboard.stx +69 -81
  138. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysTable.stx +31 -8
  139. package/resources/components/Dashboard/Commerce/PrintLogBreakdown.stx +21 -17
  140. package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +23 -22
  141. package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +116 -20
  142. package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +100 -12
  143. package/resources/components/Dashboard/Commerce/ProductWaitlistTable.stx +34 -16
  144. package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +107 -19
  145. package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +65 -6
  146. package/resources/components/Dashboard/Commerce/RestaurantWaitlistTable.stx +29 -3
  147. package/resources/components/Dashboard/Kanban/KanbanBoardsDashboard.stx +10 -1
  148. package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +21 -1
  149. package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +24 -4
  150. package/resources/components/Dashboard/Models/ModelsOverview.stx +13 -2
  151. package/resources/components/Dashboard/Queue/QueueDashboard.stx +7 -1
  152. package/routes/dashboard-api.ts +11 -0
  153. package/views/dashboard/stores/kanban.ts +38 -6
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: stacks-actions
3
- description: Use when working with Stacks server actions - creating actions in app/Actions/, auto-generated API actions from the useApi model trait, the 685 default framework actions (auth, dashboard, commerce, content, deployment, jobs), action request/response handling, or action registration. Covers @stacksjs/actions and storage/framework/defaults/app/Actions/.
3
+ description: Use when working with Stacks server actions - creating actions in app/Actions/, auto-generated API actions from the useApi model trait, the 716 default framework actions (auth, dashboard, commerce, content, deployment, jobs), action request/response handling, or action registration. Covers @stacksjs/actions and storage/framework/defaults/app/Actions/.
4
4
  license: MIT
5
5
  compatibility: Bun >= 1.3.0, TypeScript
6
6
  allowed-tools: Read Edit Write Bash Grep Glob
@@ -688,10 +688,28 @@ that remain exposed.
688
688
 
689
689
  ## Application observability
690
690
 
691
+ HTTP capture is opt-in through `config/server.ts: captureRequests: true` (or
692
+ `{ enabled: true, exclude: ['/assets/*'] }`). Publish the native `Request` model
693
+ into the app schema and generate/migrate its table. Infrastructure-only overrides
694
+ can disable `useSeeder` and `useApi` and set `dashboard.access: false`; the guarded
695
+ Requests page and home metrics still use the private native schema inventory.
696
+
697
+ The recorder observes final responses in API dispatch and dev/production page
698
+ servers, including middleware refusals, 404s, and 405s. Proxied API traffic is
699
+ recorded by the API process once. Dashboard polling and framework assets are
700
+ excluded. It stores method, pathname, status, response-generation duration and
701
+ process heap usage, never bodies, headers or query parameters. Credential-bearing
702
+ path tails are redacted. IP and user-agent columns stay empty. Writes are buffered
703
+ with a 100-row pending limit; storage failures cannot replace HTTP responses.
704
+ `flushRequestCaptures()` from `@stacksjs/router/request-capture` drains the buffer;
705
+ API shutdown hooks call it. This is operational telemetry, not a delivery audit.
706
+
691
707
  The standalone dashboard registers its guarded JSON API even when the application
692
708
  skips default route bundles. Its STX state lives in
693
- `storage/framework/runtime/dashboard/stx`, so opening it does not replace the
694
- application's generated routes or layout types. Built-in module links follow
709
+ `storage/framework/runtime/dashboard-stx`, so opening it does not replace the
710
+ application's generated routes or layout types. It sits beside
711
+ `storage/framework/runtime/dashboard`, not inside it: that directory is watched,
712
+ and stx writes there on every render. Built-in module links follow
695
713
  the native schema inventory, including private operational models.
696
714
 
697
715
  The sidebar, model catalog and global search use the database's native model
@@ -11,7 +11,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
11
11
  | Package | Task guidance | Source entry | Retained tests |
12
12
  |---|---|---|---|
13
13
  | `@stacksjs/action-runner` | [`stacks-actions`](../stacks-actions/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/action-runner/src/index.ts) | 1 |
14
- | `@stacksjs/actions` | [`stacks-actions`](../stacks-actions/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/index.ts) | 103 |
14
+ | `@stacksjs/actions` | [`stacks-actions`](../stacks-actions/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/index.ts) | 105 |
15
15
  | `@stacksjs/ai` | [`stacks-ai`](../stacks-ai/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ai/src/index.ts) | 21 |
16
16
  | `@stacksjs/alias` | [`stacks-alias`](../stacks-alias/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/alias/src/index.ts) | 3 |
17
17
  | `@stacksjs/analytics` | [`stacks-analytics`](../stacks-analytics/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/analytics/src/index.ts) | 7 |
@@ -21,7 +21,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
21
21
  | `@stacksjs/auth` | [`stacks-auth`](../stacks-auth/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/index.ts) | 131 |
22
22
  | `@stacksjs/browser` | [`stacks-browser`](../stacks-browser/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/index.ts) | 9 |
23
23
  | `@stacksjs/browser-extension` | [`stacks-browser-extension`](../stacks-browser-extension/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser-extension/src/index.ts) | 9 |
24
- | `@stacksjs/buddy` | [`stacks-buddy`](../stacks-buddy/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/src/index.ts) | 181 |
24
+ | `@stacksjs/buddy` | [`stacks-buddy`](../stacks-buddy/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/src/index.ts) | 183 |
25
25
  | `@stacksjs/build` | [`stacks-build`](../stacks-build/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/build/src/index.ts) | 6 |
26
26
  | `@stacksjs/cache` | [`stacks-cache`](../stacks-cache/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cache/src/index.ts) | 24 |
27
27
  | `@stacksjs/calendar-api` | [`stacks-calendar`](../stacks-calendar/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/calendar-api/src/index.ts) | 5 |
@@ -35,7 +35,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
35
35
  | `@stacksjs/composables` | [`stacks-composables`](../stacks-composables/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/composables/src/index.ts) | 18 |
36
36
  | `@stacksjs/config` | [`stacks-config`](../stacks-config/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/config/src/index.ts) | 16 |
37
37
  | `@stacksjs/cron` | [`stacks-cron`](../stacks-cron/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cron/src/index.ts) | 6 |
38
- | `@stacksjs/database` | [`stacks-database`](../stacks-database/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/index.ts) | 140 |
38
+ | `@stacksjs/database` | [`stacks-database`](../stacks-database/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/index.ts) | 141 |
39
39
  | `@stacksjs/datetime` | [`stacks-datetime`](../stacks-datetime/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/datetime/src/index.ts) | 22 |
40
40
  | `@stacksjs/defaults` | [`stacks-build`](../stacks-build/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/defaults/package.json) | 2 |
41
41
  | `@stacksjs/deploy` | [`stacks-deploy`](../stacks-deploy/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/deploy/package.json) | 1 |
@@ -75,7 +75,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
75
75
  | `@stacksjs/realtime` | [`stacks-realtime`](../stacks-realtime/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/realtime/src/index.ts) | 13 |
76
76
  | `@stacksjs/registry` | [`stacks-registry`](../stacks-registry/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/registry/src/index.ts) | 1 |
77
77
  | `@stacksjs/repl` | [`stacks-repl`](../stacks-repl/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/repl/src/index.ts) | 2 |
78
- | `@stacksjs/router` | [`stacks-router`](../stacks-router/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/index.ts) | 99 |
78
+ | `@stacksjs/router` | [`stacks-router`](../stacks-router/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/index.ts) | 101 |
79
79
  | `@stacksjs/scheduler` | [`stacks-scheduler`](../stacks-scheduler/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/scheduler/src/index.ts) | 19 |
80
80
  | `@stacksjs/search-engine` | [`stacks-search-engine`](../stacks-search-engine/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/search-engine/src/index.ts) | 11 |
81
81
  | `@stacksjs/security` | [`stacks-security`](../stacks-security/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/security/src/index.ts) | 12 |
@@ -119,7 +119,7 @@ Declared runtime exports: `BlogAdminError`, `DEFAULT_IOS_DEPENDENCIES`, `DEFAULT
119
119
 
120
120
  Local source modules: [src/action.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/action.ts), [src/add.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/add.ts), [src/blog-admin.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/blog-admin.ts), [src/build/ios-toolchain.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/build/ios-toolchain.ts), [src/build/macos-native.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/build/macos-native.ts), [src/commit.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/commit.ts), [src/dev/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/dev/index.ts), [src/discover-packages.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/discover-packages.ts), [src/generate/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/generate/index.ts), [src/github-release.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/github-release.ts), [src/helpers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/helpers/index.ts), [src/library/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/library/index.ts), [src/lint/lint.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/lint/lint.ts), [src/lint/stx-gate.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/lint/stx-gate.ts), [src/make-command.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/make-command.ts), [src/make-job.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/make-job.ts), [src/make-policy.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/make-policy.ts), [src/make-resource.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/make-resource.ts), [src/make.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/make.ts), [src/publication-preflight.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/publication-preflight.ts), [src/release-evidence.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/release-evidence.ts), [src/reviewos-evidence.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/reviewos-evidence.ts), [src/scaffold-crud.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/scaffold-crud.ts), [src/setup/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/setup/index.ts), [src/stacks.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/stacks.ts), [src/stx-source.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/stx-source.ts), [src/upgrade/package-project.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/upgrade/package-project.ts), [src/upgrade/route-actions.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/upgrade/route-actions.ts).
121
121
 
122
- Evidence directory: [103 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
122
+ Evidence directory: [105 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
123
123
 
124
124
  ### @stacksjs/ai
125
125
 
@@ -219,7 +219,7 @@ Read the entrypoint and package export map for re-exported or type-only surfaces
219
219
 
220
220
  Local source modules: [src/commands/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/src/commands/index.ts).
221
221
 
222
- Evidence directory: [181 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
222
+ Evidence directory: [183 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
223
223
 
224
224
  ### @stacksjs/build
225
225
 
@@ -355,9 +355,9 @@ Guidance: [`stacks-database`](../stacks-database/SKILL.md). Source: [storage/fra
355
355
 
356
356
  Declared runtime exports: `Database`, `EntityQueryBuilder`, `__flushAfterCommitNow`, `__pendingAfterCommitCount`, `addColumnSafely`, `auditForeignKeys`, `auditSchemaDrift`, `auditUniqueIndexes`, `backfillInBatches`, `buildKey`, `classifyDeclaredFKs`, `comparableIndexKey`, `createDatabase`, `createDynamo`, `createMysqlDatabase`, `createPostgresDatabase`, `createQueryBuilder`, `createSqliteDatabase`, `createTursoDatabase`, `describeIgnoreRule`, `detectDriver`, `driverDefaults`, `dynamo`, `enqueueAfterCommit`, `ensureNotificationForeignKeys`, `findFkOrphans`, `findIgnoredMigrations`, `fkKey`, `formatIgnoredMigrations`, `formatSchemaDrift`, `frameworkRouteAdmission`, `generateKeyPattern`, `getConfigFromEnv`, `getConnectionString`, `getDeclaredFKs`, `getDeclaredUniques`, `getLiveFKs`, `getLiveTables`, `getLiveUniqueIndexes`, `isInTransaction`, `logQuery`, `marshall`, `matchedRows`, `mergeWithDefaults`, `migrateNotificationTables`, `migrateRbacTables`, `mutationCount`, `parseKeyPattern`, `postgresIndexStatement`, `readCommittedTransactionOptions`, `renameColumnSafely`, `runInTransactionScope`, `setConfig`, `setQueryTracker`, `sqliteWriteOptions`, `trackIgnoredGeneratedMigrations`, `unmarshall`, `validateDriverConfig`.
357
357
 
358
- Local source modules: [src/affected-rows.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/affected-rows.ts), [src/auth-tables.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/auth-tables.ts), [src/custom/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/custom/index.ts), [src/database.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/database.ts), [src/datetime-columns.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/datetime-columns.ts), [src/ddl-constraints.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/ddl-constraints.ts), [src/defaults.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/defaults.ts), [src/dialect.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/dialect.ts), [src/driver-config.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/driver-config.ts), [src/drivers/dynamodb.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/drivers/dynamodb.ts), [src/drivers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/drivers/index.ts), [src/ensure-database.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/ensure-database.ts), [src/erd.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/erd.ts), [src/fk-audit.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/fk-audit.ts), [src/framework-renames.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/framework-renames.ts), [src/framework-route-admission.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/framework-route-admission.ts), [src/hand-written-migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/hand-written-migrations.ts), [src/ignored-migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/ignored-migrations.ts), [src/index-shape.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/index-shape.ts), [src/managed-columns.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/managed-columns.ts), [src/migration-dialect.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migration-dialect.ts), [src/migration-ledger.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migration-ledger.ts), [src/migration-names.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migration-names.ts), [src/migration-path.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migration-path.ts), [src/migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migrations.ts), [src/model-sources.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/model-sources.ts), [src/notification-tables.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/notification-tables.ts), [src/package-migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/package-migrations.ts), [src/package-models.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/package-models.ts), [src/query-logger.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/query-logger.ts), [src/rbac-tables.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/rbac-tables.ts), [src/relation-columns.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/relation-columns.ts), [src/replicas.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/replicas.ts), [src/row-lease.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/row-lease.ts), [src/row-lock.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/row-lock.ts), [src/safe-migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/safe-migrations.ts), [src/schema-align.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/schema-align.ts), [src/schema-drift.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/schema-drift.ts), [src/seeder.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/seeder.ts), [src/shadowed-models.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/shadowed-models.ts), [src/sql-helpers.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/sql-helpers.ts), [src/trait-tables.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/trait-tables.ts), [src/transaction-context.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/transaction-context.ts), [src/transaction-options.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/transaction-options.ts), [src/types.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/types.ts), [src/unique-audit.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/unique-audit.ts), [src/utc-defaults.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/utc-defaults.ts), [src/utils.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/utils.ts), [src/uuid-columns.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/uuid-columns.ts), [src/vschema.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/vschema.ts).
358
+ Local source modules: [src/affected-rows.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/affected-rows.ts), [src/auth-tables.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/auth-tables.ts), [src/custom/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/custom/index.ts), [src/database.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/database.ts), [src/datetime-columns.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/datetime-columns.ts), [src/ddl-constraints.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/ddl-constraints.ts), [src/defaults.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/defaults.ts), [src/dialect.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/dialect.ts), [src/driver-config.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/driver-config.ts), [src/drivers/dynamodb.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/drivers/dynamodb.ts), [src/drivers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/drivers/index.ts), [src/ensure-database.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/ensure-database.ts), [src/erd.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/erd.ts), [src/fk-audit.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/fk-audit.ts), [src/framework-renames.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/framework-renames.ts), [src/framework-route-admission.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/framework-route-admission.ts), [src/hand-written-migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/hand-written-migrations.ts), [src/ignored-migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/ignored-migrations.ts), [src/index-shape.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/index-shape.ts), [src/managed-columns.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/managed-columns.ts), [src/migration-dialect.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migration-dialect.ts), [src/migration-ledger.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migration-ledger.ts), [src/migration-names.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migration-names.ts), [src/migration-path.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migration-path.ts), [src/migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/migrations.ts), [src/model-sources.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/model-sources.ts), [src/notification-tables.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/notification-tables.ts), [src/package-migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/package-migrations.ts), [src/package-models.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/package-models.ts), [src/query-logger.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/query-logger.ts), [src/rbac-tables.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/rbac-tables.ts), [src/relation-columns.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/relation-columns.ts), [src/replicas.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/replicas.ts), [src/row-lease.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/row-lease.ts), [src/row-lock.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/row-lock.ts), [src/safe-migrations.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/safe-migrations.ts), [src/schema-align.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/schema-align.ts), [src/schema-drift.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/schema-drift.ts), [src/seeder.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/seeder.ts), [src/shadowed-models.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/shadowed-models.ts), [src/sql-helpers.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/sql-helpers.ts), [src/table-exists.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/table-exists.ts), [src/trait-tables.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/trait-tables.ts), [src/transaction-context.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/transaction-context.ts), [src/transaction-options.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/transaction-options.ts), [src/types.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/types.ts), [src/unique-audit.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/unique-audit.ts), [src/utc-defaults.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/utc-defaults.ts), [src/utils.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/utils.ts), [src/uuid-columns.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/uuid-columns.ts), [src/vschema.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/vschema.ts).
359
359
 
360
- Evidence directory: [140 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
360
+ Evidence directory: [141 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
361
361
 
362
362
  ### @stacksjs/datetime
363
363
 
@@ -735,7 +735,7 @@ Declared runtime exports: `DASHBOARD_ROUTE_GROUPS`, `DEFAULT_ROUTE_BUNDLE_FEATUR
735
735
 
736
736
  Local source modules: [src/api-shape.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/api-shape.ts), [src/body.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/body.ts), [src/dashboard-access.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/dashboard-access.ts), [src/encrypted-session-store.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/encrypted-session-store.ts), [src/error-handler.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/error-handler.ts), [src/health.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/health.ts), [src/json.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/json.ts), [src/middleware.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/middleware.ts), [src/path-sanitize.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/path-sanitize.ts), [src/rate-limit.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/rate-limit.ts), [src/request-augmentation.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/request-augmentation.ts), [src/request-context.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/request-context.ts), [src/route-loader.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/route-loader.ts), [src/route-model-binding.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/route-model-binding.ts), [src/security-settings.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/security-settings.ts), [src/session-factory.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/session-factory.ts), [src/signed-url.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/signed-url.ts), [src/stacks-router.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/stacks-router.ts), [src/typed-router.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/src/typed-router.ts).
737
737
 
738
- Evidence directory: [99 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
738
+ Evidence directory: [101 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/router/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
739
739
 
740
740
  ### @stacksjs/scheduler
741
741
 
@@ -128,6 +128,20 @@ Environment variables: `MEILISEARCH_HOST`, `MEILISEARCH_KEY`, `SEARCH_ENGINE_DRI
128
128
 
129
129
  ## Readiness and driver boundaries
130
130
 
131
+ For local Typesense use the project-scoped Pantry service: `pantry start typesense`
132
+ and `pantry enable typesense` for auto-start. Read its assigned API port from
133
+ `pantry services:ports`; another checkout may own 8108. Set the application's
134
+ `TYPESENSE_PORT` to that port and pass the same `TYPESENSE_API_KEY` to Pantry and
135
+ the app. The service binds to loopback. Do not start a second untracked server or
136
+ share another application's data directory.
137
+
138
+ Search actions initialize the normal framework globals before evaluating model
139
+ batch projections. `search-engine:update` without a model selects all enabled
140
+ searchable models; an unknown or non-searchable model fails. Settings listing
141
+ without a selector follows the same native scope, including nested/package
142
+ models. Feature-disabled framework models are omitted. CLI argument boundaries,
143
+ including explicit empty values, are preserved across the action subprocess.
144
+
131
145
  `useSearchEngine()` returns a synchronous deferred proxy whose async methods
132
146
  wait for configuration and driver loading. The provider factories return promises
133
147
  and require await. Use `await searchEngineReady()` before reading synchronous
@@ -1,8 +1,12 @@
1
1
  import { Action } from '@stacksjs/actions/runtime'
2
- import { Category } from '@stacksjs/orm'
3
2
  import { dashboardOperationalError } from '../dashboard-response'
4
- import { normalizeCommerceCategoryRecord, summarizeCommerceCategories } from './commerce-category-records'
3
+ import { readCommerceCategories } from './commerce-category-list'
5
4
 
5
+ /**
6
+ * `GET /api/dashboard/commerce/categories` - every product category, in
7
+ * display order (commerce-category-list.ts, stacksjs/stacks#3218). It used to
8
+ * read the first 500.
9
+ */
6
10
  export default new Action({
7
11
  name: 'CommerceCategoriesAction',
8
12
  description: 'Returns persisted product Category records for dashboard management.',
@@ -11,17 +15,7 @@ export default new Action({
11
15
 
12
16
  async handle() {
13
17
  try {
14
- const categories = await Category.orderBy('display_order', 'asc').limit(500).get()
15
- const records = categories.map(normalizeCommerceCategoryRecord)
16
- const ids = new Set(records.map(record => record.id))
17
- for (const record of records) {
18
- if (record.parentCategoryId && !ids.has(record.parentCategoryId))
19
- throw new TypeError(`Category ${record.id}.parent_category_id references missing Category ${record.parentCategoryId}.`)
20
- }
21
- return {
22
- records,
23
- summary: summarizeCommerceCategories(records),
24
- }
18
+ return await readCommerceCategories()
25
19
  }
26
20
  catch (error) {
27
21
  return dashboardOperationalError(error, 'Category records could not be read.', 'CommerceCategoriesAction')
@@ -0,0 +1,34 @@
1
+ import type { RequestInstance } from '@stacksjs/types'
2
+ import { Action } from '@stacksjs/actions/runtime'
3
+ import { response } from '@stacksjs/router'
4
+ import { dashboardOperationalError } from '../dashboard-response'
5
+ import { parseNamedSearchQuery } from '../named-search'
6
+ import { searchCustomerChoices } from './commerce-choices'
7
+
8
+ /**
9
+ * `GET /api/dashboard/commerce/customer-choices?q=` - the customers a commerce
10
+ * dialog offers, searched by the database (commerce-choices.ts,
11
+ * stacksjs/stacks#3218). The waitlist dialogs were handed the first 500.
12
+ */
13
+ export default new Action({
14
+ name: 'CommerceCustomerChoicesAction',
15
+ description: 'Searches customers for the commerce dialogs.',
16
+ method: 'GET',
17
+ apiResponse: true,
18
+
19
+ async handle(request: RequestInstance) {
20
+ const query = parseNamedSearchQuery(key => request.get<unknown>(key, ''))
21
+ if ('error' in query)
22
+ return response.json({ message: query.error }, 422)
23
+
24
+ try {
25
+ // `active=1` keeps to Active customers, as the point of sale offers them.
26
+ const activeOnly = ['1', 'true'].includes(String(request.get<unknown>('active', '') ?? '').trim())
27
+ const { choices, total } = await searchCustomerChoices(query, undefined, undefined, { activeOnly })
28
+ return { choices, total, limit: query.limit }
29
+ }
30
+ catch (error) {
31
+ return dashboardOperationalError(error, 'Customers could not be searched.', 'CommerceCustomerChoicesAction')
32
+ }
33
+ },
34
+ })
@@ -1,9 +1,13 @@
1
1
  import { Action } from '@stacksjs/actions/runtime'
2
2
  import { config } from '@stacksjs/config'
3
- import { DeliveryRoute, Courier, ShippingMethod, ShippingZone } from '@stacksjs/orm'
4
3
  import { dashboardOperationalError } from '../dashboard-response'
5
- import { buildDeliveryOverview } from './commerce-delivery'
4
+ import { readDeliveryOverview } from './commerce-delivery-overview'
6
5
 
6
+ /**
7
+ * `GET /api/dashboard/commerce/delivery` - the delivery overview, counted over
8
+ * every courier, route and zone (commerce-delivery-overview.ts,
9
+ * stacksjs/stacks#3218). It used to work from the first 500 of each.
10
+ */
7
11
  export default new Action({
8
12
  name: 'CommerceDelivery',
9
13
  description: 'Returns the dashboard delivery overview from routes, couriers, shipping methods, and zones.',
@@ -12,20 +16,7 @@ export default new Action({
12
16
 
13
17
  async handle() {
14
18
  try {
15
- const [allMethods, allRoutes, allZones, allCouriers] = await Promise.all([
16
- ShippingMethod.orderBy('id', 'asc').limit(500).get(),
17
- DeliveryRoute.orderBy('id', 'asc').limit(500).get(),
18
- ShippingZone.orderBy('id', 'asc').limit(500).get(),
19
- Courier.orderBy('id', 'asc').limit(500).get(),
20
- ])
21
-
22
- return buildDeliveryOverview(
23
- allMethods,
24
- allRoutes,
25
- allZones,
26
- allCouriers,
27
- config.commerce?.currency,
28
- )
19
+ return await readDeliveryOverview(config.commerce?.currency)
29
20
  }
30
21
  catch (error) {
31
22
  return dashboardOperationalError(error, 'Delivery records could not be read.', 'CommerceDeliveryAction')
@@ -1,28 +1,34 @@
1
+ import type { RequestInstance } from '@stacksjs/types'
1
2
  import { Action } from '@stacksjs/actions/runtime'
2
- import { Customer, GiftCard } from '@stacksjs/orm'
3
+ import { response } from '@stacksjs/router'
3
4
  import { dashboardOperationalError } from '../dashboard-response'
4
- import { normalizeGiftCardRecord, summarizeGiftCards } from './gift-card-records'
5
- import { commerceIdentifier, commerceValue } from './commerce-record'
5
+ import { parseGiftCardListQuery, readGiftCardPage } from './commerce-gift-card-list'
6
6
 
7
+ /**
8
+ * `GET /api/dashboard/commerce/gift-cards` - one page of gift cards, searched,
9
+ * filtered, sorted and counted by the database, with the summary of every card
10
+ * (commerce-gift-card-list.ts, stacksjs/stacks#3218). It used to return the
11
+ * newest 500 for the browser to do all of that with.
12
+ */
7
13
  export default new Action({
8
14
  name: 'CommerceGiftCardsAction',
9
- description: 'Returns persisted GiftCard records for dashboard management.',
15
+ description: 'Returns one page of persisted GiftCard records for dashboard management.',
10
16
  method: 'GET',
11
17
  apiResponse: true,
12
18
 
13
- async handle() {
19
+ async handle(request: RequestInstance) {
20
+ const query = parseGiftCardListQuery(key => request.get<unknown>(key, ''))
21
+ if ('error' in query)
22
+ return response.json({ message: query.error }, 422)
23
+
14
24
  try {
15
- const [giftCards, customers] = await Promise.all([
16
- GiftCard.orderByDesc('id').limit(500).get(),
17
- Customer.orderBy('id', 'asc').limit(500).get(),
18
- ])
19
- const customerIds = new Set(customers.map(customer =>
20
- commerceIdentifier(commerceValue(customer, 'id', 'uuid'), 'Customer'),
21
- ))
22
- const records = giftCards.map(giftCard => normalizeGiftCardRecord(giftCard, customerIds))
25
+ const cards = await readGiftCardPage(query)
23
26
  return {
24
- records,
25
- summary: summarizeGiftCards(records),
27
+ records: cards.records,
28
+ total: cards.total,
29
+ page: cards.page,
30
+ perPage: query.perPage,
31
+ summary: cards.summary,
26
32
  }
27
33
  }
28
34
  catch (error) {
@@ -0,0 +1,41 @@
1
+ import type { RequestInstance } from '@stacksjs/types'
2
+ import { Action } from '@stacksjs/actions/runtime'
3
+ import { minorToInput } from '@stacksjs/commerce/money'
4
+ import { response } from '@stacksjs/router'
5
+ import { dashboardOperationalError } from '../dashboard-response'
6
+ import { giftCardsCsv, parseGiftCardListQuery, readGiftCardsForExport } from './commerce-gift-card-list'
7
+
8
+ /**
9
+ * `GET /api/dashboard/commerce/gift-cards/export` - every gift card matching
10
+ * the Gift Cards page's search, filters and sort, as CSV
11
+ * (stacksjs/stacks#3218). The page built the file from the newest 500.
12
+ */
13
+ export default new Action({
14
+ name: 'CommerceGiftCardsExportAction',
15
+ description: 'Exports every gift card matching the Gift Cards page filters as CSV.',
16
+ method: 'GET',
17
+ apiResponse: false,
18
+
19
+ async handle(request: RequestInstance) {
20
+ const query = parseGiftCardListQuery(key => request.get<unknown>(key, ''))
21
+ if ('error' in query)
22
+ return response.json({ message: query.error }, 422)
23
+
24
+ try {
25
+ const csv = giftCardsCsv(await readGiftCardsForExport(query), minorToInput)
26
+ const day = new Date().toISOString().slice(0, 10)
27
+ return new Response(csv, {
28
+ status: 200,
29
+ headers: {
30
+ 'Cache-Control': 'private, no-store',
31
+ 'Content-Disposition': `attachment; filename="gift-cards-${day}.csv"`,
32
+ 'Content-Type': 'text/csv; charset=utf-8',
33
+ 'X-Content-Type-Options': 'nosniff',
34
+ },
35
+ })
36
+ }
37
+ catch (error) {
38
+ return dashboardOperationalError(error, 'Gift cards could not be exported.', 'CommerceGiftCardsExportAction')
39
+ }
40
+ },
41
+ })
@@ -0,0 +1,37 @@
1
+ import type { RequestInstance } from '@stacksjs/types'
2
+ import { Action } from '@stacksjs/actions/runtime'
3
+ import { response } from '@stacksjs/router'
4
+ import { dashboardOperationalError } from '../dashboard-response'
5
+ import { parseNamedSearchQuery, searchNamedRows } from '../named-search'
6
+
7
+ /**
8
+ * `GET /api/dashboard/commerce/orders/customers?q=` - the customers the order
9
+ * dialog offers, searched by name and email (stacksjs/stacks#3218).
10
+ *
11
+ * The Orders endpoint used to send the first 500 customers by name with every
12
+ * page, so an order could not be given a customer past the 500th.
13
+ */
14
+ export default new Action({
15
+ name: 'CommerceOrderCustomersAction',
16
+ description: 'Searches customers by name or email for the order dialog.',
17
+ method: 'GET',
18
+ apiResponse: true,
19
+
20
+ async handle(request: RequestInstance) {
21
+ const query = parseNamedSearchQuery(key => request.get<unknown>(key, ''))
22
+ if ('error' in query)
23
+ return response.json({ message: query.error }, 422)
24
+
25
+ try {
26
+ const { rows, total } = await searchNamedRows('customers', query)
27
+ return {
28
+ customers: rows.map(row => ({ id: String(row.id), label: row.name || row.email || `Customer ${row.id}` })),
29
+ total,
30
+ limit: query.limit,
31
+ }
32
+ }
33
+ catch (error) {
34
+ return dashboardOperationalError(error, 'Customers could not be searched.', 'CommerceOrderCustomersAction')
35
+ }
36
+ },
37
+ })
@@ -1,55 +1,40 @@
1
+ import type { RequestInstance } from '@stacksjs/types'
1
2
  import { Action } from '@stacksjs/actions/runtime'
2
3
  import { config } from '@stacksjs/config'
3
- import { Coupon, Customer, Order, OrderItem } from '@stacksjs/orm'
4
+ import { response } from '@stacksjs/router'
4
5
  import { dashboardOperationalError } from '../dashboard-response'
5
- import {
6
- addOrderItemQuantity,
7
- normalizeCommerceOrderRecord,
8
- normalizeOrderCouponId,
9
- normalizeOrderCustomerContext,
10
- normalizeOrderCustomerOption,
11
- summarizeCommerceOrders,
12
- } from './commerce-order-records'
13
- import { commerceCurrency, commerceIdentifier, commerceValue } from './commerce-record'
6
+ import { parseOrderListQuery, readOrderPage } from './commerce-order-list'
7
+ import { commerceCurrency } from './commerce-record'
14
8
 
9
+ /**
10
+ * `GET /api/dashboard/commerce/orders` - one page of orders, searched, filtered,
11
+ * sorted, counted and summarised by the database (commerce-order-list.ts,
12
+ * stacksjs/stacks#3218). It used to return the newest 500 for the browser to
13
+ * do all of that with.
14
+ */
15
15
  export default new Action({
16
16
  name: 'CommerceOrdersAction',
17
- description: 'Returns persisted Order records with customer context and item counts for dashboard management.',
17
+ description: 'Returns one page of Order records with customer context, item counts and store-wide totals.',
18
18
  method: 'GET',
19
19
  apiResponse: true,
20
20
 
21
- async handle() {
22
- try {
23
- const orders = await Order.orderBy('created_at', 'desc').limit(500).get()
24
- const orderIds = new Set(orders.map(order =>
25
- commerceIdentifier(commerceValue(order, 'id', 'uuid'), 'Order'),
26
- ))
27
- const numericOrderIds = [...orderIds].map(Number).filter(Number.isSafeInteger)
28
- const [customers, coupons, items] = await Promise.all([
29
- Customer.orderBy('name', 'asc').limit(500).get(),
30
- Coupon.orderBy('id', 'asc').limit(500).get(),
31
- numericOrderIds.length > 0 ? OrderItem.whereIn('order_id', numericOrderIds).get() : [],
32
- ])
33
- const customerContexts = customers.map(normalizeOrderCustomerContext)
34
- const customerMap = new Map(customerContexts.map(customer => [customer.id, customer.context]))
35
- const couponIds = new Set(coupons.map(normalizeOrderCouponId))
36
- const itemCounts = new Map<string, number>()
37
- for (const item of items)
38
- addOrderItemQuantity(item, orderIds, itemCounts)
21
+ async handle(request: RequestInstance) {
22
+ const query = parseOrderListQuery(key => request.get<unknown>(key, ''))
23
+ if ('error' in query)
24
+ return response.json({ message: query.error }, 422)
39
25
 
40
- const records = orders.map(order =>
41
- normalizeCommerceOrderRecord(order, customerMap, itemCounts, couponIds),
42
- )
43
- const defaultStatuses = ['PENDING', 'PREPARING', 'READY', 'DELIVERED', 'CANCELED']
44
- const defaultTypes = ['DINE_IN', 'TAKEOUT', 'DELIVERY']
26
+ try {
27
+ // The order dialog searches its customers itself
28
+ // (CommerceOrderCustomersAction), rather than this sending 500 of them.
29
+ const orders = await readOrderPage(query)
45
30
  return {
46
- records,
47
- summary: summarizeCommerceOrders(records),
48
- customers: customers
49
- .map(normalizeOrderCustomerOption)
50
- .sort((left, right) => left.label.localeCompare(right.label)),
51
- statuses: [...new Set([...defaultStatuses, ...records.map(record => record.status)])],
52
- orderTypes: [...new Set([...defaultTypes, ...records.map(record => record.orderType)])],
31
+ records: orders.records,
32
+ total: orders.total,
33
+ page: orders.page,
34
+ perPage: query.perPage,
35
+ summary: orders.summary,
36
+ statuses: orders.statuses,
37
+ orderTypes: orders.orderTypes,
53
38
  defaultCurrency: commerceCurrency(config.commerce?.currency, 'Commerce configuration'),
54
39
  }
55
40
  }
@@ -0,0 +1,43 @@
1
+ import type { RequestInstance } from '@stacksjs/types'
2
+ import { Action } from '@stacksjs/actions/runtime'
3
+ import { minorToInput } from '@stacksjs/commerce/money'
4
+ import { response } from '@stacksjs/router'
5
+ import { dashboardOperationalError } from '../dashboard-response'
6
+ import { ordersCsv, parseOrderListQuery, readOrdersForExport } from './commerce-order-list'
7
+
8
+ /**
9
+ * `GET /api/dashboard/commerce/orders/export` - every order matching the Orders
10
+ * page's search, filters and sort, as CSV (stacksjs/stacks#3218).
11
+ *
12
+ * The page used to build the file from the orders it had loaded, so an export
13
+ * held at most the newest 500 orders, whatever the filters matched.
14
+ */
15
+ export default new Action({
16
+ name: 'CommerceOrdersExportAction',
17
+ description: 'Exports every order matching the Orders page filters as CSV.',
18
+ method: 'GET',
19
+ apiResponse: false,
20
+
21
+ async handle(request: RequestInstance) {
22
+ const query = parseOrderListQuery(key => request.get<unknown>(key, ''))
23
+ if ('error' in query)
24
+ return response.json({ message: query.error }, 422)
25
+
26
+ try {
27
+ const csv = ordersCsv(await readOrdersForExport(query), minorToInput)
28
+ const day = new Date().toISOString().slice(0, 10)
29
+ return new Response(csv, {
30
+ status: 200,
31
+ headers: {
32
+ 'Cache-Control': 'private, no-store',
33
+ 'Content-Disposition': `attachment; filename="orders-${day}.csv"`,
34
+ 'Content-Type': 'text/csv; charset=utf-8',
35
+ 'X-Content-Type-Options': 'nosniff',
36
+ },
37
+ })
38
+ }
39
+ catch (error) {
40
+ return dashboardOperationalError(error, 'Orders could not be exported.', 'CommerceOrdersExportAction')
41
+ }
42
+ },
43
+ })
@@ -1,34 +1,37 @@
1
+ import type { RequestInstance } from '@stacksjs/types'
1
2
  import { Action } from '@stacksjs/actions/runtime'
2
- import { Customer, Order, Payment } from '@stacksjs/orm'
3
+ import { response } from '@stacksjs/router'
3
4
  import { dashboardOperationalError } from '../dashboard-response'
4
- import { commerceIdentifier, commerceValue } from './commerce-record'
5
- import { normalizePaymentRecord, summarizePayments } from './payment-records'
5
+ import { parsePaymentListQuery, readPaymentPage } from './commerce-payment-list'
6
6
 
7
+ /**
8
+ * `GET /api/dashboard/commerce/payments` - one page of payments, searched,
9
+ * filtered, sorted, counted and summarised by the database
10
+ * (commerce-payment-list.ts, stacksjs/stacks#3218). It used to return the
11
+ * newest 500 for the browser to do all of that with.
12
+ */
7
13
  export default new Action({
8
14
  name: 'CommercePaymentsAction',
9
- description: 'Returns persisted commerce payments and currency-safe summaries.',
15
+ description: 'Returns one page of persisted commerce payments with currency-safe summaries of the match.',
10
16
  method: 'GET',
11
17
  apiResponse: true,
12
18
 
13
- async handle() {
19
+ async handle(request: RequestInstance) {
20
+ const query = parsePaymentListQuery(key => request.get<unknown>(key, ''))
21
+ if ('error' in query)
22
+ return response.json({ message: query.error }, 422)
23
+
14
24
  try {
15
- const [paymentRows, orders, customers] = await Promise.all([
16
- Payment.orderByDesc('id').limit(500).get(),
17
- Order.orderBy('id', 'asc').limit(500).get(),
18
- Customer.orderBy('id', 'asc').limit(500).get(),
19
- ])
20
- const orderIds = new Set(orders.map(order =>
21
- commerceIdentifier(commerceValue(order, 'id', 'uuid'), 'Order'),
22
- ))
23
- const customerIds = new Set(customers.map(customer =>
24
- commerceIdentifier(commerceValue(customer, 'id', 'uuid'), 'Customer'),
25
- ))
26
- const records = paymentRows.map(payment =>
27
- normalizePaymentRecord(payment, { orderIds, customerIds }),
28
- )
25
+ const payments = await readPaymentPage(query)
29
26
  return {
30
- records,
31
- summary: summarizePayments(records),
27
+ records: payments.records,
28
+ total: payments.total,
29
+ page: payments.page,
30
+ perPage: query.perPage,
31
+ summary: payments.summary,
32
+ breakdown: payments.breakdown,
33
+ statuses: payments.statuses,
34
+ methods: payments.methods,
32
35
  }
33
36
  }
34
37
  catch (error) {