@adobe/aio-commerce-lib-app 1.6.0 → 1.8.0-beta-20260714082406

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 (110) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/dist/cjs/actions/app-config/index.cjs +205 -0
  3. package/dist/cjs/actions/{app-config.d.cts → app-config/index.d.cts} +10 -7
  4. package/dist/cjs/actions/association/index.cjs +85 -0
  5. package/dist/cjs/actions/association/index.d.cts +28 -0
  6. package/dist/cjs/actions/{config.cjs → config/index.cjs} +70 -53
  7. package/dist/{es/actions/config.d.mts → cjs/actions/config/index.d.cts} +10 -7
  8. package/dist/cjs/actions/{installation.cjs → installation/index.cjs} +106 -72
  9. package/dist/{es/actions/installation.d.mts → cjs/actions/installation/index.d.cts} +10 -8
  10. package/dist/cjs/actions/{scope-tree.cjs → scope-tree/index.cjs} +60 -22
  11. package/dist/cjs/actions/{scope-tree.d.cts → scope-tree/index.d.cts} +1 -1
  12. package/dist/cjs/app-D3P-Z6uY.d.cts +1679 -0
  13. package/dist/cjs/association-repository-BAs3-VkW.cjs +69 -0
  14. package/dist/cjs/commands/index.cjs +517 -309
  15. package/dist/cjs/commands/templates/admin-ui/tsconfig.json +14 -0
  16. package/dist/cjs/commands/templates/admin-ui/web-src/index.css +5 -0
  17. package/dist/cjs/commands/templates/admin-ui/web-src/index.html +17 -0
  18. package/dist/cjs/commands/templates/admin-ui/web-src/src/app.jsx +13 -0
  19. package/dist/cjs/commands/templates/admin-ui/web-src/src/components/welcome.jsx +12 -0
  20. package/dist/cjs/commands/templates/admin-ui/web-src/src/pages/main-page.jsx +10 -0
  21. package/dist/cjs/commands/templates/{admin-ui-sdk/registration.js.template → admin-ui/web-src-template.d.ts} +11 -6
  22. package/dist/cjs/commands/templates/app-management/app-config.js.template +1 -14
  23. package/dist/cjs/commands/templates/app-management/association.js.template +6 -0
  24. package/dist/cjs/commands/templates/app-management/installation.js.template +1 -13
  25. package/dist/cjs/commands/templates/business-configuration/config.js.template +2 -15
  26. package/dist/cjs/commands/templates/business-configuration/scope-tree.js.template +0 -12
  27. package/dist/cjs/config/index.browser.cjs +18 -0
  28. package/dist/cjs/config/index.browser.d.cts +16 -0
  29. package/dist/cjs/config/{index.cjs → index.node.cjs} +9 -8
  30. package/dist/cjs/config/index.node.d.cts +1603 -0
  31. package/dist/cjs/define-DBxAlJfN.d.cts +34 -0
  32. package/dist/cjs/define-hlcQw7Cv.cjs +41 -0
  33. package/dist/cjs/environment-B7EnozSg.cjs +135 -0
  34. package/dist/cjs/index-BXm8UbK7.d.cts +16 -0
  35. package/dist/cjs/{index-Dw2NvVOY.d.cts → index-CzReNwbF.d.cts} +177 -3
  36. package/dist/cjs/index.cjs +250 -0
  37. package/dist/cjs/index.d.cts +217 -0
  38. package/dist/cjs/{config-FNMclIFO.cjs → index.node-Dz4lV4qe.cjs} +119 -35
  39. package/dist/cjs/{logging-BVz3weoC.cjs → logging-udPuAJPt.cjs} +2 -2
  40. package/dist/cjs/management/index.cjs +1 -1
  41. package/dist/cjs/management/index.d.cts +1 -2
  42. package/dist/cjs/{management-Cvsz4VMf.cjs → management-B9ItB80R.cjs} +432 -591
  43. package/dist/cjs/openapi-CwytYdWl.cjs +2948 -0
  44. package/dist/cjs/{router-BOR7T6qR.cjs → router-hA_Y9gZ1.cjs} +42 -44
  45. package/dist/cjs/{schemas-FngDuIeo.cjs → schemas-mLxMh_ko.cjs} +2 -2
  46. package/dist/cjs/utils-DSCmZ_iJ.cjs +408 -0
  47. package/dist/cjs/{validate-DydOAZha.cjs → validate-BfxhZ5Wv.cjs} +63 -31
  48. package/dist/cjs/{webhooks-tbZy9G3p.cjs → webhooks-B5tb9NeF.cjs} +159 -151
  49. package/dist/es/actions/{app-config.d.mts → app-config/index.d.mts} +10 -7
  50. package/dist/es/actions/app-config/index.mjs +202 -0
  51. package/dist/es/actions/association/index.d.mts +28 -0
  52. package/dist/es/actions/association/index.mjs +82 -0
  53. package/dist/{cjs/actions/config.d.cts → es/actions/config/index.d.mts} +10 -7
  54. package/dist/es/actions/{config.mjs → config/index.mjs} +67 -50
  55. package/dist/{cjs/actions/installation.d.cts → es/actions/installation/index.d.mts} +10 -8
  56. package/dist/es/actions/{installation.mjs → installation/index.mjs} +104 -71
  57. package/dist/es/actions/{scope-tree.d.mts → scope-tree/index.d.mts} +1 -1
  58. package/dist/es/actions/{scope-tree.mjs → scope-tree/index.mjs} +58 -20
  59. package/dist/es/app-D3P-Z6uY.d.mts +1679 -0
  60. package/dist/es/association-repository-BbQv9WCl.mjs +52 -0
  61. package/dist/es/commands/index.mjs +550 -340
  62. package/dist/es/commands/templates/admin-ui/tsconfig.json +14 -0
  63. package/dist/es/commands/templates/admin-ui/web-src/index.css +5 -0
  64. package/dist/es/commands/templates/admin-ui/web-src/index.html +17 -0
  65. package/dist/es/commands/templates/admin-ui/web-src/src/app.jsx +13 -0
  66. package/dist/es/commands/templates/admin-ui/web-src/src/components/welcome.jsx +12 -0
  67. package/dist/es/commands/templates/admin-ui/web-src/src/pages/main-page.jsx +10 -0
  68. package/dist/es/commands/templates/{admin-ui-sdk/registration.js.template → admin-ui/web-src-template.d.ts} +11 -6
  69. package/dist/es/commands/templates/app-management/app-config.js.template +1 -14
  70. package/dist/es/commands/templates/app-management/association.js.template +6 -0
  71. package/dist/es/commands/templates/app-management/installation.js.template +1 -13
  72. package/dist/es/commands/templates/business-configuration/config.js.template +2 -15
  73. package/dist/es/commands/templates/business-configuration/scope-tree.js.template +0 -12
  74. package/dist/es/config/index.browser.d.mts +16 -0
  75. package/dist/es/config/index.browser.mjs +17 -0
  76. package/dist/es/config/index.node.d.mts +1604 -0
  77. package/dist/es/config/index.node.mjs +20 -0
  78. package/dist/es/define-EoYRZbpe.d.mts +34 -0
  79. package/dist/es/define-Z_Glf1-_.mjs +35 -0
  80. package/dist/es/environment-C84BPRJZ.mjs +104 -0
  81. package/dist/es/index-B0XqHwY5.d.mts +16 -0
  82. package/dist/es/{index-Bo0tQsVq.d.mts → index-D52xglhZ.d.mts} +177 -3
  83. package/dist/es/index.d.mts +217 -0
  84. package/dist/es/index.mjs +242 -0
  85. package/dist/es/{config-CcE0EBG7.mjs → index.node-CDH5gwJE.mjs} +94 -30
  86. package/dist/es/management/index.d.mts +1 -2
  87. package/dist/es/management/index.mjs +1 -1
  88. package/dist/es/{management-BZ4Y6lVp.mjs → management-B89ApQVY.mjs} +402 -562
  89. package/dist/es/openapi-CXonvevE.mjs +2900 -0
  90. package/dist/es/{router-D58JJHHA.mjs → router-B_h0cvjc.mjs} +40 -42
  91. package/dist/es/utils-_gj8L6eN.mjs +289 -0
  92. package/dist/es/{validate-Du3LhCre.mjs → validate-9cRZWGrA.mjs} +49 -29
  93. package/dist/es/{webhooks-B5oq9ULL.mjs → webhooks-BBPbY2mb.mjs} +150 -142
  94. package/package.json +52 -22
  95. package/dist/cjs/actions/app-config.cjs +0 -54
  96. package/dist/cjs/actions/registration.cjs +0 -40
  97. package/dist/cjs/actions/registration.d.cts +0 -32
  98. package/dist/cjs/admin-ui-sdk-DZZJCrdT.d.cts +0 -665
  99. package/dist/cjs/app-CakwxQvs.d.cts +0 -673
  100. package/dist/cjs/config/index.d.cts +0 -1975
  101. package/dist/cjs/step-CKVE0aJi.d.cts +0 -187
  102. package/dist/es/actions/app-config.mjs +0 -53
  103. package/dist/es/actions/registration.d.mts +0 -32
  104. package/dist/es/actions/registration.mjs +0 -39
  105. package/dist/es/admin-ui-sdk-hu6iWr0A.d.mts +0 -667
  106. package/dist/es/app-CakwxQvs.d.mts +0 -673
  107. package/dist/es/config/index.d.mts +0 -1975
  108. package/dist/es/config/index.mjs +0 -19
  109. package/dist/es/step-D64mMPrt.d.mts +0 -187
  110. /package/dist/cjs/{chunk-Cozy-1ZF.cjs → rolldown-runtime-Cozy-1ZF.cjs} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,111 @@
