@stacksjs/defaults 0.75.618 → 0.75.622

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 (94) hide show
  1. package/ai/skills/stacks-actions/SKILL.md +1 -1
  2. package/ai/skills/stacks-auth/SKILL.md +12 -1
  3. package/ai/skills/stacks-auto-imports/SKILL.md +1 -1
  4. package/ai/skills/stacks-buddy/SKILL.md +70 -7
  5. package/ai/skills/stacks-commerce/SKILL.md +78 -4
  6. package/ai/skills/stacks-dashboard/SKILL.md +32 -2
  7. package/ai/skills/stacks-database/SKILL.md +1 -1
  8. package/ai/skills/stacks-development/SKILL.md +3 -0
  9. package/ai/skills/stacks-migrations/SKILL.md +10 -2
  10. package/ai/skills/stacks-mobile/SKILL.md +21 -2
  11. package/ai/skills/stacks-models/SKILL.md +2 -2
  12. package/ai/skills/stacks-native/CATALOG.md +21 -21
  13. package/ai/skills/stacks-orm/SKILL.md +2 -2
  14. package/ai/skills/stacks-utils/SKILL.md +8 -3
  15. package/app/Actions/Dashboard/Commerce/CommerceDiscountDestroyAction.ts +27 -0
  16. package/app/Actions/Dashboard/Commerce/CommerceDiscountStoreAction.ts +28 -0
  17. package/app/Actions/Dashboard/Commerce/CommerceDiscountUpdateAction.ts +30 -0
  18. package/app/Actions/Dashboard/Commerce/CommerceDiscountsAction.ts +42 -0
  19. package/app/Actions/Dashboard/Commerce/CommerceUpsellDestroyAction.ts +31 -0
  20. package/app/Actions/Dashboard/Commerce/CommerceUpsellDetailAction.ts +28 -0
  21. package/app/Actions/Dashboard/Commerce/CommerceUpsellStoreAction.ts +26 -0
  22. package/app/Actions/Dashboard/Commerce/CommerceUpsellUpdateAction.ts +29 -0
  23. package/app/Actions/Dashboard/Commerce/CommerceUpsellsAction.ts +40 -0
  24. package/app/Actions/Dashboard/Commerce/commerce-discount-list.ts +204 -0
  25. package/app/Actions/Dashboard/Commerce/commerce-discount-write.ts +53 -0
  26. package/app/Actions/Dashboard/Commerce/commerce-discounts-upsells.test.ts +228 -0
  27. package/app/Actions/Dashboard/Commerce/commerce-upsell-list.ts +289 -0
  28. package/app/Actions/Dashboard/Commerce/discount-records.ts +392 -0
  29. package/app/Actions/Dashboard/Commerce/upsell-offer-records.ts +307 -0
  30. package/app/Actions/Dashboard/Models/ModelSaveAction.ts +6 -1
  31. package/app/Actions/Dashboard/Models/model-relations.ts +17 -7
  32. package/app/Actions/Dashboard/Models/model-row-writes.ts +9 -8
  33. package/app/Actions/Dashboard/Models/model-write.ts +51 -2
  34. package/app/Actions/Dashboard/Remote/RemoteCommandRunAction.ts +1 -2
  35. package/app/Actions/Dashboard/Remote/RemoteTerminalCloseAction.ts +1 -2
  36. package/app/Actions/Dashboard/Remote/RemoteTerminalInputAction.ts +1 -2
  37. package/app/Actions/Dashboard/Remote/RemoteTerminalOpenAction.ts +1 -2
  38. package/app/Actions/Dashboard/Remote/RemoteTerminalResizeAction.ts +1 -2
  39. package/app/Actions/Dashboard/Remote/RemoteTerminalStreamAction.ts +1 -2
  40. package/app/Actions/Dashboard/Remote/remote-commands.test.ts +2 -2
  41. package/app/Actions/Dashboard/Remote/remote-commands.ts +4 -4
  42. package/app/Actions/Dashboard/Remote/remote-terminal.test.ts +45 -25
  43. package/app/Actions/Dashboard/Remote/remote-terminal.ts +9 -9
  44. package/app/Actions/Storefront/AcceptOrderOfferAction.ts +68 -0
  45. package/app/Actions/Storefront/ApplyDiscountCodeAction.ts +83 -0
  46. package/app/Actions/Storefront/DeclineOrderOfferAction.ts +25 -0
  47. package/app/Actions/Storefront/PlaceOrderAction.ts +135 -72
  48. package/app/Gates.ts +4 -4
  49. package/app/Mail/OrderConfirmation.ts +7 -1
  50. package/app/Models/commerce/Cart.ts +14 -0
  51. package/app/Models/commerce/Discount.ts +255 -0
  52. package/app/Models/commerce/PostPurchaseOffer.ts +175 -0
  53. package/app/Models/commerce/PostPurchaseOfferResponse.ts +145 -0
  54. package/app/Policies/PostPolicy.ts +11 -11
  55. package/app/Storefront/DiscountCodeMessages.ts +12 -0
  56. package/app/Storefront/OrderKey.ts +29 -0
  57. package/app/Storefront/StorefrontPricing.ts +211 -0
  58. package/app/Storefront/UpsellCharge.ts +43 -0
  59. package/functions/projects.test.ts +38 -0
  60. package/functions/projects.ts +99 -0
  61. package/ide/vscode/package.json +1 -1
  62. package/package.json +7 -7
  63. package/resources/components/Dashboard/Commerce/CommerceDiscountBreakdown.stx +72 -0
  64. package/resources/components/Dashboard/Commerce/CommerceDiscountDeleteDialog.stx +19 -0
  65. package/resources/components/Dashboard/Commerce/CommerceDiscountDetailsDialog.stx +110 -0
  66. package/resources/components/Dashboard/Commerce/CommerceDiscountDialog.stx +353 -0
  67. package/resources/components/Dashboard/Commerce/CommerceDiscountsDashboard.stx +211 -0
  68. package/resources/components/Dashboard/Commerce/CommerceDiscountsTable.stx +105 -0
  69. package/resources/components/Dashboard/Commerce/CommerceProductPicker.stx +115 -0
  70. package/resources/components/Dashboard/Commerce/CommerceUpsellDeleteDialog.stx +21 -0
  71. package/resources/components/Dashboard/Commerce/CommerceUpsellDetailsDialog.stx +153 -0
  72. package/resources/components/Dashboard/Commerce/CommerceUpsellDialog.stx +191 -0
  73. package/resources/components/Dashboard/Commerce/CommerceUpsellsDashboard.stx +214 -0
  74. package/resources/components/Dashboard/Commerce/CommerceUpsellsTable.stx +91 -0
  75. package/resources/components/Dashboard/Email/InboxSettingsDashboard.stx +4 -19
  76. package/resources/components/Dashboard/ProjectSwitcher.stx +302 -0
  77. package/resources/components/Dashboard/Settings/SettingsDashboard.stx +5 -3
  78. package/resources/components/Dashboard/UI/SearchFilter.stx +7 -4
  79. package/resources/components/Storefront/OrderSummary.stx +17 -0
  80. package/resources/functions/dashboard/project-switcher.test.ts +14 -0
  81. package/resources/functions/dashboard/project-switcher.ts +28 -0
  82. package/resources/functions/dashboard/sidebar.ts +4 -1
  83. package/resources/plugins/preloader.ts +33 -2
  84. package/resources/views/cart.stx +50 -16
  85. package/resources/views/checkout/contact.stx +11 -5
  86. package/resources/views/checkout/payment.stx +11 -5
  87. package/resources/views/checkout/shipping.stx +11 -5
  88. package/resources/views/orders/[id].stx +227 -50
  89. package/routes/dashboard-api.ts +12 -0
  90. package/routes/dashboard.ts +2 -0
  91. package/routes/storefront.ts +8 -0
  92. package/views/dashboard/commerce/discounts/index.stx +10 -0
  93. package/views/dashboard/commerce/upsells/index.stx +10 -0
  94. package/views/dashboard/layouts/default.stx +17 -0
