@adobe/aio-commerce-lib-app 2.1.0 → 2.2.0-beta-20261105172845

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 (48) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/actions/app-config/index.cjs +5 -5
  3. package/dist/cjs/actions/app-config/index.d.cts +1 -1
  4. package/dist/cjs/actions/association/index.cjs +2 -2
  5. package/dist/cjs/actions/config/index.cjs +2 -2
  6. package/dist/cjs/actions/installation/index.cjs +5 -5
  7. package/dist/cjs/actions/installation/index.d.cts +2 -2
  8. package/dist/cjs/actions/scope-tree/index.cjs +2 -2
  9. package/dist/cjs/{app-Ch19CR6g.d.cts → app-CiZuhrsm.d.cts} +326 -0
  10. package/dist/cjs/commands/index.cjs +10 -9
  11. package/dist/cjs/config/index.browser.d.cts +1 -1
  12. package/dist/cjs/config/index.node.cjs +3 -3
  13. package/dist/cjs/config/index.node.d.cts +88 -4
  14. package/dist/{es/define-C95h_wa0.d.mts → cjs/define-CZRjG5N_.d.cts} +1 -1
  15. package/dist/cjs/{index-D-Qn-irL.d.cts → index-Bu2X-HUh.d.cts} +2 -2
  16. package/dist/cjs/{index.node-CxdwPrOg.cjs → index.node-Boszndri.cjs} +1 -1
  17. package/dist/cjs/management/index.cjs +1 -1
  18. package/dist/cjs/management/index.d.cts +1 -1
  19. package/dist/cjs/{management-C_JQpgVB.cjs → management-C_cVbr0s.cjs} +17 -5
  20. package/dist/cjs/{openapi-DFoMdZzI.cjs → openapi-c06taOv1.cjs} +412 -45
  21. package/dist/cjs/{validate-B0rOILvG.cjs → validate-CunJ4fUD.cjs} +1 -1
  22. package/dist/cjs/{router-DpB8wpR2.cjs → version-CUu8Ks59.cjs} +77 -19
  23. package/dist/cjs/{webhooks-TvDm57xt.cjs → webhooks-C5ONLbQ4.cjs} +53 -12
  24. package/dist/{es/webhooks-C9vMZZDZ.d.mts → cjs/webhooks-DX7km8wk.d.cts} +266 -10
  25. package/dist/es/actions/app-config/index.d.mts +1 -1
  26. package/dist/es/actions/app-config/index.mjs +5 -5
  27. package/dist/es/actions/association/index.mjs +2 -2
  28. package/dist/es/actions/config/index.mjs +2 -2
  29. package/dist/es/actions/installation/index.d.mts +2 -2
  30. package/dist/es/actions/installation/index.mjs +5 -5
  31. package/dist/es/actions/scope-tree/index.mjs +2 -2
  32. package/dist/es/{app-Ch19CR6g.d.mts → app-CiZuhrsm.d.mts} +326 -0
  33. package/dist/es/commands/index.mjs +10 -9
  34. package/dist/es/config/index.browser.d.mts +1 -1
  35. package/dist/es/config/index.node.d.mts +88 -4
  36. package/dist/es/config/index.node.mjs +3 -3
  37. package/dist/{cjs/define-C12IwNNN.d.cts → es/define-9bwRE_UG.d.mts} +1 -1
  38. package/dist/es/{index-VgCNSlLP.d.mts → index-Cho-eRFD.d.mts} +2 -2
  39. package/dist/es/{index.node-C8EXBW94.mjs → index.node-BVO6sC7z.mjs} +1 -1
  40. package/dist/es/management/index.d.mts +1 -1
  41. package/dist/es/management/index.mjs +1 -1
  42. package/dist/es/{management-DKDR7-fX.mjs → management-BYmbjhGb.mjs} +17 -5
  43. package/dist/es/{openapi-E_1RFhAr.mjs → openapi-C_TGWLou.mjs} +412 -45
  44. package/dist/es/{validate-CiJIjyOr.mjs → validate-D-Oh-sxE.mjs} +1 -1
  45. package/dist/es/{router-C23GIyGQ.mjs → version-C-Pkqohl.mjs} +71 -20
  46. package/dist/{cjs/webhooks-Buu1d7AB.d.cts → es/webhooks-B7UjO8dd.d.mts} +266 -10
  47. package/dist/es/{webhooks-CfrYeMy_.mjs → webhooks-CMb_05b6.mjs} +48 -13
  48. package/package.json +3 -3