1
1
  # @adobe/aio-commerce-lib-app
2
2
 
3
+ ## 1.8.0-beta-20260714082406
4
+ ### Minor Changes
5
+
6
+
7
+
8
+ - [#528](https://github.com/adobe/aio-commerce-sdk/pull/528) [`0bb7d15`](https://github.com/adobe/aio-commerce-sdk/commit/0bb7d150961f631116b1ac421124960b5b857896) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Add the optional `aclProtected` field to Admin UI grid columns, mass actions, and order view buttons. When `true`, Commerce auto-generates a per-app ACL resource for the component from `metadata.id` for role-based access control, matching the existing menu behaviour.
9
+
10
+
11
+
12
+ - [#522](https://github.com/adobe/aio-commerce-sdk/pull/522) [`4396a64`](https://github.com/adobe/aio-commerce-sdk/commit/4396a647ad22dba063cdf03a16e04aef9387212f) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Add optional `aclProtected` field to Admin UI menu configuration. When `true`, Commerce auto-generates a per-app ACL resource from `metadata.id` for role-based menu access control.
13
+
14
+
15
+
16
+ - [#561](https://github.com/adobe/aio-commerce-sdk/pull/561) [`e85bec4`](https://github.com/adobe/aio-commerce-sdk/commit/e85bec40f1eaa91dd6bb7bc6954b2ecfc3ea4029) Thanks [@jcuerdo](https://github.com/jcuerdo)! - New `publishEvent` export for publishing a configured I/O Event from a runtime action by provider key and event name as declared in `app.commerce.config.ts`. Provider and event resolution happens automatically from metadata stored at installation time.
17
+
18
+
19
+
20
+ - [#511](https://github.com/adobe/aio-commerce-sdk/pull/511) [`caed6d5`](https://github.com/adobe/aio-commerce-sdk/commit/caed6d5cbc526bc980221a06a59542427752a1ab) Thanks [@vinayrao2000](https://github.com/vinayrao2000)! - Add helpers to retrieve the Commerce instance an app is associated with from any runtime action: `getCommerceInstance()` returns the stored instance data, and `getCommerceClient(auth)` returns a ready-to-use Commerce HTTP client built from that instance.
21
+
22
+
23
+
24
+ - [#508](https://github.com/adobe/aio-commerce-sdk/pull/508) [`c36f825`](https://github.com/adobe/aio-commerce-sdk/commit/c36f825aff7329fc2831d8aaca032d17bbee373a) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Add support for Admin UI menus in `commerce/backend-ui/2` via `adminUi.menu`.
25
+
26
+
27
+
28
+ - [#551](https://github.com/adobe/aio-commerce-sdk/pull/551) [`a66f389`](https://github.com/adobe/aio-commerce-sdk/commit/a66f3892622584d27cd6b5d2fc633e15bf9942a8) Thanks [@asalloum5](https://github.com/asalloum5)! - The app installation flow now enables the Admin UI SDK in Commerce before registering the extension, so Admin UI extensions are served correctly after install.
29
+
30
+
31
+
32
+ - [#510](https://github.com/adobe/aio-commerce-sdk/pull/510) [`ce7768e`](https://github.com/adobe/aio-commerce-sdk/commit/ce7768e0ddc6ca35ad6ccec60f584c8bb5a743f0) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Webhooks and events now accept an optional `env` array (`"paas"` / `"saas"`) to scope them to specific Commerce environments. Items without `env` apply everywhere; scoped items are only installed on matching environments, and an event provider left with no applicable events is skipped entirely. The `app-config` action also accepts an optional `commerceEnv` query param that returns business-config fields, webhooks, and events already filtered to that environment. The installation and `scope-tree` actions now validate `commerceEnv` against the supported values (`"paas"` / `"saas"`) instead of accepting any string; this only rejects values that were never valid in practice.
33
+
34
+
35
+
36
+ - [#486](https://github.com/adobe/aio-commerce-sdk/pull/486) [`413da36`](https://github.com/adobe/aio-commerce-sdk/commit/413da36dcd83e5a41c194f5af50611097659e725) Thanks [@obarcelonap](https://github.com/obarcelonap)! - Add support for Admin UI grid column extensions on `commerce/backend-ui/2`.
37
+
38
+
39
+
40
+ - [#512](https://github.com/adobe/aio-commerce-sdk/pull/512) [`b259e61`](https://github.com/adobe/aio-commerce-sdk/commit/b259e61c05bcb7a025486d1515ce644fb6f4265b) Thanks [@jcuerdo](https://github.com/jcuerdo)! - > [!NOTE]
41
+ > This is not causing a major bump because the `adminUiSdk` property was in an experimental phase, which wasn't stabilized yet. A manual migration is still needed.
42
+
43
+ Remove `commerce/backend-ui/1` support and the `adminUiSdk` config key. Migrate to `adminUi` and `commerce/backend-ui/2`.
44
+
45
+ **Migration:** Replace `adminUiSdk` in your `app.commerce.config.*` with the `adminUi` config key. See the updated `usage.md` for the new shape. The generated `src/commerce-backend-ui-1/` directory and its `pre-app-build` hook can be removed from your project.
46
+
47
+
48
+ - [#492](https://github.com/adobe/aio-commerce-sdk/pull/492) [`ce63b2b`](https://github.com/adobe/aio-commerce-sdk/commit/ce63b2b46f7ef1f2f68780b13e52d1c13fd5fe6e) Thanks [@jcuerdo](https://github.com/jcuerdo)! - Support Admin UI SDK v2 mass actions. Declare mass actions under `adminUi` with explicit `type: "view"` (iframe) or `type: "worker"` (runtime action), support for notifications, and a unified `selectionLimit` across Order, Product, and Customer entities.
49
+
50
+
51
+
52
+ - [#534](https://github.com/adobe/aio-commerce-sdk/pull/534) [`b33ad74`](https://github.com/adobe/aio-commerce-sdk/commit/b33ad741c30262279180496ab28a82516569a17f) Thanks [@obarcelonap](https://github.com/obarcelonap)! - Uninstallation now removes exactly the resources that were created at install time, even when the app configuration has since changed. Installs created before this change fall back to the current request config. The installation/uninstallation status responses now include an optional `config` field recording what was applied.
53
+
54
+
55
+
56
+ - [#548](https://github.com/adobe/aio-commerce-sdk/pull/548) [`7670e39`](https://github.com/adobe/aio-commerce-sdk/commit/7670e39ae3cdf1172d9d9f09f0f100c19966d5a0) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Implement initial web source scaffolding for projects with Admin UI view operations
57
+
58
+
59
+
60
+ - [#506](https://github.com/adobe/aio-commerce-sdk/pull/506) [`a18d900`](https://github.com/adobe/aio-commerce-sdk/commit/a18d900771df65a025dde2146da8422f08c5e4ae) Thanks [@obarcelonap](https://github.com/obarcelonap)! - Add `adminUi.order.viewButtons` support on `commerce/backend-ui/2`, with `type: "view"` (iframe) and `type: "worker"` (runtime action) variants.
61
+
62
+
63
+ ### Patch Changes
64
+
65
+
66
+
67
+ - [#525](https://github.com/adobe/aio-commerce-sdk/pull/525) [`2e40262`](https://github.com/adobe/aio-commerce-sdk/commit/2e402628f1cd21a85dfb7c8dc3660a454f1053c0) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Characters in `metadata.id` that are disallowed by the Commerce Eventing API, such as hyphens, are now normalized to underscores in the generated event code.
68
+
69
+
70
+
71
+ - [#528](https://github.com/adobe/aio-commerce-sdk/pull/528) [`0bb7d15`](https://github.com/adobe/aio-commerce-sdk/commit/0bb7d150961f631116b1ac421124960b5b857896) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Grid column entries in `adminUi` config now reject unknown keys (strict validation), so a mistyped field such as `aclprotected` surfaces a validation error instead of being silently dropped — matching the existing behavior of mass actions and view buttons.
72
+
73
+
74
+
75
+ - [#548](https://github.com/adobe/aio-commerce-sdk/pull/548) [`7670e39`](https://github.com/adobe/aio-commerce-sdk/commit/7670e39ae3cdf1172d9d9f09f0f100c19966d5a0) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - For static business configs, the `#app.commerce.config` alias now resolves to a generated ESM module that re-exports the app manifest, so generated runtime actions can import it directly without needing a JSON import attribute.
76
+
77
+ - Updated dependencies [[`0bb7d15`](https://github.com/adobe/aio-commerce-sdk/commit/0bb7d150961f631116b1ac421124960b5b857896), [`4396a64`](https://github.com/adobe/aio-commerce-sdk/commit/4396a647ad22dba063cdf03a16e04aef9387212f), [`c15b50f`](https://github.com/adobe/aio-commerce-sdk/commit/c15b50f667e6d1288270dbd4192c150db0ff0914), [`c36f825`](https://github.com/adobe/aio-commerce-sdk/commit/c36f825aff7329fc2831d8aaca032d17bbee373a), [`bdcced9`](https://github.com/adobe/aio-commerce-sdk/commit/bdcced9297ae5e1b87ce86490a2b6fad76b2e341), [`19400fb`](https://github.com/adobe/aio-commerce-sdk/commit/19400fbdfc03c5bbfc30f995a2acdd4272c5e032), [`e85bec4`](https://github.com/adobe/aio-commerce-sdk/commit/e85bec40f1eaa91dd6bb7bc6954b2ecfc3ea4029), [`a66f389`](https://github.com/adobe/aio-commerce-sdk/commit/a66f3892622584d27cd6b5d2fc633e15bf9942a8), [`ce7768e`](https://github.com/adobe/aio-commerce-sdk/commit/ce7768e0ddc6ca35ad6ccec60f584c8bb5a743f0), [`4396a64`](https://github.com/adobe/aio-commerce-sdk/commit/4396a647ad22dba063cdf03a16e04aef9387212f), [`e85bec4`](https://github.com/adobe/aio-commerce-sdk/commit/e85bec40f1eaa91dd6bb7bc6954b2ecfc3ea4029), [`413da36`](https://github.com/adobe/aio-commerce-sdk/commit/413da36dcd83e5a41c194f5af50611097659e725), [`413da36`](https://github.com/adobe/aio-commerce-sdk/commit/413da36dcd83e5a41c194f5af50611097659e725), [`ca2c4fe`](https://github.com/adobe/aio-commerce-sdk/commit/ca2c4febcdfbe52b933775f08e9a53765fc306ab), [`ce63b2b`](https://github.com/adobe/aio-commerce-sdk/commit/ce63b2b46f7ef1f2f68780b13e52d1c13fd5fe6e), [`caed6d5`](https://github.com/adobe/aio-commerce-sdk/commit/caed6d5cbc526bc980221a06a59542427752a1ab), [`19400fb`](https://github.com/adobe/aio-commerce-sdk/commit/19400fbdfc03c5bbfc30f995a2acdd4272c5e032)]:
78
+ - @adobe/aio-commerce-lib-admin-ui@0.2.0-beta-20260714082406
79
+ - @adobe/aio-commerce-lib-core@1.2.0-beta-20260714082406
80
+ - @adobe/aio-commerce-lib-events@1.3.0-beta-20260714082406
81
+ - @adobe/aio-commerce-lib-api@1.3.0-beta-20260714082406
82
+ - @adobe/aio-commerce-lib-config@1.6.0-beta-20260714082406
83
+ - @adobe/aio-commerce-lib-webhooks@1.2.0-beta-20260714082406
84
+ - @adobe/aio-commerce-lib-auth@1.1.2-beta-20260714082406
85
+
86
+ ## 1.7.0
87
+
88
+ ### Minor Changes
89
+
90
+ - [#481](https://github.com/adobe/aio-commerce-sdk/pull/481) [`cffcc6a`](https://github.com/adobe/aio-commerce-sdk/commit/cffcc6af58c734486de4447c1f1eaa7a4784a4e2) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Introduce a new `GET /openapi.json` for `lib-app` in `app-config`.
91
+
92
+ - [#471](https://github.com/adobe/aio-commerce-sdk/pull/471) [`82adf80`](https://github.com/adobe/aio-commerce-sdk/commit/82adf8002e693166fe0d285f9b901750dbad2f5e) Thanks [@obarcelonap](https://github.com/obarcelonap)! - Default generated actions to `nodejs:24`, the latest App Builder Runtime version with prewarm support.
93
+
94
+ ### Patch Changes
95
+
96
+ - [#489](https://github.com/adobe/aio-commerce-sdk/pull/489) [`d227e47`](https://github.com/adobe/aio-commerce-sdk/commit/d227e475ec0b513ca06e4e7950497b2a20ee4674) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Refactor Admin UI SDK extension registration and unregistration to use `@adobe/aio-commerce-lib-admin-ui` client instead of raw HTTP calls.
97
+
98
+ - [#481](https://github.com/adobe/aio-commerce-sdk/pull/481) [`cffcc6a`](https://github.com/adobe/aio-commerce-sdk/commit/cffcc6af58c734486de4447c1f1eaa7a4784a4e2) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fix `scopes` body validation in the scope tree action to use the proper recursive `CustomScopeInput` schema instead of `v.any()`.
99
+
100
+ - [#495](https://github.com/adobe/aio-commerce-sdk/pull/495) [`c8d8c3a`](https://github.com/adobe/aio-commerce-sdk/commit/c8d8c3a1f1279493d12bd1403e5fd71f18ee9dc1) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fix an issue where developers could not define custom installation scripts via `module.exports` when using CJS.
101
+
102
+ - [#481](https://github.com/adobe/aio-commerce-sdk/pull/481) [`cffcc6a`](https://github.com/adobe/aio-commerce-sdk/commit/cffcc6af58c734486de4447c1f1eaa7a4784a4e2) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Return `400` instead of `500` when a custom scope tree fails validation (reserved or duplicate scope codes, invalid fields).
103
+
104
+ - Updated dependencies [[`f6aec01`](https://github.com/adobe/aio-commerce-sdk/commit/f6aec01a22ed185fe130170751353fae881c0f2d), [`9b41376`](https://github.com/adobe/aio-commerce-sdk/commit/9b413761fd857a2e75c3f5210efb83ce2b1b4b6e), [`d227e47`](https://github.com/adobe/aio-commerce-sdk/commit/d227e475ec0b513ca06e4e7950497b2a20ee4674)]:
105
+ - @adobe/aio-commerce-lib-webhooks@1.1.2
106
+ - @adobe/aio-commerce-lib-config@1.5.1
107
+ - @adobe/aio-commerce-lib-admin-ui@0.1.0
108
+
3
109
  ## 1.6.0
4
110
 
5
111
  ### Minor Changes
@@ -0,0 +1,205 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright 2026 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+
15
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
16
+ const require_rolldown_runtime = require('../../rolldown-runtime-Cozy-1ZF.cjs');
17
+ const require_environment = require('../../environment-B7EnozSg.cjs');
18
+ const require_validate = require('../../validate-BfxhZ5Wv.cjs');
19
+ const require_router = require('../../router-hA_Y9gZ1.cjs');
20
+ let _adobe_aio_commerce_lib_config = require("@adobe/aio-commerce-lib-config");
21
+ let valibot = require("valibot");
22
+ valibot = require_rolldown_runtime.__toESM(valibot, 1);
23
+ let _adobe_aio_commerce_lib_core_commerce = require("@adobe/aio-commerce-lib-core/commerce");
24
+ let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
25
+ let crypto = require("crypto");
26
+
27
+ //#region source/actions/app-config/openapi.ts
28
+ /**
29
+ * Loads the committed OpenAPI spec via dynamic import so it
30
+ * lands in its own chunk and is not parsed on every cold start.
31
+ */
32
+ const importOpenApi = () => Promise.resolve().then(() => require("../../openapi-CwytYdWl.cjs"));
33
+ /** Matches component schema `$ref` strings, capturing the schema name. */
34
+ const SCHEMA_REF_PATTERN = /"#\/components\/schemas\/(\w+)"/g;
35
+ /**
36
+ * Collects the names of every component schema referenced via `$ref` in a value
37
+ * Scans the serialized JSON, so it catches refs at any depth.
38
+ *
39
+ * @param value - Any part of the spec to scan.
40
+ */
41
+ function collectSchemaRefs(value) {
42
+ return [...(JSON.stringify(value) ?? "").matchAll(SCHEMA_REF_PATTERN)].map((match) => match[1]);
43
+ }
44
+ /**
45
+ * Deletes component schemas not reachable from the remaining paths, in place.
46
+ *
47
+ * Follows `$ref`s transitively from `spec.paths`; the visited set handles
48
+ * recursive schemas (e.g. `ScopeNode`).
49
+ *
50
+ * @param spec - The spec to prune, after paths have been stripped.
51
+ */
52
+ function pruneUnusedSchemas(spec) {
53
+ const schemas = spec.components.schemas;
54
+ const reachable = new Set(collectSchemaRefs(spec.paths));
55
+ const pending = [...reachable];
56
+ while (pending.length > 0) {
57
+ const name = pending.pop();
58
+ if (name === void 0) continue;
59
+ for (const ref of collectSchemaRefs(schemas[name])) if (!reachable.has(ref)) {
60
+ reachable.add(ref);
61
+ pending.push(ref);
62
+ }
63
+ }
64
+ for (const name of Object.keys(schemas)) if (!reachable.has(name)) delete schemas[name];
65
+ }
66
+ /**
67
+ * Removes top-level tags no longer referenced by any remaining path operation, in place.
68
+ * @param spec - The spec to prune, after paths have been stripped.
69
+ */
70
+ function pruneUnusedTags(spec) {
71
+ const usedTags = /* @__PURE__ */ new Set();
72
+ for (const pathItem of Object.values(spec.paths)) for (const operation of Object.values(pathItem)) for (const tag of operation.tags ?? []) usedTags.add(tag);
73
+ for (let i = spec.tags.length - 1; i >= 0; i -= 1) if (!usedTags.has(spec.tags[i].name)) spec.tags.splice(i, 1);
74
+ }
75
+ /**
76
+ * Computes a short hash identifying the spec served for the given config domains.
77
+ * Changes whenever the served spec would: with the OpenAPI spec version (`info.version`),
78
+ * the package version, or the domains that drive pruning.
79
+ *
80
+ * @param domains - The active config domains.
81
+ */
82
+ function getOpenApiCacheKey(domains) {
83
+ const input = `1.8.0-beta-20260714082406:${[...domains].sort().join(",")}:2.0.0`;
84
+ return (0, crypto.createHash)("sha256").update(input).digest("hex").slice(0, 8);
85
+ }
86
+ /** Returns the server URL to be set in the OpenAPI spec, based on the current namespace. */
87
+ function getServerUrl() {
88
+ return `https://${process.env.__OW_NAMESPACE}.adobeioruntime.net/api/v1/web/app-management`;
89
+ }
90
+ /**
91
+ * Builds the OpenAPI spec served by `GET /openapi.json`, tailored to the app's
92
+ * capabilities: unused paths are stripped, along with the schemas they leave
93
+ * unreferenced.
94
+ *
95
+ * Works on a fresh copy so the shared module import is never mutated. The
96
+ * committed `docs/openapi.json` always describes the full surface.
97
+ *
98
+ * @param domains - The active config domains that drive path trimming.
99
+ * @param logger - Logger used to report which paths get stripped.
100
+ */
101
+ async function buildOpenApiSpec(domains, logger) {
102
+ const { default: openAPISpec } = await importOpenApi();
103
+ const spec = structuredClone(openAPISpec);
104
+ const stripPath = (path) => {
105
+ if (spec.paths[path]) {
106
+ logger.debug(`Stripping OpenAPI spec path: ${path}`);
107
+ delete spec.paths[path];
108
+ }
109
+ };
110
+ if (!domains.has("businessConfig.schema")) {
111
+ logger.debug("Application doesn't define business configuration, stripping references...");
112
+ stripPath("/config");
113
+ stripPath("/scope-tree");
114
+ stripPath("/scope-tree/commerce");
115
+ }
116
+ if (!require_validate.requiresInstallationFromDomains(domains)) {
117
+ logger.debug("Application doesn't require installation, stripping references...");
118
+ stripPath("/installation");
119
+ stripPath("/installation/validation");
120
+ stripPath("/installation/uninstallation");
121
+ }
122
+ pruneUnusedSchemas(spec);
123
+ pruneUnusedTags(spec);
124
+ spec.servers[0].url = getServerUrl();
125
+ return spec;
126
+ }
127
+
128
+ //#endregion
129
+ //#region source/actions/app-config/router.ts
130
+ /**
131
+ * App Config action router.
132
+ *
133
+ * Routes:
134
+ * - GET / Retrieve the Commerce App configuration.
135
+ * - GET /openapi.json Returns the OpenAPI spec for all SDK actions
136
+ */
137
+ const router = new require_router.HttpActionRouter().use(require_router.logger({ name: () => "app-config" }));
138
+ /** GET / - Get app config */
139
+ router.get("/", {
140
+ handler: async (req, { logger, rawParams }) => {
141
+ const rawAppConfig = rawParams.appConfig;
142
+ if (!rawAppConfig) return (0, _adobe_aio_commerce_lib_core_responses.internalServerError)("The app config is missing. Does the action receive it as a parameter?");
143
+ let appConfig = rawAppConfig;
144
+ if (require_validate.hasBusinessConfigSchema(rawAppConfig)) {
145
+ logger.debug("Resolving business config schema...");
146
+ const schema = await (0, _adobe_aio_commerce_lib_config.resolveBusinessConfigSchema)(rawAppConfig.businessConfig.schema, rawParams);
147
+ appConfig = {
148
+ ...rawAppConfig,
149
+ businessConfig: {
150
+ ...rawAppConfig.businessConfig,
151
+ schema
152
+ }
153
+ };
154
+ }
155
+ logger.debug("Validating app config...");
156
+ const validatedConfig = require_validate.validateCommerceAppConfig(appConfig);
157
+ logger.debug("Successfully validated the app config");
158
+ const { commerceEnv } = req.query;
159
+ const config = commerceEnv ? require_environment.filterAppConfigByEnv(validatedConfig, commerceEnv) : validatedConfig;
160
+ const domains = require_validate.getConfigDomains(rawParams.appConfig);
161
+ const openApiSpecUrl = `${getServerUrl()}/app-config/openapi.json?ck=${getOpenApiCacheKey(domains)}`;
162
+ return (0, _adobe_aio_commerce_lib_core_responses.ok)({ body: {
163
+ ...config,
164
+ openApiSpecUrl
165
+ } });
166
+ },
167
+ query: valibot.object({ commerceEnv: valibot.optional(_adobe_aio_commerce_lib_core_commerce.CommerceEnvSchema) })
168
+ });
169
+ /**
170
+ * GET /openapi.json - Returns the OpenAPI spec for all SDK actions
171
+ * @internal - Do not add to OpenAPI Spec.
172
+ */
173
+ router.get("/openapi.json", {
174
+ handler: async (req, { logger, rawParams }) => {
175
+ const { ck } = req.query;
176
+ const domains = require_validate.getConfigDomains(rawParams.appConfig);
177
+ if (ck && getOpenApiCacheKey(domains) === ck) {
178
+ logger.debug(`Received request for OpenAPI spec with cache key query param: ${ck}`);
179
+ return (0, _adobe_aio_commerce_lib_core_responses.ok)({
180
+ body: await buildOpenApiSpec(domains, logger),
181
+ headers: { "Cache-Control": "public, max-age=31536000, immutable" }
182
+ });
183
+ }
184
+ return (0, _adobe_aio_commerce_lib_core_responses.ok)({ body: await buildOpenApiSpec(domains, logger) });
185
+ },
186
+ query: valibot.object({ ck: valibot.optional(valibot.string()) })
187
+ });
188
+
189
+ //#endregion
190
+ //#region source/actions/app-config/index.ts
191
+ /**
192
+ * Factory to create the route handler for the `app-config` action.
193
+ * @param args - The arguments required to create the runtime action.
194
+ */
195
+ const appConfigRuntimeAction = (args) => async (params) => {
196
+ const handler = router.handler();
197
+ const { appConfig } = args;
198
+ return await handler({
199
+ ...params,
200
+ appConfig
201
+ });
202
+ };
203
+
204
+ //#endregion
205
+ exports.appConfigRuntimeAction = appConfigRuntimeAction;
@@ -12,17 +12,20 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { t as CommerceAppConfig } from "../app-CakwxQvs.cjs";
15
+ import { n as CommerceAppConfig } from "../../app-D3P-Z6uY.cjs";
16
16
  import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
17
17
 
18
- //#region source/actions/app-config.d.ts
19
- /** Arguments for the runtime action factory. */
18
+ //#region source/actions/app-config/router.d.ts
19
+ /** The arguments required to create the runtime action for the app-config action. */
20
20
  type RuntimeActionFactoryArgs = {
21
21
  appConfig: CommerceAppConfig;
22
22
  };
23
- /** Factory to create the route handler for the `app-config` action. */
24
- declare const appConfigRuntimeAction: ({
25
- appConfig
26
- }: RuntimeActionFactoryArgs) => (params: RuntimeActionParams) => Promise<import("@adobe/aio-commerce-lib-core/responses").ActionResponse>;
23
+ //#endregion
24
+ //#region source/actions/app-config/index.d.ts
25
+ /**
26
+ * Factory to create the route handler for the `app-config` action.
27
+ * @param args - The arguments required to create the runtime action.
28
+ */
29
+ declare const appConfigRuntimeAction: (args: RuntimeActionFactoryArgs) => (params: RuntimeActionParams) => Promise<import("@adobe/aio-commerce-lib-core/responses").ActionResponse>;
27
30
  //#endregion
28
31
  export { appConfigRuntimeAction };
@@ -0,0 +1,85 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright 2026 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+
15
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
16
+ const require_rolldown_runtime = require('../../rolldown-runtime-Cozy-1ZF.cjs');
17
+ const require_association_repository = require('../../association-repository-BAs3-VkW.cjs');
18
+ const require_router = require('../../router-hA_Y9gZ1.cjs');
19
+ let valibot = require("valibot");
20
+ valibot = require_rolldown_runtime.__toESM(valibot, 1);
21
+ let _adobe_aio_commerce_lib_core_commerce = require("@adobe/aio-commerce-lib-core/commerce");
22
+ let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
23
+
24
+ //#region source/actions/association/schema.ts
25
+ /** Request body for POST / — store association data. */
26
+ const AssociationRequestBodySchema = valibot.object({
27
+ commerceBaseUrl: valibot.pipe(valibot.string(), valibot.url("The 'commerceBaseUrl' field must be a valid absolute URL (e.g., 'https://my-store.example.com')")),
28
+ commerceEnv: _adobe_aio_commerce_lib_core_commerce.CommerceEnvSchema
29
+ });
30
+
31
+ //#endregion
32
+ //#region source/actions/association/router.ts
33
+ /**
34
+ * Association action router.
35
+ *
36
+ * Routes:
37
+ * - POST / Store Commerce instance details (`baseUrl`, `env`)
38
+ * - DELETE / Clear stored Commerce instance details
39
+ */
40
+ const router = new require_router.HttpActionRouter().use(require_router.logger({ name: () => "association" }));
41
+ /**
42
+ * POST / - Store association data.
43
+ *
44
+ * Persists the Commerce instance the app is associated with so runtime actions
45
+ * can later retrieve it via `getCommerceInstance` / `getCommerceClient`.
46
+ */
47
+ router.post("/", {
48
+ body: AssociationRequestBodySchema,
49
+ handler: async (req, { logger }) => {
50
+ const { commerceBaseUrl, commerceEnv } = req.body;
51
+ logger.debug(`Storing association data (baseUrl: "${commerceBaseUrl}", env: "${commerceEnv}")`);
52
+ await require_association_repository.setAssociationData({
53
+ baseUrl: commerceBaseUrl,
54
+ env: commerceEnv
55
+ });
56
+ return (0, _adobe_aio_commerce_lib_core_responses.noContent)();
57
+ }
58
+ });
59
+ /**
60
+ * DELETE / - Clear association data.
61
+ *
62
+ * Called when the app is unassociated.
63
+ */
64
+ router.delete("/", { handler: async (_req, { logger }) => {
65
+ logger.debug("Clearing association data");
66
+ await require_association_repository.clearAssociationData();
67
+ return (0, _adobe_aio_commerce_lib_core_responses.noContent)();
68
+ } });
69
+
70
+ //#endregion
71
+ //#region source/actions/association/index.ts
72
+ /**
73
+ * Factory to create the route handler for the `association` action.
74
+ *
75
+ * The `association` action manages the lifecycle of the Commerce instance the
76
+ * app is associated with — `POST /` stores the data when the app is associated,
77
+ * and `DELETE /` clears it on unassociation. Runtime actions consume the data
78
+ * via `getCommerceInstance` / `getCommerceClient` from the root entrypoint.
79
+ */
80
+ const associationRuntimeAction = () => async (params) => {
81
+ return await router.handler()({ ...params });
82
+ };
83
+
84
+ //#endregion
85
+ exports.associationRuntimeAction = associationRuntimeAction;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright 2026 Adobe. All rights reserved.
5
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License. You may obtain a copy
7
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
11
+ * OF ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ */
14
+
15
+ import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
16
+
17
+ //#region source/actions/association/index.d.ts
18
+ /**
19
+ * Factory to create the route handler for the `association` action.
20
+ *
21
+ * The `association` action manages the lifecycle of the Commerce instance the
22
+ * app is associated with — `POST /` stores the data when the app is associated,
23
+ * and `DELETE /` clears it on unassociation. Runtime actions consume the data
24
+ * via `getCommerceInstance` / `getCommerceClient` from the root entrypoint.
25
+ */
26
+ declare const associationRuntimeAction: () => (params: RuntimeActionParams) => Promise<import("@adobe/aio-commerce-lib-core/responses").ActionResponse>;
27
+ //#endregion
28
+ export { associationRuntimeAction };
@@ -13,33 +13,52 @@
13
13
  */
14
14
 
15
15
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
16
- const require_chunk = require('../chunk-Cozy-1ZF.cjs');
17
- const require_router = require('../router-BOR7T6qR.cjs');
18
- const require_schemas = require('../schemas-FngDuIeo.cjs');
16
+ const require_rolldown_runtime = require('../../rolldown-runtime-Cozy-1ZF.cjs');
17
+ const require_schemas = require('../../schemas-mLxMh_ko.cjs');
18
+ const require_environment = require('../../environment-B7EnozSg.cjs');
19
+ const require_router = require('../../router-hA_Y9gZ1.cjs');
19
20
  let _adobe_aio_commerce_lib_config = require("@adobe/aio-commerce-lib-config");
20
- let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
21
21
  let valibot = require("valibot");
22
- valibot = require_chunk.__toESM(valibot, 1);
22
+ valibot = require_rolldown_runtime.__toESM(valibot, 1);
23
+ let _adobe_aio_commerce_lib_core_commerce = require("@adobe/aio-commerce-lib-core/commerce");
24
+ let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
23
25
 
24
- //#region source/actions/config.ts
26
+ //#region source/actions/config/schema.ts
27
+ const AcceptedConfigurationValuesSchema = valibot.union([
28
+ valibot.boolean(),
29
+ valibot.string(),
30
+ valibot.array(valibot.string())
31
+ ]);
32
+ /** Query parameters for GET / */
33
+ const GetConfigurationQuerySchema = valibot.object({
34
+ commerceEnv: valibot.optional(_adobe_aio_commerce_lib_core_commerce.CommerceEnvSchema),
35
+ scopeId: require_schemas.nonEmptyStringValueSchema("scopeId")
36
+ });
37
+ /** Request body for PUT / */
38
+ const PutConfigBodySchema = valibot.object({
39
+ config: valibot.array(valibot.object({
40
+ name: require_schemas.nonEmptyStringValueSchema("config[i].name"),
41
+ value: valibot.union([valibot.string(), valibot.array(valibot.string())])
42
+ })),
43
+ scopeId: require_schemas.nonEmptyStringValueSchema("scopeId")
44
+ });
45
+ /** Request body for PATCH / */
46
+ const PatchConfigBodySchema = valibot.object({
47
+ config: valibot.array(valibot.object({
48
+ name: require_schemas.nonEmptyStringValueSchema("config[i].name"),
49
+ value: valibot.nullable(AcceptedConfigurationValuesSchema)
50
+ })),
51
+ scopeId: require_schemas.nonEmptyStringValueSchema("scopeId")
52
+ });
53
+
54
+ //#endregion
55
+ //#region source/actions/config/router.ts
25
56
  const MASKED_PASSWORD_VALUE = "*****";
26
- /** The set of valid Commerce environments a configuration field can be scoped to. */
27
- const COMMERCE_ENVS = ["paas", "saas"];
28
- /**
29
- * Filters a business configuration schema to the fields applicable to the
30
- * given Commerce environment. Fields without an `env` property apply to all
31
- * environments and are always included.
32
- * @param schema - The business configuration schema to filter.
33
- * @param env - The Commerce environment to filter by.
34
- */
35
- function filterSchemaByEnv(schema, env) {
36
- return schema.filter((field) => field.env === void 0 || field.env.includes(env));
37
- }
38
57
  /**
39
58
  * Filters password fields from the configuration values.
59
+ *
40
60
  * @param schema - The schema to use to filter the values.
41
61
  * @param values - The values to filter.
42
- * @returns The filtered values.
43
62
  */
44
63
  function filterPasswordFields(schema, values) {
45
64
  return values.map((item) => {
@@ -50,22 +69,26 @@ function filterPasswordFields(schema, values) {
50
69
  return item;
51
70
  });
52
71
  }
53
- const router = new require_router.HttpActionRouter().use(require_router.logger());
72
+ /**
73
+ * Config action router.
74
+ *
75
+ * Routes:
76
+ * - GET / Get current configuration values for a given scope
77
+ * - POST / Set configuration (overrides all values for the scope) (deprecated)
78
+ * - PATCH / Partially update configuration (only updates provided fields, allows unsetting)
79
+ */
80
+ const router = new require_router.HttpActionRouter().use(require_router.logger({ name: () => "config" }));
54
81
  /** GET / - Retrieve configuration */
55
82
  router.get("/", {
56
- query: valibot.object({
57
- scopeId: require_schemas.nonEmptyStringValueSchema("scopeId"),
58
- commerceEnv: valibot.optional(valibot.picklist(COMMERCE_ENVS))
59
- }),
60
83
  handler: async (req, ctx) => {
61
84
  const { logger, rawParams } = ctx;
62
85
  const { configSchema: rawConfigSchema } = rawParams;
63
86
  const env = req.query.commerceEnv;
64
- const envFilteredSchema = env ? filterSchemaByEnv(rawConfigSchema, env) : rawConfigSchema;
87
+ const envFilteredSchema = env ? require_environment.filterSchemaByEnv(rawConfigSchema, env) : rawConfigSchema;
65
88
  logger.debug("Initializing configuration");
66
89
  const { configSchema } = await (0, _adobe_aio_commerce_lib_config.initialize)({
67
- schema: envFilteredSchema,
68
- params: rawParams
90
+ params: rawParams,
91
+ schema: envFilteredSchema
69
92
  });
70
93
  const { scopeId } = req.query;
71
94
  logger.debug(`Retrieving configuration with scope id: ${scopeId}`);
@@ -76,28 +99,24 @@ router.get("/", {
76
99
  schema: configSchema,
77
100
  values: appConfiguration
78
101
  } });
79
- }
102
+ },
103
+ query: GetConfigurationQuerySchema
80
104
  });
81
105
  /**
82
106
  * PUT / - Set configuration (deprecated)
107
+ *
83
108
  * @deprecated Use PATCH instead. This endpoint overwrites all values for the scope
84
109
  * and does not support partial updates or unset semantics.
85
110
  */
86
111
  router.put("/", {
87
- body: valibot.object({
88
- scopeId: require_schemas.nonEmptyStringValueSchema("scopeId"),
89
- config: valibot.array(valibot.object({
90
- name: require_schemas.nonEmptyStringValueSchema("config.name"),
91
- value: valibot.union([valibot.string(), valibot.array(valibot.string())])
92
- }))
93
- }),
112
+ body: PutConfigBodySchema,
94
113
  handler: async (req, ctx) => {
95
114
  const { logger, rawParams } = ctx;
96
115
  logger.debug(`Setting configuration with scope id: ${req.body.scopeId}`);
97
116
  const { scopeId, config } = req.body;
98
117
  const { configSchema } = await (0, _adobe_aio_commerce_lib_config.initialize)({
99
- schema: rawParams.configSchema,
100
- params: rawParams
118
+ params: rawParams,
119
+ schema: rawParams.configSchema
101
120
  });
102
121
  const result = await (0, _adobe_aio_commerce_lib_config.setConfiguration)({ config: config.filter((item) => item.value !== MASKED_PASSWORD_VALUE) }, (0, _adobe_aio_commerce_lib_config.byScopeId)(scopeId), { encryptionKey: rawParams.AIO_COMMERCE_CONFIG_ENCRYPTION_KEY });
103
122
  result.config = filterPasswordFields(configSchema, result.config);
@@ -112,24 +131,14 @@ router.put("/", {
112
131
  });
113
132
  /** PATCH / - Partially update configuration */
114
133
  router.patch("/", {
115
- body: valibot.object({
116
- scopeId: require_schemas.nonEmptyStringValueSchema("scopeId"),
117
- config: valibot.array(valibot.object({
118
- name: require_schemas.nonEmptyStringValueSchema("config.name"),
119
- value: valibot.nullable(valibot.union([
120
- valibot.boolean(),
121
- valibot.string(),
122
- valibot.array(valibot.string())
123
- ]))
124
- }))
125
- }),
134
+ body: PatchConfigBodySchema,
126
135
  handler: async (req, ctx) => {
127
136
  const { logger, rawParams } = ctx;
128
137
  logger.debug(`Patching configuration with scope id: ${req.body.scopeId}`);
129
138
  const { scopeId, config } = req.body;
130
139
  const { configSchema } = await (0, _adobe_aio_commerce_lib_config.initialize)({
131
- schema: rawParams.configSchema,
132
- params: rawParams
140
+ params: rawParams,
141
+ schema: rawParams.configSchema
133
142
  });
134
143
  const result = await (0, _adobe_aio_commerce_lib_config.setConfiguration)({ config }, (0, _adobe_aio_commerce_lib_config.byScopeId)(scopeId), { encryptionKey: rawParams.AIO_COMMERCE_CONFIG_ENCRYPTION_KEY });
135
144
  result.config = filterPasswordFields(configSchema, result.config);
@@ -139,9 +148,17 @@ router.patch("/", {
139
148
  });
140
149
  }
141
150
  });
142
- /** Factory to create the route handler for the `config` action. */
143
- const configRuntimeAction = ({ configSchema }) => async (params) => {
144
- return await router.handler()({
151
+
152
+ //#endregion
153
+ //#region source/actions/config/index.ts
154
+ /**
155
+ * Factory to create the route handler for the `config` action.
156
+ * @param args - The arguments required to create the runtime action.
157
+ */
158
+ const configRuntimeAction = (args) => async (params) => {
159
+ const handler = router.handler();
160
+ const { configSchema } = args;
161
+ return await handler({
145
162
  ...params,
146
163
  configSchema
147
164
  });