@@ -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) | 123 |
14
+ | `@stacksjs/actions` | [`stacks-actions`](../stacks-actions/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/index.ts) | 127 |
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) | 24 |
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) | 136 |
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) | 10 |
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) | 212 |
24
+ | `@stacksjs/buddy` | [`stacks-buddy`](../stacks-buddy/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/src/index.ts) | 213 |
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) | 7 |
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 |
@@ -31,11 +31,11 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
31
31
  | `@stacksjs/cloud` | [`stacks-cloud`](../stacks-cloud/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cloud/src/index.ts) | 10 |
32
32
  | `@stacksjs/cms` | [`stacks-cms`](../stacks-cms/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/cms/src/index.ts) | 5 |
33
33
  | `@stacksjs/collections` | [`stacks-collections`](../stacks-collections/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/collections/src/index.ts) | 2 |
34
- | `@stacksjs/commerce` | [`stacks-commerce`](../stacks-commerce/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/index.ts) | 15 |
34
+ | `@stacksjs/commerce` | [`stacks-commerce`](../stacks-commerce/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/index.ts) | 16 |
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) | 17 |
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) | 147 |
38
+ | `@stacksjs/database` | [`stacks-database`](../stacks-database/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/database/src/index.ts) | 148 |
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) | 3 |
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 |
@@ -55,10 +55,10 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
55
55
  | `@stacksjs/git` | [`stacks-git`](../stacks-git/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/git/src/index.ts) | 2 |
56
56
  | `@stacksjs/github` | [`stacks-git`](../stacks-git/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/github/src/index.ts) | 8 |
57
57
  | `@stacksjs/health` | [`stacks-health`](../stacks-health/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/health/src/index.ts) | 2 |
58
- | `@stacksjs/hq` | [`stacks-hq`](../stacks-hq/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/src/index.ts) | 10 |
58
+ | `@stacksjs/hq` | [`stacks-hq`](../stacks-hq/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/src/index.ts) | 11 |
59
59
  | `@stacksjs/http` | [`stacks-http`](../stacks-http/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/http/src/index.ts) | 4 |
60
60
  | `@stacksjs/i18n` | [`stacks-i18n`](../stacks-i18n/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/i18n/src/index.ts) | 7 |
61
- | `@stacksjs/image` | [`stacks-image`](../stacks-image/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/image/src/index.ts) | 4 |
61
+ | `@stacksjs/image` | [`stacks-image`](../stacks-image/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/image/src/index.ts) | 5 |
62
62
  | `@stacksjs/lint` | [`stacks-lint`](../stacks-lint/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/lint/src/index.ts) | 3 |
63
63
  | `@stacksjs/logging` | [`stacks-logging`](../stacks-logging/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/logging/src/index.ts) | 14 |
64
64
  | `@stacksjs/mobile` | [`stacks-mobile`](../stacks-mobile/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/mobile/src/index.ts) | 23 |
@@ -68,7 +68,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
68
68
  | `@stacksjs/objects` | [`stacks-objects`](../stacks-objects/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/objects/src/index.ts) | 10 |
69
69
  | `@stacksjs/orm` | [`stacks-orm`](../stacks-orm/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/index.ts) | 79 |
70
70
  | `@stacksjs/pagination` | [`stacks-pagination`](../stacks-pagination/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/pagination/src/index.ts) | 1 |
71
- | `@stacksjs/path` | [`stacks-path`](../stacks-path/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/path/src/index.ts) | 13 |
71
+ | `@stacksjs/path` | [`stacks-path`](../stacks-path/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/path/src/index.ts) | 14 |
72
72
  | `@stacksjs/payments` | [`stacks-payments`](../stacks-payments/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/payments/src/index.ts) | 40 |
73
73
  | `@stacksjs/push` | [`stacks-push`](../stacks-push/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/push/src/index.ts) | 8 |
74
74
  | `@stacksjs/query-builder` | [`stacks-query-builder`](../stacks-query-builder/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/query-builder/src/index.ts) | 7 |
@@ -91,7 +91,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
91
91
  | `@stacksjs/strings` | [`stacks-strings`](../stacks-strings/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/strings/src/index.ts) | 12 |
92
92
  | `@stacksjs/support` | [`stacks-support`](../stacks-support/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/support/src/index.ts) | 6 |
93
93
  | `@stacksjs/telephony` | [`stacks-telephony`](../stacks-telephony/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/telephony/src/index.ts) | 5 |
94
- | `@stacksjs/testing` | [`stacks-testing`](../stacks-testing/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/index.ts) | 24 |
94
+ | `@stacksjs/testing` | [`stacks-testing`](../stacks-testing/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/index.ts) | 25 |
95
95
  | `@stacksjs/tinker` | [`stacks-repl`](../stacks-repl/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tinker/src/index.ts) | 4 |
96
96
  | `@stacksjs/tunnel` | [`stacks-tunnel`](../stacks-tunnel/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/tunnel/src/index.ts) | 1 |