@@ -105,7 +105,7 @@ const ViewButtonLevelSchema = v.picklist([
105
105
  0,
106
106
  1
107
107
  ]);
108
- const OrderViewButtonSchema = v.variant("type", [v.strictObject({
108
+ const ViewButtonViewSchema = v.strictObject({
109
109
  aclProtected: v.optional(v.boolean()),
110
110
  confirm: v.optional(ConfirmSchema),
111
111
  description: v.optional(nonEmptyStringValueSchema("view button description")),
@@ -117,7 +117,8 @@ const OrderViewButtonSchema = v.variant("type", [v.strictObject({
117
117
  sandboxPermissions: v.optional(SandboxPermissionsSchema),
118
118
  sortOrder: v.optional(positiveNumberValueSchema("sortOrder")),
119
119
  type: v.literal("view")
120
- }), v.strictObject({
120
+ });
121
+ const ViewButtonWorkerSchema = v.strictObject({
121
122
  aclProtected: v.optional(v.boolean()),
122
123
  confirm: v.optional(ConfirmSchema),
123
124
  description: v.optional(nonEmptyStringValueSchema("view button description")),
@@ -129,7 +130,16 @@ const OrderViewButtonSchema = v.variant("type", [v.strictObject({
129
130
  sortOrder: v.optional(positiveNumberValueSchema("sortOrder")),
130
131
  timeout: v.optional(positiveNumberValueSchema("timeout")),
131
132
  type: v.literal("worker")
132
- })]);
133
+ });
134
+ const OrderViewButtonSchema = v.variant("type", [ViewButtonViewSchema, ViewButtonWorkerSchema]);
135
+ const InvoiceViewButtonSchema = v.variant("type", [v.strictObject({
136
+ ...ViewButtonViewSchema.entries,
137
+ title: v.optional(nonEmptyStringValueSchema("view button page title"))
138
+ }), ViewButtonWorkerSchema]);
139
+ const CreditMemoViewButtonSchema = v.variant("type", [v.strictObject({
140
+ ...ViewButtonViewSchema.entries,
141
+ title: v.optional(nonEmptyStringValueSchema("view button page title"))
142
+ }), ViewButtonWorkerSchema]);
133
143
  const MassActionsSchema = v.pipe(v.array(MassActionSchema), v.check((items) => hasUniqueSanitizedIds(items), "Mass action ids must be unique after Commerce id sanitization."));
134
144
  const AdminUiOrderSchema = v.object({
135
145
  gridColumns: v.optional(GridColumnsSchema),
@@ -140,6 +150,14 @@ const AdminUiGridAndMassActionEntitySchema = v.object({
140
150
  gridColumns: v.optional(GridColumnsSchema),
141
151
  massActions: v.optional(MassActionsSchema)
142
152
  });
153
+ const AdminUiInvoiceSchema = v.object({
154
+ gridColumns: v.optional(GridColumnsSchema),
155
+ viewButtons: v.optional(v.pipe(v.array(InvoiceViewButtonSchema), v.check((items) => hasUniqueSanitizedIds(items), "Invoice view button ids must be unique after Commerce id sanitization.")))
156
+ });
157
+ const AdminUiCreditMemoSchema = v.object({
158
+ gridColumns: v.optional(GridColumnsSchema),
159
+ viewButtons: v.optional(v.pipe(v.array(CreditMemoViewButtonSchema), v.check((items) => hasUniqueSanitizedIds(items), "Credit memo view button ids must be unique after Commerce id sanitization.")))
160
+ });
143
161
  const AdminUiGridOnlyEntitySchema = v.object({ gridColumns: v.optional(GridColumnsSchema) });
144
162
  const MenuIdSchema = v.pipe(nonEmptyStringValueSchema("menu ID"), v.regex(/^[A-Za-z0-9_/:]+$/u, "Menu ID may contain only letters, digits, \"/\", \":\", and \"_\""));
145
163
  const MenuSchema = v.object({
@@ -156,6 +174,14 @@ const MenuSchema = v.object({
156
174
  parentMenu: v.optional(v.picklist(COMMERCE_MENUS, "parentMenu must be a known Commerce Admin menu ID")),
157
175
  sandboxPermissions: v.optional(SandboxPermissionsSchema)
158
176
  });
177
+ const NATIVE_UI_REPLACED_PAGE_TARGETS = ["order.create"];
178
+ const NativeUiReplacedPageSchema = v.strictObject({
179
+ path: nonEmptyStringValueSchema("replaced page path"),
180
+ sandboxPermissions: v.optional(SandboxPermissionsSchema),
181
+ target: v.picklist(NATIVE_UI_REPLACED_PAGE_TARGETS, `Invalid native UI replaced page target. Accepted values are: ${NATIVE_UI_REPLACED_PAGE_TARGETS.join(", ")}`),
182
+ title: nonEmptyStringValueSchema("replaced page title")
183
+ });
184
+ const NativeUiSchema = v.object({ replacedPages: v.pipe(v.array(NativeUiReplacedPageSchema), v.check((pages) => new Set(pages.map((page) => page.target)).size === pages.length, "Native UI replaced page targets must be unique.")) });
159
185
  const AclResourceIdSchema = v.pipe(nonEmptyStringValueSchema("acl resource ID"), v.regex(/^[a-z0-9_]+$/u, "ACL resource ID may contain only lowercase letters, digits, and \"_\""));
160
186
  const ACL_LABEL_MIN_LENGTH = 3;
161
187
  const ACL_LABEL_MAX_LENGTH = 50;
@@ -192,14 +218,15 @@ const AdminUiAclSchema = v.pipe(v.array(AclResourceEntrySchema), v.minLength(1,
192
218
  }, "Custom ACL resource ids must stay unique after Commerce derivation: a top-level resource id must not equal a group's \"<group>_<child>\" combination."));
193
219
  /**
194
220
  * Schema for the `adminUi` config section.
195
- * Supports grid column extensions, mass actions, order view buttons, menu, and custom ACL resources on `commerce/backend-ui/2`.
221
+ * Supports grid column extensions, mass actions, order, invoice, and credit memo view buttons, menu, native UI replaced pages, and custom ACL resources on `commerce/backend-ui/2`.
196
222
  */
197
223
  const AdminUiSchema = v.object({
198
224
  acl: v.optional(AdminUiAclSchema),
199
- creditMemo: v.optional(AdminUiGridOnlyEntitySchema),
225
+ creditMemo: v.optional(AdminUiCreditMemoSchema),
200
226
  customer: v.optional(AdminUiGridAndMassActionEntitySchema),
201
- invoice: v.optional(AdminUiGridOnlyEntitySchema),
227
+ invoice: v.optional(AdminUiInvoiceSchema),
202
228
  menu: v.optional(MenuSchema),
229
+ nativeUi: v.optional(NativeUiSchema),
203
230
  newsletter: v.optional(AdminUiGridOnlyEntitySchema),
204
231
  order: v.optional(AdminUiOrderSchema),
205
232
  product: v.optional(AdminUiGridAndMassActionEntitySchema),
@@ -224,22 +251,30 @@ const ADMIN_UI_MASS_ACTION_ENTITIES = [
224
251
  "product",
225
252
  "customer"
226
253
  ];
254
+ /** Entities that support view buttons, in a stable order. */
255
+ const ADMIN_UI_VIEW_BUTTON_ENTITIES = [
256
+ "order",
257
+ "invoice",
258
+ "creditMemo"
259
+ ];
227
260
  /**
228
261
  * Check whether the config declares an Admin UI component that requires the
229
262
  * `commerce/backend-ui/2` extension point — a menu, grid columns, mass actions,
230
- * or view buttons. Custom ACL resources are deliberately excluded: they reach
231
- * Commerce through the `extensibility/1` app-config payload, not backend-ui/2,
232
- * so an acl-only config needs no backend-ui/2 registration.
263
+ * view buttons, or native UI replaced pages. Custom ACL resources are
264
+ * deliberately excluded: they reach Commerce through the `extensibility/1`
265
+ * app-config payload, not backend-ui/2, so an acl-only config needs no
266
+ * backend-ui/2 registration.
233
267
  */
234
268
  function hasBackendUiV2Components(config) {
235
269
  const { adminUi } = config;
236
270
  if (!adminUi) return false;
237
- return Boolean(adminUi.menu || adminUi.order?.gridColumns || adminUi.order?.massActions?.length || adminUi.order?.viewButtons?.length || adminUi.product?.gridColumns || adminUi.product?.massActions?.length || adminUi.customer?.gridColumns || adminUi.customer?.massActions?.length || adminUi.invoice?.gridColumns || adminUi.creditMemo?.gridColumns || adminUi.shipment?.gridColumns || adminUi.newsletter?.gridColumns);
271
+ return Boolean(adminUi.menu || adminUi.order?.gridColumns || adminUi.order?.massActions?.length || adminUi.order?.viewButtons?.length || adminUi.product?.gridColumns || adminUi.product?.massActions?.length || adminUi.customer?.gridColumns || adminUi.customer?.massActions?.length || adminUi.invoice?.gridColumns || adminUi.invoice?.viewButtons?.length || adminUi.creditMemo?.gridColumns || adminUi.creditMemo?.viewButtons?.length || adminUi.shipment?.gridColumns || adminUi.nativeUi?.replacedPages?.length || adminUi.newsletter?.gridColumns);
238
272
  }
239
273
  /**
240
274
  * Check whether the config declares at least one Admin UI component (menu, grid
241
- * columns, mass actions, view buttons, or custom ACL resources). A component-less `adminUi` block is
242
- * treated as absent — it registers nothing.
275
+ * columns, mass actions, view buttons, native UI replaced pages, or custom ACL
276
+ * resources). A component-less `adminUi` block is treated as absent — it
277
+ * registers nothing.
243
278
  */
244
279
  function hasAdminUi(config) {
245
280
  return hasBackendUiV2Components(config) || Boolean(config.adminUi?.acl?.length);
@@ -543,4 +578,4 @@ function hasWebhooks(config) {
543
578
  return Array.isArray(config?.webhooks) && config.webhooks.length > 0;
544
579
  }
545
580
 
546
- export { hasCustomInstallationSteps as a, hasEventing as c, ADMIN_UI_MASS_ACTION_ENTITIES as d, AdminUiSchema as f, hasCustomInstallation as i, hasExternalEvents as l, hasBackendUiV2Components as m, hasWebhooks as n, EventingSchema as o, hasAdminUi as p, InstallationSchema as r, hasCommerceEvents as s, WebhooksSchema as t, ADMIN_UI_GRID_COLUMN_ENTITIES as u };
581
+ export { hasCustomInstallationSteps as a, hasEventing as c, ADMIN_UI_MASS_ACTION_ENTITIES as d, ADMIN_UI_VIEW_BUTTON_ENTITIES as f, hasBackendUiV2Components as h, hasCustomInstallation as i, hasExternalEvents as l, hasAdminUi as m, hasWebhooks as n, EventingSchema as o, AdminUiSchema as p, InstallationSchema as r, hasCommerceEvents as s, WebhooksSchema as t, ADMIN_UI_GRID_COLUMN_ENTITIES as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/aio-commerce-lib-app",
3
- "version": "2.1.0",
3
+ "version": "2.2.0-beta-20261105172845",
4
4
  "private": false,
5
5
  "description": "App configuration management library for Adobe Commerce applications",
6
6
  "keywords": [
@@ -92,10 +92,10 @@
92
92
  "README.md"
93
93
  ],
94
94
  "dependencies": {
95
- "@adobe/aio-commerce-lib-admin-ui": "1.2.0",
95
+ "@adobe/aio-commerce-lib-admin-ui": "1.3.0-beta-20261105172845",
96
96
  "@adobe/aio-commerce-lib-api": "1.4.1",
97
97
  "@adobe/aio-commerce-lib-auth": "1.2.0",
98
- "@adobe/aio-commerce-lib-config": "1.8.1",
98
+ "@adobe/aio-commerce-lib-config": "1.8.2-beta-20261105172845",
99
99
  "@adobe/aio-commerce-lib-core": "1.3.0",
100
100
  "@adobe/aio-commerce-lib-events": "1.5.0",
101
101
  "@adobe/aio-commerce-lib-webhooks": "1.2.3",