97
97
  | `@stacksjs/types` | [`stacks-types`](../stacks-types/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/types/src/index.ts) | 3 |
@@ -122,7 +122,7 @@ Declared runtime exports: `BlogAdminError`, `DEFAULT_IOS_DEPENDENCIES`, `DEFAULT
122
122
 
123
123
  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/reviewos-workflows.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/actions/src/reviewos-workflows.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).
124
124
 
125
- Evidence directory: [123 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.
125
+ Evidence directory: [127 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.
126
126
 
127
127
  ### @stacksjs/ai
128
128
 
@@ -222,7 +222,7 @@ Read the entrypoint and package export map for re-exported or type-only surfaces
222
222
 
223
223
  Local source modules: [src/commands/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/src/commands/index.ts).
224
224
 
225
- Evidence directory: [212 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.
225
+ Evidence directory: [213 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.
226
226
 
227
227
  ### @stacksjs/build
228
228
 
@@ -316,11 +316,11 @@ Evidence directory: [2 retained tests](https://github.com/stacksjs/stacks/blob/m
316
316
 
317
317
  Guidance: [`stacks-commerce`](../stacks-commerce/SKILL.md). Source: [storage/framework/core/commerce/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/index.ts).
318
318
 
319
- Declared runtime exports: `PriceFormatError`, `auctions`, `breakdownFor`, `carts`, `catalog`, `catalogImport`, `commerce`, `coupons`, `currencyExponent`, `customers`, `decimalToMinor`, `default`, `devices`, `errors`, `formatCurrency`, `formatMinor`, `giftCards`, `licensing`, `minorToDecimal`, `minorToInput`, `minorToMajor`, `money`, `moneyInputError`, `moneyInputStep`, `multiplierOf`, `orders`, `parseMoneyInput`, `parseSalesTaxSetup`, `parseTaxRateWriteData`, `payments`, `products`, `receiptLinesText`, `receipts`, `register`, `releases`, `restaurant`, `restockedQuantity`, `shippings`, `tax`, `waitlists`.
319
+ Declared runtime exports: `PriceFormatError`, `auctions`, `breakdownFor`, `carts`, `catalog`, `catalogImport`, `commerce`, `coupons`, `currencyExponent`, `customers`, `decimalToMinor`, `default`, `devices`, `discounts`, `errors`, `formatCurrency`, `formatMinor`, `giftCards`, `licensing`, `minorToDecimal`, `minorToInput`, `minorToMajor`, `money`, `moneyInputError`, `moneyInputStep`, `multiplierOf`, `orders`, `parseMoneyInput`, `parseSalesTaxSetup`, `parseTaxRateWriteData`, `payments`, `products`, `receiptLinesText`, `receipts`, `register`, `releases`, `restaurant`, `restockedQuantity`, `shippings`, `tax`, `upsells`, `waitlists`.
320
320
 
321
- Local source modules: [src/auctions/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/auctions/index.ts), [src/carts/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/carts/index.ts), [src/catalog.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/catalog.ts), [src/coupons/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/coupons/index.ts), [src/customers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/customers/index.ts), [src/devices/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/devices/index.ts), [src/errors/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/errors/index.ts), [src/gift-cards/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/gift-cards/index.ts), [src/imports/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/imports/index.ts), [src/inventory.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/inventory.ts), [src/licensing/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/licensing/index.ts), [src/money.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/money.ts), [src/orders/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/orders/index.ts), [src/payments/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/payments/index.ts), [src/products/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/products/index.ts), [src/receipt-text.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/receipt-text.ts), [src/receipts/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/receipts/index.ts), [src/register.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/register.ts), [src/releases.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/releases.ts), [src/sales-tax.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/sales-tax.ts), [src/shippings/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/shippings/index.ts), [src/tax-input.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/tax-input.ts), [src/tax/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/tax/index.ts), [src/waitlists/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/waitlists/index.ts), [src/waitlists/restaurant/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/waitlists/restaurant/index.ts).
321
+ Local source modules: [src/auctions/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/auctions/index.ts), [src/carts/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/carts/index.ts), [src/catalog.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/catalog.ts), [src/coupons/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/coupons/index.ts), [src/customers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/customers/index.ts), [src/devices/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/devices/index.ts), [src/discounts/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/discounts/index.ts), [src/errors/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/errors/index.ts), [src/gift-cards/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/gift-cards/index.ts), [src/imports/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/imports/index.ts), [src/inventory.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/inventory.ts), [src/licensing/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/licensing/index.ts), [src/money.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/money.ts), [src/orders/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/orders/index.ts), [src/payments/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/payments/index.ts), [src/products/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/products/index.ts), [src/receipt-text.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/receipt-text.ts), [src/receipts/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/receipts/index.ts), [src/register.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/register.ts), [src/releases.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/releases.ts), [src/sales-tax.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/sales-tax.ts), [src/shippings/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/shippings/index.ts), [src/tax-input.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/tax-input.ts), [src/tax/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/tax/index.ts), [src/upsells/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/upsells/index.ts), [src/waitlists/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/waitlists/index.ts), [src/waitlists/restaurant/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/src/waitlists/restaurant/index.ts).
322
322
 
323
- Evidence directory: [15 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
323
+ Evidence directory: [16 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/commerce/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
324
324
 
325
325
  ### @stacksjs/composables
326
326
 
@@ -360,7 +360,7 @@ Declared runtime exports: `Database`, `EntityQueryBuilder`, `__flushAfterCommitN
360
360
 
361
361
  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).
362
362
 
363
- Evidence directory: [147 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.
363
+ Evidence directory: [148 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.
364
364
 
365
365
  ### @stacksjs/datetime
366
366
 
@@ -550,7 +550,7 @@ Read the entrypoint and package export map for re-exported or type-only surfaces
550
550
 
551
551
  Local source modules: [src/client.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/src/client.ts), [src/meter.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/src/meter.ts), [src/service.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/src/service.ts).
552
552
 
553
- Evidence directory: [10 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
553
+ Evidence directory: [11 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/hq/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
554
554
 
555
555
  ### @stacksjs/http
556
556
 
@@ -580,7 +580,7 @@ Declared runtime exports: `ImageBuilder`, `image`, `imageResponseHeaders`, `nego
580
580
 
581
581
  Local source modules: [src/app-icons.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/image/src/app-icons.ts), [src/app-store.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/image/src/app-store.ts), [src/fonts.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/image/src/fonts.ts), [src/generate.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/image/src/generate.ts), [src/social.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/image/src/social.ts), [src/splash.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/image/src/splash.ts), [src/theme.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/image/src/theme.ts), [src/upload.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/image/src/upload.ts).
582
582
 
583
- Evidence directory: [4 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/image/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
583
+ Evidence directory: [5 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/image/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
584
584
 
585
585
  ### @stacksjs/lint
586
586
 
@@ -650,7 +650,7 @@ Evidence directory: [10 retained tests](https://github.com/stacksjs/stacks/blob/
650
650
 
651
651
  Guidance: [`stacks-orm`](../stacks-orm/SKILL.md). Source: [storage/framework/core/orm/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/index.ts).
652
652
 
653
- Declared runtime exports: `Activity`, `AnalyticsEvent`, `Auction`, `AuctionItem`, `Author`, `Automation`, `AutomationRun`, `BILLABLE_INSTANCE_METHODS`, `Bid`, `Board`, `BoardColumn`, `Campaign`, `CampaignSend`, `CampaignVariant`, `Card`, `CardAttachment`, `CardComment`, `Cart`, `CartItem`, `Categorizable`, `Category`, `Comment`, `CommunicationSuppression`, `ConsentEvent`, `Coupon`, `Courier`, `CourierPing`, `Customer`, `DeliveryRoute`, `DeliveryStop`, `Deployment`, `DigitalDelivery`, `EmailIdempotency`, `EmailList`, `EmailListSubscriber`, `EmailSuppression`, `EmailWebhookEvent`, `ErrorModel`, `FailedJob`, `FeedbackToken`, `Form`, `FormField`, `FormSubmission`, `GdprRequest`, `GiftCard`, `Job`, `Label`, `LicenseActivation`, `LicenseKey`, `LicenseSeat`, `Log`, `LoyaltyPoint`, `LoyaltyReward`, `MagicLinkToken`, `MailPreference`, `Manufacturer`, `Menu`, `MenuItem`, `ModelUnavailableError`, `Notification`, `NotificationDelivery`, `Order`, `OrderIdempotency`, `OrderItem`, `Page`, `PageRevision`, `Payment`, `PaymentMethod`, `PaymentProduct`, `PaymentTransaction`, `PaymentWebhookEvent`, `PersonalAccessToken`, `Pledge`, `Post`, `PrintDevice`, `Product`, `ProductUnit`, `ProductVariant`, `QueryLog`, `QueueWorker`, `Receipt`, `Redirect`, `Referral`, `ReferralCode`, `Release`, `Request`, `Review`, `SenderDomain`, `ShippingMethod`, `ShippingRate`, `ShippingZone`, `Site`, `SiteDomain`, `SmsOptOut`, `SocialAccount`, `SocialPost`, `StorageItem`, `StorageItemTask`, `Subscriber`, `SubscriberEmail`, `Subscription`, `SubscriptionNotOwnedError`, `Tag`, `TaxRate`, `Team`, `TeamInvitation`, `TeamMember`, `Transaction`, `UsageEvent`, `User`, `WaitlistProduct`, `WaitlistRestaurant`, `Websocket`, `buildDatabaseSchema`, `collectEncryptedAttributes`, `createAuditMethods`, `createCategorizableMethods`, `createCommentableMethods`, `createLikeableMethods`, `createTaggableMethods`, `customerOwnership`, `decryptValue`, `decryptValueInPlace`, `encryptValue`, `enrichPaginatorUrls`, `filterFillable`, `frameworkModelFeature`, `getWritableFields`, `isBillable`, `isCursorPaginator`, `isEncrypted`, `isPaginator`, `isSimplePaginator`, `isUniqueViolation`, `mapWriteError`, `modelGlobalNames`, `ormReady`, `parentOwnership`, `parseCursor`, `renderDatabaseTypeFile`, `resolveCursorArgs`, `resolvePageArgs`, `selfOwnership`, `setAuditUser`, `siteOwnership`, `teamMembershipOwnership`, `toCursorPaginator`, `toPaginator`, `toSimplePaginator`, `toSnakeCaseKeys`.
653
+ Declared runtime exports: `Activity`, `AnalyticsEvent`, `Auction`, `AuctionItem`, `Author`, `Automation`, `AutomationRun`, `BILLABLE_INSTANCE_METHODS`, `Bid`, `Board`, `BoardColumn`, `Campaign`, `CampaignSend`, `CampaignVariant`, `Card`, `CardAttachment`, `CardComment`, `Cart`, `CartItem`, `Categorizable`, `Category`, `Comment`, `CommunicationSuppression`, `ConsentEvent`, `Coupon`, `Courier`, `CourierPing`, `Customer`, `DeliveryRoute`, `DeliveryStop`, `Deployment`, `DigitalDelivery`, `Discount`, `EmailIdempotency`, `EmailList`, `EmailListSubscriber`, `EmailSuppression`, `EmailWebhookEvent`, `ErrorModel`, `FailedJob`, `FeedbackToken`, `Form`, `FormField`, `FormSubmission`, `GdprRequest`, `GiftCard`, `Job`, `Label`, `LicenseActivation`, `LicenseKey`, `LicenseSeat`, `Log`, `LoyaltyPoint`, `LoyaltyReward`, `MagicLinkToken`, `MailPreference`, `Manufacturer`, `Menu`, `MenuItem`, `ModelUnavailableError`, `Notification`, `NotificationDelivery`, `Order`, `OrderIdempotency`, `OrderItem`, `Page`, `PageRevision`, `Payment`, `PaymentMethod`, `PaymentProduct`, `PaymentTransaction`, `PaymentWebhookEvent`, `PersonalAccessToken`, `Pledge`, `Post`, `PostPurchaseOffer`, `PostPurchaseOfferResponse`, `PrintDevice`, `Product`, `ProductUnit`, `ProductVariant`, `QueryLog`, `QueueWorker`, `Receipt`, `Redirect`, `Referral`, `ReferralCode`, `Release`, `Request`, `Review`, `SenderDomain`, `ShippingMethod`, `ShippingRate`, `ShippingZone`, `Site`, `SiteDomain`, `SmsOptOut`, `SocialAccount`, `SocialPost`, `StorageItem`, `StorageItemTask`, `Subscriber`, `SubscriberEmail`, `Subscription`, `SubscriptionNotOwnedError`, `Tag`, `TaxRate`, `Team`, `TeamInvitation`, `TeamMember`, `Transaction`, `UsageEvent`, `User`, `WaitlistProduct`, `WaitlistRestaurant`, `Websocket`, `buildDatabaseSchema`, `collectEncryptedAttributes`, `createAuditMethods`, `createCategorizableMethods`, `createCommentableMethods`, `createLikeableMethods`, `createTaggableMethods`, `customerOwnership`, `decryptValue`, `decryptValueInPlace`, `encryptValue`, `enrichPaginatorUrls`, `filterFillable`, `frameworkModelFeature`, `getWritableFields`, `isBillable`, `isCursorPaginator`, `isEncrypted`, `isPaginator`, `isSimplePaginator`, `isUniqueViolation`, `mapWriteError`, `modelGlobalNames`, `ormReady`, `parentOwnership`, `parseCursor`, `renderDatabaseTypeFile`, `resolveCursorArgs`, `resolvePageArgs`, `selfOwnership`, `setAuditUser`, `siteOwnership`, `teamMembershipOwnership`, `toCursorPaginator`, `toPaginator`, `toSimplePaginator`, `toSnakeCaseKeys`.
654
654
 
655
655
  Local source modules: [src/auto-crud.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/auto-crud.ts), [src/batch-loader.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/batch-loader.ts), [src/db.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/db.ts), [src/define-model.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/define-model.ts), [src/extend-model.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/extend-model.ts), [src/gdpr/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/gdpr/index.ts), [src/generate-database-schema.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/generate-database-schema.ts), [src/locked-row.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/locked-row.ts), [src/messaging.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/messaging.ts), [src/model-types.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/model-types.ts), [src/ownership.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/ownership.ts), [src/paginator-request.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/paginator-request.ts), [src/row-token.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/row-token.ts), [src/subquery.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/subquery.ts), [src/traits/audit.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/traits/audit.ts), [src/traits/billable.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/traits/billable.ts), [src/traits/categorizable.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/traits/categorizable.ts), [src/traits/commentable.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/traits/commentable.ts), [src/traits/likeable.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/traits/likeable.ts), [src/traits/taggable.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/traits/taggable.ts), [src/transaction.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/transaction.ts), [src/types.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/types.ts), [src/utils/encrypted.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/utils/encrypted.ts), [src/utils/prunable.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/orm/src/utils/prunable.ts).
656
656
 
@@ -668,11 +668,11 @@ Evidence directory: [1 retained tests](https://github.com/stacksjs/stacks/blob/m
668
668
 
669
669
  Guidance: [`stacks-path`](../stacks-path/SKILL.md). Source: [storage/framework/core/path/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/path/src/index.ts).
670
670
 
671
- Declared runtime exports: `DEFAULTS_SYNC_MARKER`, `actionRunnerPath`, `actionsPath`, `aiPath`, `aliasPath`, `analyticsPath`, `appPath`, `applyRuntimeDirectoryEnv`, `arraysPath`, `assetsPath`, `authPath`, `basename`, `browserPath`, `buddyPath`, `buildEnginePath`, `buildPath`, `builtUserActionsPath`, `cachePath`, `chartsPath`, `chatPath`, `cliPath`, `cloudPath`, `cloudStatePath`, `collectionsPath`, `commandsPath`, `componentsPath`, `configPath`, `coreApiPath`, `coreEnvPath`, `corePath`, `coreStoragePath`, `customElementsDataPath`, `databasePath`, `datetimePath`, `defaultsAppPath`, `defaultsPackagePath`, `defaultsPath`, `defaultsResourcesPath`, `delimiter`, `desktopPath`, `developmentPath`, `dirname`, `dnsPath`, `docsPath`, `emailPath`, `ensureRuntimeDirectories`, `enumsPath`, `errorHandlingPath`, `eslintPluginPath`, `eventsPath`, `examplesPath`, `extname`, `fakerPath`, `featureFlagsPath`, `featuresPath`, `findProjectPath`, `frameworkCloudPath`, `frameworkDefaultsRoot`, `frameworkPath`, `frameworkRuntimePath`, `functionsPath`, `gitPath`, `healthPath`, `homeDir`, `inspectDefaultsProvenance`, `installedDefaultsVersion`, `isAbsolute`, `isCompiledBinary`, `isInstalledDefaultsRoot`, `jobsPath`, `join`, `langPath`, `layoutsPath`, `libraryPackagePath`, `libsEntriesPath`, `libsPath`, `linkPackagedDefaults`, `lintPath`, `listenersPath`, `loggingPath`, `logsPath`, `mergeDirectoryInto`, `modelMetaPath`, `modelsPath`, `modulesPath`, `newsletterPath`, `normalize`, `notificationsPath`, `objectsPath`, `onboardingPath`, `ormPath`, `packagedDefaultsRoot`, `paginationPath`, `path`, `pathPath`, `paymentsPath`, `projectConfigPath`, `projectPath`, `publicPath`, `pushPath`, `queryBuilderPath`, `queuePath`, `realtimePath`, `relative`, `relativeActionsPath`, `replPath`, `resolve`, `resolveModulePath`, `resolveUserLibBase`, `resourcesPath`, `routerPath`, `routesPath`, `runtimeDirectoryEnv`, `runtimePath`, `schedulerPath`, `scriptsPath`, `searchEnginePath`, `securityPath`, `sep`, `serverPath`, `serverlessPath`, `settingsPath`, `shellPath`, `siteConfigPath`, `skillsPath`, `slugPath`, `smsPath`, `socialsPath`, `stacksBackupPath`, `stacksLockPath`, `stacksPath`, `storagePath`, `storesPath`, `stringsPath`, `stxPath`, `testingPath`, `testsPath`, `tinkerPath`, `toNamespacedPath`, `typesPath`, `uiPath`, `userActionsPath`, `userComponentsPath`, `userControllersPath`, `userDatabasePath`, `userEmailsPath`, `userEventsPath`, `userFunctionsPath`, `userJobsPath`, `userLibsPath`, `userListenersPath`, `userMailPath`, `userMiddlewarePath`, `userMigrationsPath`, `userModelsPath`, `userNotificationsPath`, `userServerPath`, `userViewsPath`, `usesVendoredDefaults`, `utilsPath`, `validationPath`, `viewsPath`.
671
+ Declared runtime exports: `DEFAULTS_SYNC_MARKER`, `actionRunnerPath`, `actionsPath`, `aiPath`, `aliasPath`, `analyticsPath`, `appPath`, `applyRuntimeDirectoryEnv`, `arraysPath`, `assetsPath`, `authPath`, `basename`, `browserPath`, `buddyPath`, `buildEnginePath`, `buildPath`, `builtUserActionsPath`, `cachePath`, `chartsPath`, `chatPath`, `clearProjectService`, `cliPath`, `cloudPath`, `cloudStatePath`, `collectionsPath`, `commandsPath`, `componentsPath`, `configPath`, `coreApiPath`, `coreEnvPath`, `corePath`, `coreStoragePath`, `customElementsDataPath`, `databasePath`, `datetimePath`, `defaultsAppPath`, `defaultsPackagePath`, `defaultsPath`, `defaultsResourcesPath`, `delimiter`, `desktopPath`, `developmentPath`, `dirname`, `dnsPath`, `docsPath`, `emailPath`, `ensureRuntimeDirectories`, `enumsPath`, `errorHandlingPath`, `eslintPluginPath`, `eventsPath`, `examplesPath`, `extname`, `fakerPath`, `featureFlagsPath`, `featuresPath`, `findProject`, `findProjectPath`, `findProjectRoot`, `forgetProject`, `frameworkCloudPath`, `frameworkDefaultsRoot`, `frameworkPath`, `frameworkRuntimePath`, `functionsPath`, `gitPath`, `healthPath`, `homeDir`, `inspectDefaultsProvenance`, `installedDefaultsVersion`, `isAbsolute`, `isCompiledBinary`, `isInstalledDefaultsRoot`, `isProcessAlive`, `isProjectRoot`, `isVisitingCli`, `jobsPath`, `join`, `langPath`, `layoutsPath`, `libraryPackagePath`, `libsEntriesPath`, `libsPath`, `linkPackagedDefaults`, `lintPath`, `listProjects`, `listenersPath`, `loggingPath`, `logsPath`, `mergeDirectoryInto`, `modelMetaPath`, `modelsPath`, `modulesPath`, `newsletterPath`, `normalize`, `notificationsPath`, `objectsPath`, `onboardingPath`, `ormPath`, `packagedDefaultsRoot`, `paginationPath`, `path`, `pathPath`, `paymentsPath`, `projectCliEntry`, `projectConfigPath`, `projectPath`, `pruneProjects`, `publicPath`, `pushPath`, `queryBuilderPath`, `queuePath`, `readProjectService`, `realtimePath`, `recordProjectService`, `registerProject`, `relative`, `relativeActionsPath`, `replPath`, `reserveProjectPort`, `resolve`, `resolveModulePath`, `resolveUserLibBase`, `resourcesPath`, `routerPath`, `routesPath`, `runtimeDirectoryEnv`, `runtimePath`, `schedulerPath`, `scriptsPath`, `searchEnginePath`, `securityPath`, `sep`, `serverPath`, `serverlessPath`, `settingsPath`, `shellPath`, `siteConfigPath`, `skillsPath`, `slugPath`, `smsPath`, `socialsPath`, `stacksBackupPath`, `stacksHome`, `stacksLockPath`, `stacksPath`, `storagePath`, `storesPath`, `stringsPath`, `stxPath`, `testingPath`, `testsPath`, `tinkerPath`, `toNamespacedPath`, `typesPath`, `uiPath`, `userActionsPath`, `userComponentsPath`, `userControllersPath`, `userDatabasePath`, `userEmailsPath`, `userEventsPath`, `userFunctionsPath`, `userJobsPath`, `userLibsPath`, `userListenersPath`, `userMailPath`, `userMiddlewarePath`, `userMigrationsPath`, `userModelsPath`, `userNotificationsPath`, `userServerPath`, `userViewsPath`, `usesVendoredDefaults`, `utilsPath`, `validationPath`, `viewsPath`.
672
672
 
673
- Local source modules: [src/module-resolution.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/path/src/module-resolution.ts), [src/project.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/path/src/project.ts).
673
+ Local source modules: [src/module-resolution.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/path/src/module-resolution.ts), [src/project.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/path/src/project.ts), [src/projects.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/path/src/projects.ts).
674
674
 
675
- Evidence directory: [13 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/path/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
675
+ Evidence directory: [14 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/path/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
676
676
 
677
677
  ### @stacksjs/payments
678
678
 
@@ -896,7 +896,7 @@ Read the entrypoint and package export map for re-exported or type-only surfaces
896
896
 
897
897
  Local source modules: [src/console.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/console.ts), [src/disposable-database.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/disposable-database.ts), [src/events.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/events.ts), [src/feature.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/feature.ts), [src/isolated.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/isolated.ts), [src/mail.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/mail.ts), [src/schema.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/schema.ts), [src/service.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/service.ts), [src/time.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/src/time.ts).
898
898
 
899
- Evidence directory: [24 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
899
+ Evidence directory: [25 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/testing/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
900
900
 
901
901
  ### @stacksjs/tinker
902
902
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: stacks-orm
3
- description: Use when querying or writing Stacks models, using transactions and relationships, preserving inferred model types, or enabling native model traits. Covers @stacksjs/orm, the model runtime, and 110 built-in models.
3
+ description: Use when querying or writing Stacks models, using transactions and relationships, preserving inferred model types, or enabling native model traits. Covers @stacksjs/orm, the model runtime, and 113 built-in models.
4
4
  license: MIT
5
5
  compatibility: Bun >= 1.3.0, TypeScript
6
6
  allowed-tools: Read Edit Write Bash Grep Glob
@@ -10,7 +10,7 @@ allowed-tools: Read Edit Write Bash Grep Glob
10
10
 
11
11
  `defineModel` produces an immediately usable query surface over
12
12
  `bun-query-builder`. Model-driven migrations change the schema; there are no
13
- per-model ORM classes to generate. The framework declares 110 models on disk,
13
+ per-model ORM classes to generate. The framework declares 113 models on disk,
14
14
  but optional feature gates determine which built-ins load in a running app.
15
15
 
16
16
  ## Definitions and typed rows
@@ -402,9 +402,14 @@ isIpv6(address) // check if AddressInfo is IPv6 (handle
402
402
  ## Find Stacks Projects (`find.ts`)
403
403
 
404
404
  ```typescript
405
- await findStacksProjects(dir?, options?) // recursively search for Stacks projects
406
- // A Stacks project = directory with 'buddy' file + 'storage/framework/core/buddy' structure
407
- // Excludes: node_modules, dist, vendor, storage/framework, ~/Documents, ~/Pictures, ~/Library, ~/.Trash, dotfolders
405
+ await findStacksProjects(dir?, options?) // walk a directory tree for Stacks projects ({ quiet, maxDepth })
406
+ // The disk scan behind `buddy projects:scan`. To ask which projects are on the
407
+ // machine, read the list instead: `listProjects()` / `findProject()` in `@stacksjs/path`.
408
+ // A Stacks project = whatever `isProjectRoot()` in `@stacksjs/path` accepts: a package.json
409
+ // beside `storage/framework`, or beside `config/app.ts`, or declaring a native app.
410
+ // Skips by directory NAME: node_modules, dist, out, vendor, pantry and dot-folders, and does not
411
+ // look inside a project it has found. With no `dir` it starts at the home directory and also
412
+ // skips ~/Documents, ~/Pictures, ~/Library, ~/Movies, ~/Music, ~/Applications.
408
413
  ```
409
414
 
410
415
  ## Git Utilities (`git.ts`)
@@ -0,0 +1,27 @@
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 { deleteDiscount } from './commerce-discount-write'
6
+
7
+ /** `DELETE /api/dashboard/commerce/discounts/{id}` - remove a discount. Placed orders keep their totals. */
8
+ export default new Action({
9
+ name: 'CommerceDiscountDestroyAction',
10
+ description: 'Deletes a Discount from the dashboard.',
11
+ method: 'DELETE',
12
+ apiResponse: true,
13
+
14
+ async handle(request: RequestInstance) {
15
+ const id = Number(request.getParam('id'))
16
+ if (!Number.isSafeInteger(id) || id <= 0)
17
+ return response.json({ message: 'The discount id must be a positive whole number.' }, 422)
18
+ try {
19
+ if (!await deleteDiscount(id))
20
+ return response.json({ message: `Discount ${id} does not exist.` }, 404)
21
+ return response.json({ ok: true })
22
+ }
23
+ catch (error) {
24
+ return dashboardOperationalError(error, 'The discount could not be deleted.', 'CommerceDiscountDestroyAction')
25
+ }
26
+ },
27
+ })
@@ -0,0 +1,28 @@
1
+ import type { RequestInstance } from '@stacksjs/types'
2
+ import { Action } from '@stacksjs/actions/runtime'
3
+ import { config } from '@stacksjs/config'
4
+ import { response } from '@stacksjs/router'
5
+ import { dashboardOperationalError } from '../dashboard-response'
6
+ import { asFieldErrors, saveDiscount } from './commerce-discount-write'
7
+ import { normalizeCommerceCurrency } from './commerce-product-records'
8
+
9
+ /** `POST /api/dashboard/commerce/discounts` - create a discount, checked by the engine first. */
10
+ export default new Action({
11
+ name: 'CommerceDiscountStoreAction',
12
+ description: 'Creates a Discount from the dashboard.',
13
+ method: 'POST',
14
+ apiResponse: true,
15
+
16
+ async handle(request: RequestInstance) {
17
+ try {
18
+ const result = await saveDiscount(null, request.all() as Record<string, unknown>, normalizeCommerceCurrency(config.commerce?.currency))
19
+ if (!result.ok)
20
+ return response.json({ message: result.message, errors: asFieldErrors(result.errors) }, result.status)
21
+ return response.json(result.record, 201)
22
+ }
23
+ catch (error) {
24
+ return dashboardOperationalError(error, 'The discount could not be saved.', 'CommerceDiscountStoreAction')
25
+ }
26
+ },
27
+ })
28
+
@@ -0,0 +1,30 @@
1
+ import type { RequestInstance } from '@stacksjs/types'
2
+ import { Action } from '@stacksjs/actions/runtime'
3
+ import { config } from '@stacksjs/config'
4
+ import { response } from '@stacksjs/router'
5
+ import { dashboardOperationalError } from '../dashboard-response'
6
+ import { asFieldErrors, saveDiscount } from './commerce-discount-write'
7
+ import { normalizeCommerceCurrency } from './commerce-product-records'
8
+
9
+ /** `PATCH /api/dashboard/commerce/discounts/{id}` - change a discount, checked by the engine first. */
10
+ export default new Action({
11
+ name: 'CommerceDiscountUpdateAction',
12
+ description: 'Updates a Discount from the dashboard.',
13
+ method: 'PATCH',
14
+ apiResponse: true,
15
+
16
+ async handle(request: RequestInstance) {
17
+ const id = Number(request.getParam('id'))
18
+ if (!Number.isSafeInteger(id) || id <= 0)
19
+ return response.json({ message: 'The discount id must be a positive whole number.' }, 422)
20
+ try {
21
+ const result = await saveDiscount(id, request.all() as Record<string, unknown>, normalizeCommerceCurrency(config.commerce?.currency))
22
+ if (!result.ok)
23
+ return response.json({ message: result.message, errors: asFieldErrors(result.errors) }, result.status)
24
+ return response.json(result.record)
25
+ }
26
+ catch (error) {
27
+ return dashboardOperationalError(error, 'The discount could not be saved.', 'CommerceDiscountUpdateAction')
28
+ }
29
+ },
30
+ })
@@ -0,0 +1,42 @@
1
+ import type { RequestInstance } from '@stacksjs/types'
2
+ import { Action } from '@stacksjs/actions/runtime'
3
+ import { config } from '@stacksjs/config'
4
+ import { response } from '@stacksjs/router'
5
+ import { dashboardOperationalError } from '../dashboard-response'
6
+ import { parseDiscountListQuery, readDiscountPage } from './commerce-discount-list'
7
+ import { normalizeCommerceCurrency } from './commerce-product-records'
8
+
9
+ /**
10
+ * `GET /api/dashboard/commerce/discounts` - one page of discounts, searched,
11
+ * filtered by method, type and state, sorted and counted by the database, with
12
+ * the summary of every discount (commerce-discount-list.ts). The store
13
+ * currency comes with it: fixed amounts and minimums are minor units of it.
14
+ */
15
+ export default new Action({
16
+ name: 'CommerceDiscountsAction',
17
+ description: 'Returns one page of Discount records for dashboard management.',
18
+ method: 'GET',
19
+ apiResponse: true,
20
+
21
+ async handle(request: RequestInstance) {
22
+ const query = parseDiscountListQuery(key => request.get<unknown>(key, ''))
23
+ if ('error' in query)
24
+ return response.json({ message: query.error }, 422)
25
+
26
+ const currency = normalizeCommerceCurrency(config.commerce?.currency)
27
+ try {
28
+ const discounts = await readDiscountPage(query, currency)
29
+ return {
30
+ records: discounts.records,
31
+ total: discounts.total,
32
+ page: discounts.page,
33
+ perPage: query.perPage,
34
+ summary: discounts.summary,
35
+ currency,
36
+ }
37
+ }
38
+ catch (error) {
39
+ return dashboardOperationalError(error, 'Discount records could not be read.', 'CommerceDiscountsAction')
40
+ }
41
+ },
42
+ })
@@ -0,0 +1,31 @@
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 { deleteUpsellOffer } from './commerce-upsell-list'
6
+
7
+ /**
8
+ * `DELETE /api/dashboard/commerce/upsells/{id}` - remove an offer nobody has
9
+ * answered. One with responses is refused (409): switch it off instead.
10
+ */
11
+ export default new Action({
12
+ name: 'CommerceUpsellDestroyAction',
13
+ description: 'Deletes an unanswered post-purchase offer from the dashboard.',
14
+ method: 'DELETE',
15
+ apiResponse: true,
16
+
17
+ async handle(request: RequestInstance) {
18
+ const id = Number(request.getParam('id'))
19
+ if (!Number.isSafeInteger(id) || id <= 0)
20
+ return response.json({ message: 'The offer id must be a positive whole number.' }, 422)
21
+ try {
22
+ const result = await deleteUpsellOffer(id)
23
+ if (!result.ok)
24
+ return response.json({ message: result.message }, result.status)
25
+ return response.json({ ok: true })
26
+ }
27
+ catch (error) {
28
+ return dashboardOperationalError(error, 'The offer could not be deleted.', 'CommerceUpsellDestroyAction')
29
+ }
30
+ },
31
+ })
@@ -0,0 +1,28 @@
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 { readUpsellDetail } from './commerce-upsell-list'
6
+
7
+ /** `GET /api/dashboard/commerce/upsells/{id}` - one offer, its funnel and its latest responses. */
8
+ export default new Action({
9
+ name: 'CommerceUpsellDetailAction',
10
+ description: 'Returns one post-purchase offer with its recent responses.',
11
+ method: 'GET',
12
+ apiResponse: true,
13
+
14
+ async handle(request: RequestInstance) {
15
+ const id = Number(request.getParam('id'))
16
+ if (!Number.isSafeInteger(id) || id <= 0)
17
+ return response.json({ message: 'The offer id must be a positive whole number.' }, 422)
18
+ try {
19
+ const detail = await readUpsellDetail(id)
20
+ if (!detail)
21
+ return response.json({ message: `Offer ${id} does not exist.` }, 404)
22
+ return detail
23
+ }
24
+ catch (error) {
25
+ return dashboardOperationalError(error, 'The offer could not be read.', 'CommerceUpsellDetailAction')
26
+ }
27
+ },
28
+ })
@@ -0,0 +1,26 @@
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 { asFieldErrors } from './commerce-discount-write'
6
+ import { saveUpsellOffer } from './commerce-upsell-list'
7
+
8
+ /** `POST /api/dashboard/commerce/upsells` - create a post-purchase offer. */
9
+ export default new Action({
10
+ name: 'CommerceUpsellStoreAction',
11
+ description: 'Creates a post-purchase offer from the dashboard.',
12
+ method: 'POST',
13
+ apiResponse: true,
14
+
15
+ async handle(request: RequestInstance) {
16
+ try {
17
+ const result = await saveUpsellOffer(null, request.all() as Record<string, unknown>)
18
+ if (!result.ok)
19
+ return response.json({ message: result.message, errors: asFieldErrors(result.errors) }, result.status)
20
+ return response.json(result.record, 201)
21
+ }
22
+ catch (error) {
23
+ return dashboardOperationalError(error, 'The offer could not be saved.', 'CommerceUpsellStoreAction')
24
+ }
25
+ },
26
+ })
@@ -0,0 +1,29 @@
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 { asFieldErrors } from './commerce-discount-write'
6
+ import { saveUpsellOffer } from './commerce-upsell-list'
7
+
8
+ /** `PATCH /api/dashboard/commerce/upsells/{id}` - change a post-purchase offer. */
9
+ export default new Action({
10
+ name: 'CommerceUpsellUpdateAction',
11
+ description: 'Updates a post-purchase offer from the dashboard.',
12
+ method: 'PATCH',
13
+ apiResponse: true,
14
+
15
+ async handle(request: RequestInstance) {
16
+ const id = Number(request.getParam('id'))
17
+ if (!Number.isSafeInteger(id) || id <= 0)
18
+ return response.json({ message: 'The offer id must be a positive whole number.' }, 422)
19
+ try {
20
+ const result = await saveUpsellOffer(id, request.all() as Record<string, unknown>)
21
+ if (!result.ok)
22
+ return response.json({ message: result.message, errors: asFieldErrors(result.errors) }, result.status)
23
+ return response.json(result.record)
24
+ }
25
+ catch (error) {
26
+ return dashboardOperationalError(error, 'The offer could not be saved.', 'CommerceUpsellUpdateAction')
27
+ }
28
+ },
29
+ })
@@ -0,0 +1,40 @@
1
+ import type { RequestInstance } from '@stacksjs/types'
2
+ import { Action } from '@stacksjs/actions/runtime'
3
+ import { config } from '@stacksjs/config'
4
+ import { response } from '@stacksjs/router'
5
+ import { dashboardOperationalError } from '../dashboard-response'
6
+ import { normalizeCommerceCurrency } from './commerce-product-records'
7
+ import { parseUpsellListQuery, readUpsellPage } from './commerce-upsell-list'
8
+
9
+ /**
10
+ * `GET /api/dashboard/commerce/upsells` - one page of post-purchase offers,
11
+ * each with its funnel (shown, taken, turned down, revenue), and the totals
12
+ * across every offer (commerce-upsell-list.ts).
13
+ */
14
+ export default new Action({
15
+ name: 'CommerceUpsellsAction',
16
+ description: 'Returns one page of post-purchase offers with their conversion for dashboard management.',
17
+ method: 'GET',
18
+ apiResponse: true,
19
+
20
+ async handle(request: RequestInstance) {
21
+ const query = parseUpsellListQuery(key => request.get<unknown>(key, ''))
22
+ if ('error' in query)
23
+ return response.json({ message: query.error }, 422)
24
+
25
+ try {
26
+ const offers = await readUpsellPage(query)
27
+ return {
28
+ records: offers.records,
29
+ total: offers.total,
30
+ page: offers.page,
31
+ perPage: query.perPage,
32
+ summary: offers.summary,
33
+ currency: normalizeCommerceCurrency(config.commerce?.currency),
34
+ }
35
+ }
36
+ catch (error) {
37
+ return dashboardOperationalError(error, 'Post-purchase offers could not be read.', 'CommerceUpsellsAction')
38
+ }
39
+ },
40
+ })