@adobe/aio-commerce-lib-app 1.7.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 (93) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/dist/cjs/actions/app-config/index.cjs +41 -38
  3. package/dist/cjs/actions/app-config/index.d.cts +1 -1
  4. package/dist/cjs/actions/association/index.cjs +85 -0
  5. package/dist/cjs/actions/{registration → association}/index.d.cts +9 -13
  6. package/dist/cjs/actions/config/index.cjs +21 -32
  7. package/dist/cjs/actions/installation/index.cjs +72 -51
  8. package/dist/cjs/actions/installation/index.d.cts +2 -2
  9. package/dist/cjs/actions/scope-tree/index.cjs +18 -17
  10. package/dist/{es/app-DrYHK-z1.d.mts → cjs/app-D3P-Z6uY.d.cts} +1085 -1035
  11. package/dist/cjs/association-repository-BAs3-VkW.cjs +69 -0
  12. package/dist/cjs/commands/index.cjs +512 -298
  13. package/dist/cjs/commands/templates/admin-ui/tsconfig.json +14 -0
  14. package/dist/cjs/commands/templates/admin-ui/web-src/index.css +5 -0
  15. package/dist/cjs/commands/templates/admin-ui/web-src/index.html +17 -0
  16. package/dist/cjs/commands/templates/admin-ui/web-src/src/app.jsx +13 -0
  17. package/dist/cjs/commands/templates/admin-ui/web-src/src/components/welcome.jsx +12 -0
  18. package/dist/cjs/commands/templates/admin-ui/web-src/src/pages/main-page.jsx +10 -0
  19. package/dist/cjs/commands/templates/{admin-ui-sdk/registration.js.template → admin-ui/web-src-template.d.ts} +11 -6
  20. package/dist/cjs/commands/templates/app-management/app-config.js.template +1 -14
  21. package/dist/cjs/commands/templates/app-management/association.js.template +6 -0
  22. package/dist/cjs/commands/templates/app-management/installation.js.template +1 -13
  23. package/dist/cjs/commands/templates/business-configuration/config.js.template +2 -15
  24. package/dist/cjs/commands/templates/business-configuration/scope-tree.js.template +0 -12
  25. package/dist/cjs/config/index.browser.cjs +18 -0
  26. package/dist/cjs/config/index.browser.d.cts +16 -0
  27. package/dist/cjs/config/{index.cjs → index.node.cjs} +9 -8
  28. package/dist/cjs/config/{index.d.cts → index.node.d.cts} +954 -386
  29. package/dist/cjs/define-DBxAlJfN.d.cts +34 -0
  30. package/dist/cjs/define-hlcQw7Cv.cjs +41 -0
  31. package/dist/cjs/environment-B7EnozSg.cjs +135 -0
  32. package/dist/cjs/{index-B5gJ-q4U.d.cts → index-CzReNwbF.d.cts} +17 -12
  33. package/dist/cjs/index.cjs +250 -0
  34. package/dist/cjs/index.d.cts +217 -0
  35. package/dist/cjs/{config-D-s0GSep.cjs → index.node-Dz4lV4qe.cjs} +119 -35
  36. package/dist/cjs/{logging-BVz3weoC.cjs → logging-udPuAJPt.cjs} +2 -2
  37. package/dist/cjs/management/index.cjs +1 -1
  38. package/dist/cjs/management/index.d.cts +1 -1
  39. package/dist/cjs/{management-Dehz9qSJ.cjs → management-B9ItB80R.cjs} +385 -582
  40. package/dist/cjs/{openapi-Cux6K4ZD.cjs → openapi-CwytYdWl.cjs} +476 -600
  41. package/dist/cjs/{router-BOR7T6qR.cjs → router-hA_Y9gZ1.cjs} +42 -44
  42. package/dist/cjs/{schemas-FngDuIeo.cjs → schemas-mLxMh_ko.cjs} +2 -2
  43. package/dist/cjs/utils-DSCmZ_iJ.cjs +408 -0
  44. package/dist/cjs/{validate-oAOpyFyb.cjs → validate-BfxhZ5Wv.cjs} +20 -20
  45. package/dist/cjs/{webhooks-tbZy9G3p.cjs → webhooks-B5tb9NeF.cjs} +159 -151
  46. package/dist/es/actions/app-config/index.d.mts +1 -1
  47. package/dist/es/actions/app-config/index.mjs +39 -36
  48. package/dist/es/actions/{registration → association}/index.d.mts +9 -13
  49. package/dist/es/actions/association/index.mjs +82 -0
  50. package/dist/es/actions/config/index.mjs +17 -28
  51. package/dist/es/actions/installation/index.d.mts +2 -2
  52. package/dist/es/actions/installation/index.mjs +69 -48
  53. package/dist/es/actions/scope-tree/index.mjs +14 -13
  54. package/dist/{cjs/app-DrYHK-z1.d.cts → es/app-D3P-Z6uY.d.mts} +1085 -1035
  55. package/dist/es/association-repository-BbQv9WCl.mjs +52 -0
  56. package/dist/es/commands/index.mjs +544 -328
  57. package/dist/es/commands/templates/admin-ui/tsconfig.json +14 -0
  58. package/dist/es/commands/templates/admin-ui/web-src/index.css +5 -0
  59. package/dist/es/commands/templates/admin-ui/web-src/index.html +17 -0
  60. package/dist/es/commands/templates/admin-ui/web-src/src/app.jsx +13 -0
  61. package/dist/es/commands/templates/admin-ui/web-src/src/components/welcome.jsx +12 -0
  62. package/dist/es/commands/templates/admin-ui/web-src/src/pages/main-page.jsx +10 -0
  63. package/dist/es/commands/templates/{admin-ui-sdk/registration.js.template → admin-ui/web-src-template.d.ts} +11 -6
  64. package/dist/es/commands/templates/app-management/app-config.js.template +1 -14
  65. package/dist/es/commands/templates/app-management/association.js.template +6 -0
  66. package/dist/es/commands/templates/app-management/installation.js.template +1 -13
  67. package/dist/es/commands/templates/business-configuration/config.js.template +2 -15
  68. package/dist/es/commands/templates/business-configuration/scope-tree.js.template +0 -12
  69. package/dist/es/config/index.browser.d.mts +16 -0
  70. package/dist/es/config/index.browser.mjs +17 -0
  71. package/dist/es/config/{index.d.mts → index.node.d.mts} +954 -386
  72. package/dist/es/config/{index.mjs → index.node.mjs} +5 -4
  73. package/dist/es/define-EoYRZbpe.d.mts +34 -0
  74. package/dist/es/define-Z_Glf1-_.mjs +35 -0
  75. package/dist/es/environment-C84BPRJZ.mjs +104 -0
  76. package/dist/es/{index-DLMbTtKS.d.mts → index-D52xglhZ.d.mts} +17 -12
  77. package/dist/es/index.d.mts +217 -0
  78. package/dist/es/index.mjs +242 -0
  79. package/dist/es/{config-3I4eLyyR.mjs → index.node-CDH5gwJE.mjs} +94 -30
  80. package/dist/es/management/index.d.mts +1 -1
  81. package/dist/es/management/index.mjs +1 -1
  82. package/dist/es/{management-BUX-w2Ji.mjs → management-B89ApQVY.mjs} +353 -550
  83. package/dist/es/{openapi-B6uP0SRn.mjs → openapi-CXonvevE.mjs} +476 -600
  84. package/dist/es/{router-D58JJHHA.mjs → router-B_h0cvjc.mjs} +40 -42
  85. package/dist/es/utils-_gj8L6eN.mjs +289 -0
  86. package/dist/es/{validate-Dfajrp99.mjs → validate-9cRZWGrA.mjs} +17 -17
  87. package/dist/es/{webhooks-B5oq9ULL.mjs → webhooks-BBPbY2mb.mjs} +150 -142
  88. package/package.json +40 -17
  89. package/dist/cjs/actions/registration/index.cjs +0 -50
  90. package/dist/cjs/admin-ui-sdk-EU915zlR.d.cts +0 -664
  91. package/dist/es/actions/registration/index.mjs +0 -49
  92. package/dist/es/admin-ui-sdk-BwnD0xjK.d.mts +0 -664
  93. /package/dist/cjs/{chunk-Cozy-1ZF.cjs → rolldown-runtime-Cozy-1ZF.cjs} +0 -0
@@ -12,13 +12,13 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- const require_chunk = require('./chunk-Cozy-1ZF.cjs');
16
- const require_schemas = require('./schemas-FngDuIeo.cjs');
17
- const require_webhooks = require('./webhooks-tbZy9G3p.cjs');
15
+ const require_rolldown_runtime = require('./rolldown-runtime-Cozy-1ZF.cjs');
16
+ const require_schemas = require('./schemas-mLxMh_ko.cjs');
17
+ const require_webhooks = require('./webhooks-B5tb9NeF.cjs');
18
18
  let _adobe_aio_commerce_lib_core_error = require("@adobe/aio-commerce-lib-core/error");
19
19
  let _adobe_aio_commerce_lib_config = require("@adobe/aio-commerce-lib-config");
20
20
  let valibot = require("valibot");
21
- valibot = require_chunk.__toESM(valibot, 1);
21
+ valibot = require_rolldown_runtime.__toESM(valibot, 1);
22
22
 
23
23
  //#region source/config/schema/business-configuration.ts
24
24
  /**
@@ -48,9 +48,9 @@ function nonEmptyString(fieldName) {
48
48
  }
49
49
  /** The schema for the metadata of the application. */
50
50
  const MetadataSchema = valibot.object({
51
- id: valibot.pipe(require_schemas.alphaNumericOrHyphenSchema("application id (metadata.id)"), valibot.maxLength(MAX_ID_LENGTH, `The application id must not be longer than ${MAX_ID_LENGTH} characters`)),
52
- displayName: valibot.pipe(nonEmptyString("application display name"), valibot.maxLength(MAX_DISPLAY_NAME_LENGTH, `The application display name must not be longer than ${MAX_DISPLAY_NAME_LENGTH} characters`)),
53
51
  description: valibot.pipe(nonEmptyString("metadata description"), valibot.maxLength(MAX_DESCRIPTION_LENGTH, `The metadata description must not be longer than ${MAX_DESCRIPTION_LENGTH} characters`)),
52
+ displayName: valibot.pipe(nonEmptyString("application display name"), valibot.maxLength(MAX_DISPLAY_NAME_LENGTH, `The application display name must not be longer than ${MAX_DISPLAY_NAME_LENGTH} characters`)),
53
+ id: valibot.pipe(require_schemas.alphaNumericOrHyphenSchema("application id (metadata.id)"), valibot.maxLength(MAX_ID_LENGTH, `The application id must not be longer than ${MAX_ID_LENGTH} characters`)),
54
54
  version: valibot.pipe(nonEmptyString("version"), valibot.regex(SEMVER_REGEX, "The version must follow semantic versioning (semver) format: Major.Minor.Patch (e.g., '1.0.0', '2.3.1')"))
55
55
  });
56
56
  /**
@@ -65,16 +65,16 @@ function hasMetadata(config) {
65
65
  //#region source/config/schema/domains.ts
66
66
  /** The individual validatable domains of the app config. */
67
67
  const CommerceAppConfigSchemas = {
68
- metadata: MetadataSchema,
68
+ adminUi: require_webhooks.AdminUiSchema,
69
69
  businessConfig: _adobe_aio_commerce_lib_config.SchemaBusinessConfig,
70
- eventing: require_webhooks.EventingSchema,
71
- installation: require_webhooks.InstallationSchema,
72
- webhooks: require_webhooks.WebhooksSchema,
73
70
  "businessConfig.schema": valibot.unwrap(_adobe_aio_commerce_lib_config.SchemaBusinessConfig.entries.schema),
71
+ eventing: require_webhooks.EventingSchema,
74
72
  "eventing.commerce": valibot.unwrap(require_webhooks.EventingSchema.entries.commerce),
75
73
  "eventing.external": valibot.unwrap(require_webhooks.EventingSchema.entries.external),
74
+ installation: require_webhooks.InstallationSchema,
76
75
  "installation.customInstallationSteps": valibot.unwrap(require_webhooks.InstallationSchema.entries.customInstallationSteps),
77
- adminUiSdk: require_webhooks.AdminUiSdkSchema
76
+ metadata: MetadataSchema,
77
+ webhooks: require_webhooks.WebhooksSchema
78
78
  };
79
79
  /**
80
80
  * Get the config domains that are present in the config.
@@ -84,16 +84,16 @@ function getConfigDomains(config) {
84
84
  const withCommerceEvents = require_webhooks.hasCommerceEvents(config);
85
85
  const withExternalEvents = require_webhooks.hasExternalEvents(config);
86
86
  const domains = {
87
- metadata: hasMetadata(config),
87
+ adminUi: require_webhooks.hasAdminUi(config),
88
88
  businessConfig: hasBusinessConfig(config),
89
- eventing: withCommerceEvents || withExternalEvents,
90
- installation: require_webhooks.hasCustomInstallation(config),
91
- webhooks: require_webhooks.hasWebhooks(config),
92
- adminUiSdk: require_webhooks.hasAdminUiSdk(config),
93
89
  "businessConfig.schema": hasBusinessConfigSchema(config),
90
+ eventing: withCommerceEvents || withExternalEvents,
94
91
  "eventing.commerce": withCommerceEvents,
95
92
  "eventing.external": withExternalEvents,
96
- "installation.customInstallationSteps": require_webhooks.hasCustomInstallationSteps(config)
93
+ installation: require_webhooks.hasCustomInstallation(config),
94
+ "installation.customInstallationSteps": require_webhooks.hasCustomInstallationSteps(config),
95
+ metadata: hasMetadata(config),
96
+ webhooks: require_webhooks.hasWebhooks(config)
97
97
  };
98
98
  const domainsList = Object.entries(domains).filter(([_, value]) => value).map(([key]) => key);
99
99
  return new Set(domainsList);
@@ -112,11 +112,11 @@ function hasConfigDomain(config, domain) {
112
112
  /** biome-ignore-all lint/performance/noBarrelFile: We want to have all the schema exports in one file. */
113
113
  /** The schema used to validate the commerce app config file. */
114
114
  const CommerceAppConfigSchema = valibot.looseObject({
115
- metadata: MetadataSchema,
115
+ adminUi: valibot.optional(require_webhooks.AdminUiSchema),
116
116
  businessConfig: valibot.optional(_adobe_aio_commerce_lib_config.SchemaBusinessConfig),
117
117
  eventing: valibot.optional(require_webhooks.EventingSchema),
118
- adminUiSdk: valibot.optional(require_webhooks.AdminUiSdkSchema),
119
118
  installation: valibot.optional(require_webhooks.InstallationSchema),
119
+ metadata: MetadataSchema,
120
120
  webhooks: valibot.optional(require_webhooks.WebhooksSchema)
121
121
  });
122
122
  /**
@@ -129,7 +129,7 @@ function requiresInstallationFromDomains(domains) {
129
129
  "eventing.commerce",
130
130
  "eventing.external",
131
131
  "webhooks",
132
- "adminUiSdk"
132
+ "adminUi"
133
133
  ].some((feature) => domains.has(feature));
134
134
  }
135
135
  /**
@@ -12,24 +12,34 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- const require_chunk = require('./chunk-Cozy-1ZF.cjs');
16
- const require_schemas = require('./schemas-FngDuIeo.cjs');
15
+ const require_rolldown_runtime = require('./rolldown-runtime-Cozy-1ZF.cjs');
16
+ const require_schemas = require('./schemas-mLxMh_ko.cjs');
17
17
  let valibot = require("valibot");
18
- valibot = require_chunk.__toESM(valibot, 1);
18
+ valibot = require_rolldown_runtime.__toESM(valibot, 1);
19
+ let _adobe_aio_commerce_lib_admin_ui_menu = require("@adobe/aio-commerce-lib-admin-ui/menu");
20
+ let _adobe_aio_commerce_lib_core_commerce = require("@adobe/aio-commerce-lib-core/commerce");
19
21
 
20
- //#region source/config/schema/admin-ui-sdk.ts
21
- const SANDBOX_VALUES = [
22
+ //#region source/config/schema/admin-ui.ts
23
+ const SANDBOX_PERMISSION_VALUES = [
22
24
  "allow-downloads",
23
25
  "allow-modals",
24
26
  "allow-popups"
25
27
  ];
26
- function isSandboxValue(value) {
27
- return SANDBOX_VALUES.includes(value);
28
- }
29
- const SandboxSchema = valibot.pipe(valibot.string("Expected a string value for \"sandbox\""), valibot.check((val) => val.split(" ").every(isSandboxValue), `sandbox must contain only single-space-separated values from: ${SANDBOX_VALUES.map((t) => `"${t}"`).join(", ")}`));
28
+ const SandboxPermissionsSchema = valibot.pipe(valibot.array(valibot.picklist(SANDBOX_PERMISSION_VALUES, `Invalid sandbox permission. Accepted values are: ${SANDBOX_PERMISSION_VALUES.join(", ")}`)), valibot.minLength(1, "sandboxPermissions must contain at least one permission when it's defined"), valibot.check((permissions) => {
29
+ return new Set(permissions).size === permissions.length;
30
+ }, "Duplicate permissions are not allowed in sandboxPermissions"));
31
+ const NotificationsSchema = valibot.object({
32
+ error: valibot.optional(require_schemas.nonEmptyStringValueSchema("error notification")),
33
+ success: valibot.optional(require_schemas.nonEmptyStringValueSchema("success notification"))
34
+ });
35
+ const ConfirmSchema = valibot.object({
36
+ message: valibot.optional(require_schemas.nonEmptyStringValueSchema("confirm message")),
37
+ title: valibot.optional(require_schemas.nonEmptyStringValueSchema("confirm title"))
38
+ });
30
39
  const ColumnTypeSchema = valibot.picklist([
31
40
  "boolean",
32
41
  "date",
42
+ "datetime",
33
43
  "float",
34
44
  "integer",
35
45
  "string"
@@ -39,131 +49,124 @@ const ColumnAlignSchema = valibot.picklist([
39
49
  "right",
40
50
  "center"
41
51
  ]);
42
- const ViewButtonLevelSchema = valibot.picklist([
43
- -1,
44
- 0,
45
- 1
46
- ]);
47
- const MassActionConfirmSchema = valibot.object({
48
- title: valibot.optional(require_schemas.nonEmptyStringValueSchema("confirm title")),
49
- message: valibot.optional(require_schemas.nonEmptyStringValueSchema("confirm message"))
50
- });
51
- const ViewButtonConfirmSchema = valibot.object({ message: valibot.optional(require_schemas.nonEmptyStringValueSchema("confirm message")) });
52
- const iframeActionEntries = {
53
- displayIframe: valibot.optional(require_schemas.booleanValueSchema("displayIframe")),
54
- timeout: valibot.optional(require_schemas.positiveNumberValueSchema("timeout")),
55
- sandbox: valibot.optional(SandboxSchema)
56
- };
57
- const GridColumnPropertySchema = valibot.object({
52
+ const GridColumnSchema = valibot.strictObject({
53
+ aclProtected: valibot.optional(valibot.boolean()),
54
+ align: ColumnAlignSchema,
55
+ id: require_schemas.nonEmptyStringValueSchema("column ID"),
58
56
  label: require_schemas.nonEmptyStringValueSchema("column label"),
59
- columnId: require_schemas.nonEmptyStringValueSchema("column ID"),
60
- type: ColumnTypeSchema,
61
- align: ColumnAlignSchema
57
+ type: ColumnTypeSchema
62
58
  });
63
59
  const GridColumnsSchema = valibot.object({
64
- data: valibot.object({ meshId: require_schemas.nonEmptyStringValueSchema("mesh ID") }),
65
- properties: valibot.pipe(valibot.array(GridColumnPropertySchema), valibot.minLength(1, "At least one grid column property is required"))
66
- });
67
- const massActionBaseEntries = {
68
- actionId: require_schemas.nonEmptyStringValueSchema("mass action ID"),
60
+ columns: valibot.pipe(valibot.array(GridColumnSchema), valibot.minLength(1, "At least one grid column is required")),
61
+ description: require_schemas.nonEmptyStringValueSchema("grid columns description"),
62
+ label: require_schemas.nonEmptyStringValueSchema("grid columns label"),
63
+ runtimeAction: require_schemas.nonEmptyStringValueSchema("runtime action")
64
+ });
65
+ /** Fields shared by both mass-action variants. `description` is flat — no `installation` nesting. */
66
+ const massActionCommonEntries = {
67
+ aclProtected: valibot.optional(valibot.boolean()),
68
+ confirm: valibot.optional(ConfirmSchema),
69
+ description: valibot.optional(require_schemas.nonEmptyStringValueSchema("mass action description")),
70
+ id: require_schemas.nonEmptyStringValueSchema("mass action ID"),
69
71
  label: require_schemas.nonEmptyStringValueSchema("mass action label"),
70
- title: valibot.optional(require_schemas.nonEmptyStringValueSchema("mass action page title")),
71
- confirm: valibot.optional(MassActionConfirmSchema),
72
- path: require_schemas.nonEmptyStringValueSchema("mass action path"),
73
- ...iframeActionEntries
72
+ notifications: valibot.optional(NotificationsSchema),
73
+ selectionLimit: valibot.optional(require_schemas.positiveNumberValueSchema("selectionLimit")),
74
+ title: valibot.optional(require_schemas.nonEmptyStringValueSchema("mass action page title"))
74
75
  };
75
- const sandboxDisplayIframeCheck = valibot.forward(valibot.partialCheck([["sandbox"], ["displayIframe"]], (input) => input.sandbox === void 0 || input.displayIframe === true, "sandbox is only relevant when displayIframe is set to true"), ["sandbox"]);
76
- function withSandboxDisplayIframeCheck(schema) {
77
- return valibot.pipe(schema, sandboxDisplayIframeCheck);
78
- }
79
- function createMassActionSchema(variantEntries) {
80
- return withSandboxDisplayIframeCheck(valibot.strictObject({
81
- ...massActionBaseEntries,
82
- ...variantEntries
83
- }));
84
- }
85
- const OrderMassActionSchema = createMassActionSchema({ selectionLimit: valibot.optional(require_schemas.positiveNumberValueSchema("selectionLimit")) });
86
- const ProductMassActionSchema = createMassActionSchema({ productSelectLimit: valibot.optional(require_schemas.positiveNumberValueSchema("productSelectLimit")) });
87
- const CustomerMassActionSchema = createMassActionSchema({ customerSelectLimit: valibot.optional(require_schemas.positiveNumberValueSchema("customerSelectLimit")) });
88
- const OrderViewButtonSchema = withSandboxDisplayIframeCheck(valibot.object({
89
- buttonId: require_schemas.nonEmptyStringValueSchema("view button ID"),
76
+ /** `type: "view"` mass action — renders an iframe at `path`. */
77
+ const ViewMassActionSchema = valibot.strictObject({
78
+ ...massActionCommonEntries,
79
+ path: require_schemas.nonEmptyStringValueSchema("mass action path"),
80
+ sandboxPermissions: valibot.optional(SandboxPermissionsSchema),
81
+ type: valibot.literal("view")
82
+ });
83
+ /** `type: "worker"` mass action — invokes a workerProcess runtime action. */
84
+ const WorkerMassActionSchema = valibot.strictObject({
85
+ ...massActionCommonEntries,
86
+ runtimeAction: require_schemas.nonEmptyStringValueSchema("runtimeAction"),
87
+ timeout: valibot.optional(require_schemas.positiveNumberValueSchema("timeout")),
88
+ type: valibot.literal("worker")
89
+ });
90
+ /**
91
+ * A mass action entry discriminated by `type`: `"view"` renders an iframe;
92
+ * `"worker"` invokes a runtime action.
93
+ */
94
+ const MassActionSchema = valibot.variant("type", [ViewMassActionSchema, WorkerMassActionSchema], "mass action \"type\" must be either \"view\" or \"worker\"");
95
+ const ViewButtonLevelSchema = valibot.picklist([
96
+ -1,
97
+ 0,
98
+ 1
99
+ ]);
100
+ const OrderViewButtonSchema = valibot.variant("type", [valibot.strictObject({
101
+ aclProtected: valibot.optional(valibot.boolean()),
102
+ confirm: valibot.optional(ConfirmSchema),
103
+ description: valibot.optional(require_schemas.nonEmptyStringValueSchema("view button description")),
104
+ id: require_schemas.nonEmptyStringValueSchema("view button ID"),
90
105
  label: require_schemas.nonEmptyStringValueSchema("view button label"),
91
- confirm: valibot.optional(ViewButtonConfirmSchema),
106
+ level: valibot.optional(ViewButtonLevelSchema),
107
+ notifications: valibot.optional(NotificationsSchema),
92
108
  path: require_schemas.nonEmptyStringValueSchema("view button path"),
109
+ sandboxPermissions: valibot.optional(SandboxPermissionsSchema),
110
+ sortOrder: valibot.optional(require_schemas.positiveNumberValueSchema("sortOrder")),
111
+ type: valibot.literal("view")
112
+ }), valibot.strictObject({
113
+ aclProtected: valibot.optional(valibot.boolean()),
114
+ confirm: valibot.optional(ConfirmSchema),
115
+ description: valibot.optional(require_schemas.nonEmptyStringValueSchema("view button description")),
116
+ id: require_schemas.nonEmptyStringValueSchema("view button ID"),
117
+ label: require_schemas.nonEmptyStringValueSchema("view button label"),
93
118
  level: valibot.optional(ViewButtonLevelSchema),
119
+ notifications: valibot.optional(NotificationsSchema),
120
+ runtimeAction: require_schemas.nonEmptyStringValueSchema("runtime action"),
94
121
  sortOrder: valibot.optional(require_schemas.positiveNumberValueSchema("sortOrder")),
95
- ...iframeActionEntries
96
- }));
97
- const CustomFeeSchema = valibot.object({
98
- id: require_schemas.nonEmptyStringValueSchema("custom fee ID"),
99
- label: require_schemas.nonEmptyStringValueSchema("custom fee label"),
100
- value: valibot.number("Custom fee value must be a number"),
101
- orderMinimumAmount: valibot.optional(valibot.number("orderMinimumAmount must be a number")),
102
- applyFeeOnLastInvoice: valibot.optional(require_schemas.booleanValueSchema("applyFeeOnLastInvoice")),
103
- applyFeeOnLastCreditMemo: valibot.optional(require_schemas.booleanValueSchema("applyFeeOnLastCreditMemo"))
104
- });
105
- const OrderExtensionPointsSchema = valibot.object({
106
- massActions: valibot.optional(valibot.array(OrderMassActionSchema)),
122
+ timeout: valibot.optional(require_schemas.positiveNumberValueSchema("timeout")),
123
+ type: valibot.literal("worker")
124
+ })]);
125
+ const AdminUiOrderSchema = valibot.object({
107
126
  gridColumns: valibot.optional(GridColumnsSchema),
108
- viewButtons: valibot.optional(valibot.array(OrderViewButtonSchema)),
109
- customFees: valibot.optional(valibot.array(CustomFeeSchema))
110
- });
111
- const ProductExtensionPointsSchema = valibot.object({
112
- massActions: valibot.optional(valibot.array(ProductMassActionSchema)),
113
- gridColumns: valibot.optional(GridColumnsSchema)
114
- });
115
- const CustomerExtensionPointsSchema = valibot.object({
116
- massActions: valibot.optional(valibot.array(CustomerMassActionSchema)),
117
- gridColumns: valibot.optional(GridColumnsSchema)
118
- });
119
- const MassActionBannerSchema = valibot.object({
120
- actionId: require_schemas.nonEmptyStringValueSchema("mass action ID"),
121
- successMessage: valibot.optional(require_schemas.nonEmptyStringValueSchema("success message")),
122
- errorMessage: valibot.optional(require_schemas.nonEmptyStringValueSchema("error message"))
123
- });
124
- const OrderViewButtonBannerSchema = valibot.object({
125
- buttonId: require_schemas.nonEmptyStringValueSchema("view button ID"),
126
- successMessage: valibot.optional(require_schemas.nonEmptyStringValueSchema("success message")),
127
- errorMessage: valibot.optional(require_schemas.nonEmptyStringValueSchema("error message"))
128
- });
129
- const BannerNotificationSchema = valibot.object({
130
- massActions: valibot.optional(valibot.object({
131
- order: valibot.optional(valibot.array(MassActionBannerSchema)),
132
- product: valibot.optional(valibot.array(MassActionBannerSchema)),
133
- customer: valibot.optional(valibot.array(MassActionBannerSchema))
134
- })),
135
- orderViewButtons: valibot.optional(valibot.array(OrderViewButtonBannerSchema))
136
- });
137
- const MenuItemSchema = valibot.object({
138
- id: require_schemas.nonEmptyStringValueSchema("menu item ID"),
139
- title: valibot.optional(require_schemas.nonEmptyStringValueSchema("menu item title")),
140
- parent: valibot.optional(require_schemas.nonEmptyStringValueSchema("menu item parent")),
141
- sortOrder: valibot.optional(valibot.number()),
142
- isSection: valibot.optional(require_schemas.booleanValueSchema("isSection")),
143
- sandbox: valibot.optional(SandboxSchema)
127
+ massActions: valibot.optional(valibot.array(MassActionSchema)),
128
+ viewButtons: valibot.optional(valibot.array(OrderViewButtonSchema))
144
129
  });
145
- /**
146
- * Schema for the Admin UI SDK registration parameters (for the `adminUiSdk.registration` config section).
147
- * @see https://developer.adobe.com/commerce/extensibility/admin-ui-sdk/extension-points/ for more details.
148
- */
149
- const AdminUiSdkRegistrationSchema = valibot.object({
150
- menuItems: valibot.optional(valibot.array(MenuItemSchema)),
151
- order: valibot.optional(OrderExtensionPointsSchema),
152
- product: valibot.optional(ProductExtensionPointsSchema),
153
- customer: valibot.optional(CustomerExtensionPointsSchema),
154
- bannerNotification: valibot.optional(BannerNotificationSchema)
130
+ const AdminUiProductSchema = valibot.object({
131
+ gridColumns: valibot.optional(GridColumnsSchema),
132
+ massActions: valibot.optional(valibot.array(MassActionSchema))
133
+ });
134
+ const AdminUiCustomerSchema = valibot.object({
135
+ gridColumns: valibot.optional(GridColumnsSchema),
136
+ massActions: valibot.optional(valibot.array(MassActionSchema))
137
+ });
138
+ const MenuIdSchema = valibot.pipe(require_schemas.nonEmptyStringValueSchema("menu ID"), valibot.regex(/^[A-Za-z0-9_/:]+$/, "Menu ID may contain only letters, digits, \"/\", \":\", and \"_\""));
139
+ const MenuSchema = valibot.object({
140
+ /**
141
+ * When `true`, Commerce auto-generates a per-app ACL resource id from `metadata.id`
142
+ * and injects it into the Adobe Commerce User Roles permission tree, allowing role-based
143
+ * access control per app menu.
144
+ */
145
+ aclProtected: valibot.optional(valibot.boolean()),
146
+ description: require_schemas.nonEmptyStringValueSchema("menu description"),
147
+ id: MenuIdSchema,
148
+ label: require_schemas.nonEmptyStringValueSchema("menu label"),
149
+ pageTitle: valibot.optional(require_schemas.nonEmptyStringValueSchema("menu page title")),
150
+ parentMenu: valibot.optional(valibot.picklist(_adobe_aio_commerce_lib_admin_ui_menu.COMMERCE_MENUS, "parentMenu must be a known Commerce Admin menu ID")),
151
+ sandboxPermissions: valibot.optional(SandboxPermissionsSchema)
155
152
  });
156
153
  /**
157
- * Schema for Admin UI SDK configuration.
154
+ * Schema for the `adminUi` config section.
155
+ * Supports grid column extensions, mass actions, order view buttons, and menu on `commerce/backend-ui/2`.
158
156
  * @experimental
159
157
  */
160
- const AdminUiSdkSchema = valibot.object({ registration: AdminUiSdkRegistrationSchema });
158
+ const AdminUiSchema = valibot.object({
159
+ customer: valibot.optional(AdminUiCustomerSchema),
160
+ menu: valibot.optional(MenuSchema),
161
+ order: valibot.optional(AdminUiOrderSchema),
162
+ product: valibot.optional(AdminUiProductSchema)
163
+ });
161
164
  /**
162
- * Check if config has Admin UI SDK registration configuration.
165
+ * Check if config has Admin UI configuration.
163
166
  * @experimental
164
167
  */
165
- function hasAdminUiSdk(config) {
166
- return config.adminUiSdk !== void 0 && config.adminUiSdk.registration !== void 0;
168
+ function hasAdminUi(config) {
169
+ return config.adminUi !== void 0;
167
170
  }
168
171
 
169
172
  //#endregion
@@ -237,14 +240,15 @@ function commerceEventFieldSchema() {
237
240
  }
238
241
  /** Schema for event provider configuration */
239
242
  const ProviderSchema = valibot.object({
240
- label: valibot.pipe(require_schemas.nonEmptyStringValueSchema("provider label"), ioEventsTextSchema("Provider label"), valibot.maxLength(MAX_LABEL_LENGTH, `The provider label must not be longer than ${MAX_LABEL_LENGTH} characters`)),
241
243
  description: valibot.pipe(require_schemas.nonEmptyStringValueSchema("provider description"), ioEventsTextSchema("Provider description"), valibot.maxLength(MAX_DESCRIPTION_LENGTH$1, `The provider description must not be longer than ${MAX_DESCRIPTION_LENGTH$1} characters`)),
242
- key: valibot.optional(valibot.pipe(require_schemas.alphaNumericOrHyphenSchema("provider key"), valibot.maxLength(MAX_KEY_LENGTH, `The provider key must not be longer than ${MAX_KEY_LENGTH} characters`)))
244
+ key: valibot.optional(valibot.pipe(require_schemas.alphaNumericOrHyphenSchema("provider key"), valibot.maxLength(MAX_KEY_LENGTH, `The provider key must not be longer than ${MAX_KEY_LENGTH} characters`))),
245
+ label: valibot.pipe(require_schemas.nonEmptyStringValueSchema("provider label"), ioEventsTextSchema("Provider label"), valibot.maxLength(MAX_LABEL_LENGTH, `The provider label must not be longer than ${MAX_LABEL_LENGTH} characters`))
243
246
  });
244
247
  /** Schema for base shared properties between event types. */
245
248
  const BaseEventSchema = valibot.object({
246
- label: valibot.pipe(require_schemas.nonEmptyStringValueSchema("event label"), ioEventsTextSchema("Event label"), valibot.maxLength(MAX_LABEL_LENGTH, `The event label must not be longer than ${MAX_LABEL_LENGTH} characters`)),
247
249
  description: valibot.pipe(require_schemas.nonEmptyStringValueSchema("event description"), ioEventsTextSchema("Event description"), valibot.maxLength(MAX_DESCRIPTION_LENGTH$1, `The event description must not be longer than ${MAX_DESCRIPTION_LENGTH$1} characters`)),
250
+ env: valibot.optional(_adobe_aio_commerce_lib_core_commerce.CommerceEnvArraySchema),
251
+ label: valibot.pipe(require_schemas.nonEmptyStringValueSchema("event label"), ioEventsTextSchema("Event label"), valibot.maxLength(MAX_LABEL_LENGTH, `The event label must not be longer than ${MAX_LABEL_LENGTH} characters`)),
248
252
  runtimeActions: valibot.array(valibot.pipe(require_schemas.nonEmptyStringValueSchema("runtime action"), valibot.regex(/^[a-z0-9-]+\/[a-z0-9-]+$/i, "Runtime action must be in the format \"<package>/<action>\" (e.g., \"my-package/my-action\")")), "Expected an array of runtime actions in the format <package>/<action>")
249
253
  });
250
254
  /**
@@ -269,28 +273,29 @@ const CommerceEventRuleSchema = valibot.object({
269
273
  /** Schema for Commerce event configuration */
270
274
  const CommerceEventSchema = valibot.object({
271
275
  ...BaseEventSchema.entries,
272
- name: commerceEventNameSchema(),
273
- fields: valibot.pipe(valibot.array(commerceEventFieldSchema(), "Expected an array of event field objects with a 'name' property"), valibot.minLength(1, "The Commerce event configuration must define at least one field")),
274
- rules: valibot.optional(valibot.array(CommerceEventRuleSchema, "Expected an array of event rules with field, operator, and value")),
275
276
  destination: valibot.optional(require_schemas.nonEmptyStringValueSchema("destination")),
277
+ fields: valibot.pipe(valibot.array(commerceEventFieldSchema(), "Expected an array of event field objects with a 'name' property"), valibot.minLength(1, "The Commerce event configuration must define at least one field")),
278
+ force: valibot.optional(require_schemas.booleanValueSchema("force")),
276
279
  hipaa_audit_required: valibot.optional(require_schemas.booleanValueSchema("hipaa_audit_required")),
280
+ name: commerceEventNameSchema(),
277
281
  priority: valibot.optional(require_schemas.booleanValueSchema("priority")),
278
- force: valibot.optional(require_schemas.booleanValueSchema("force"))
282
+ rules: valibot.optional(valibot.array(CommerceEventRuleSchema, "Expected an array of event rules with field, operator, and value"))
279
283
  });
280
284
  /** Schema for external event configuration */
281
285
  const ExternalEventSchema = valibot.object({
282
286
  ...BaseEventSchema.entries,
287
+ hipaa_audit_required: valibot.optional(require_schemas.booleanValueSchema("hipaa_audit_required")),
283
288
  name: externalEventNameSchema()
284
289
  });
285
290
  /** Schema for Commerce event source configuration */
286
291
  const CommerceEventSourceSchema = valibot.object({
287
- provider: ProviderSchema,
288
- events: valibot.array(CommerceEventSchema, "Expected an array of Commerce events")
292
+ events: valibot.array(CommerceEventSchema, "Expected an array of Commerce events"),
293
+ provider: ProviderSchema
289
294
  });
290
295
  /** Schema for external event source configuration */
291
296
  const ExternalEventSourceSchema = valibot.object({
292
- provider: ProviderSchema,
293
- events: valibot.array(ExternalEventSchema, "Expected an array of external events")
297
+ events: valibot.array(ExternalEventSchema, "Expected an array of external events"),
298
+ provider: ProviderSchema
294
299
  });
295
300
  /** Schema for eventing configuration with separate commerce and external arrays */
296
301
  const EventingSchema = valibot.object({
@@ -337,26 +342,26 @@ const SCRIPT_PATH_REGEX = /^(?:\.{0,2}\/)*[\w-/]*[\w-]+\.js$/;
337
342
  * Schema for custom installation step configuration
338
343
  */
339
344
  const CustomInstallationStepSchema = valibot.object({
340
- script: valibot.pipe(require_schemas.nonEmptyStringValueSchema("script path"), valibot.regex(SCRIPT_PATH_REGEX, "Script path must end with .js (e.g., \"./setup.js\", \"./scripts/setup.js\", or \"../../scripts/setup.js\")")),
345
+ description: valibot.pipe(require_schemas.nonEmptyStringValueSchema("step description"), valibot.maxLength(MAX_DESCRIPTION_LENGTH, `The step description must not be longer than ${MAX_DESCRIPTION_LENGTH} characters`)),
341
346
  name: valibot.pipe(require_schemas.nonEmptyStringValueSchema("step name"), valibot.maxLength(MAX_NAME_LENGTH, `The step name must not be longer than ${MAX_NAME_LENGTH} characters`)),
342
- description: valibot.pipe(require_schemas.nonEmptyStringValueSchema("step description"), valibot.maxLength(MAX_DESCRIPTION_LENGTH, `The step description must not be longer than ${MAX_DESCRIPTION_LENGTH} characters`))
347
+ script: valibot.pipe(require_schemas.nonEmptyStringValueSchema("script path"), valibot.regex(SCRIPT_PATH_REGEX, "Script path must end with .js (e.g., \"./setup.js\", \"./scripts/setup.js\", or \"../../scripts/setup.js\")"))
343
348
  });
344
349
  /**
345
350
  * Schema for installation messages configuration
346
351
  */
347
352
  const MessagesSchema = valibot.object({
348
- preInstallation: valibot.optional(valibot.pipe(require_schemas.nonEmptyStringValueSchema("preInstallation message"), valibot.maxLength(MAX_MESSAGE_LENGTH, `The preInstallation message must not be longer than ${MAX_MESSAGE_LENGTH} characters`))),
349
- postInstallation: valibot.optional(valibot.pipe(require_schemas.nonEmptyStringValueSchema("postInstallation message"), valibot.maxLength(MAX_MESSAGE_LENGTH, `The postInstallation message must not be longer than ${MAX_MESSAGE_LENGTH} characters`)))
353
+ postInstallation: valibot.optional(valibot.pipe(require_schemas.nonEmptyStringValueSchema("postInstallation message"), valibot.maxLength(MAX_MESSAGE_LENGTH, `The postInstallation message must not be longer than ${MAX_MESSAGE_LENGTH} characters`))),
354
+ preInstallation: valibot.optional(valibot.pipe(require_schemas.nonEmptyStringValueSchema("preInstallation message"), valibot.maxLength(MAX_MESSAGE_LENGTH, `The preInstallation message must not be longer than ${MAX_MESSAGE_LENGTH} characters`)))
350
355
  });
351
356
  /**
352
357
  * Schema for installation configuration
353
358
  */
354
359
  const InstallationSchema = valibot.object({
355
- messages: valibot.optional(MessagesSchema),
356
360
  customInstallationSteps: valibot.pipe(valibot.optional(valibot.array(CustomInstallationStepSchema, "Expected an array of custom installation steps")), valibot.check((input) => {
357
361
  const steps = input || [];
358
362
  return new Set(steps.map((step) => step.name)).size === steps.length;
359
- }, "Duplicate step names detected in custom installation steps. Each step must have a unique name."))
363
+ }, "Duplicate step names detected in custom installation steps. Each step must have a unique name.")),
364
+ messages: valibot.optional(MessagesSchema)
360
365
  });
361
366
  /**
362
367
  * Check if config has custom installation settings.
@@ -402,41 +407,44 @@ const CATEGORIES = [
402
407
  const CategorySchema = valibot.picklist(CATEGORIES, `Webhook category must be one of: ${CATEGORIES.join(", ")}`);
403
408
  /** Schema for the nested webhook payload without url — used when runtimeAction resolves the URL at runtime. */
404
409
  const WebhookDefinitionBaseSchema = valibot.object({
405
- webhook_method: require_schemas.nonEmptyStringValueSchema("webhook_method"),
406
- webhook_type: require_schemas.nonEmptyStringValueSchema("webhook_type"),
407
410
  batch_name: valibot.pipe(require_schemas.nonEmptyStringValueSchema("batch_name"), valibot.regex(WEBHOOK_IDENTIFIER_REGEX, "batch_name must contain only letters, numbers, and underscores")),
408
411
  batch_order: valibot.optional(require_schemas.positiveNumberValueSchema("batch_order")),
412
+ fallback_error_message: valibot.optional(require_schemas.stringValueSchema("fallback_error_message")),
413
+ fields: valibot.optional(valibot.array(WebhookFieldSchema, "Expected an array of webhook field objects")),
414
+ headers: valibot.optional(valibot.array(WebhookHeaderSchema, "Expected an array of webhook header objects")),
409
415
  hook_name: valibot.pipe(require_schemas.nonEmptyStringValueSchema("hook_name"), valibot.regex(WEBHOOK_IDENTIFIER_REGEX, "hook_name must contain only letters, numbers, and underscores")),
416
+ method: require_schemas.nonEmptyStringValueSchema("HTTP method"),
410
417
  priority: valibot.optional(require_schemas.positiveNumberValueSchema("priority")),
411
418
  required: valibot.optional(require_schemas.booleanValueSchema("required")),
419
+ rules: valibot.optional(valibot.array(WebhookRuleSchema, "Expected an array of webhook rule objects")),
412
420
  soft_timeout: valibot.optional(require_schemas.positiveNumberValueSchema("soft_timeout")),
413
421
  timeout: valibot.optional(require_schemas.positiveNumberValueSchema("timeout")),
414
- method: require_schemas.nonEmptyStringValueSchema("HTTP method"),
415
- fallback_error_message: valibot.optional(require_schemas.stringValueSchema("fallback_error_message")),
416
422
  ttl: valibot.optional(require_schemas.positiveNumberValueSchema("ttl")),
417
- fields: valibot.optional(valibot.array(WebhookFieldSchema, "Expected an array of webhook field objects")),
418
- rules: valibot.optional(valibot.array(WebhookRuleSchema, "Expected an array of webhook rule objects")),
419
- headers: valibot.optional(valibot.array(WebhookHeaderSchema, "Expected an array of webhook header objects"))
423
+ webhook_method: require_schemas.nonEmptyStringValueSchema("webhook_method"),
424
+ webhook_type: require_schemas.nonEmptyStringValueSchema("webhook_type")
420
425
  });
421
426
  /** Schema for the nested webhook payload with a required url. */
422
427
  const WebhookDefinitionWithUrlSchema = valibot.object({
423
428
  ...WebhookDefinitionBaseSchema.entries,
424
429
  url: valibot.pipe(require_schemas.stringValueSchema("webhook URL"), valibot.url("The 'url' field must be a valid absolute URL (e.g., 'https://example.com/webhook')"))
425
430
  });
431
+ /** Fields shared by every webhook entry, regardless of how its URL is resolved. */
432
+ const WebhookEntryBaseSchema = valibot.object({
433
+ category: valibot.optional(CategorySchema),
434
+ description: require_schemas.nonEmptyStringValueSchema("webhook description"),
435
+ env: valibot.optional(_adobe_aio_commerce_lib_core_commerce.CommerceEnvArraySchema),
436
+ label: require_schemas.nonEmptyStringValueSchema("webhook label")
437
+ });
426
438
  /** Schema for a webhook entry that resolves its URL from a runtime action. */
427
439
  const WebhookEntryWithRuntimeActionSchema = valibot.object({
428
- label: require_schemas.nonEmptyStringValueSchema("webhook label"),
429
- description: require_schemas.nonEmptyStringValueSchema("webhook description"),
430
- category: valibot.optional(CategorySchema),
431
- runtimeAction: require_schemas.nonEmptyStringValueSchema("runtimeAction"),
440
+ ...WebhookEntryBaseSchema.entries,
432
441
  requireAdobeAuth: valibot.optional(require_schemas.booleanValueSchema("requireAdobeAuth")),
442
+ runtimeAction: require_schemas.nonEmptyStringValueSchema("runtimeAction"),
433
443
  webhook: WebhookDefinitionBaseSchema
434
444
  });
435
445
  /** Schema for a webhook entry that provides an explicit URL. */
436
446
  const WebhookEntryWithUrlSchema = valibot.object({
437
- label: require_schemas.nonEmptyStringValueSchema("webhook label"),
438
- description: require_schemas.nonEmptyStringValueSchema("webhook description"),
439
- category: valibot.optional(CategorySchema),
447
+ ...WebhookEntryBaseSchema.entries,
440
448
  webhook: WebhookDefinitionWithUrlSchema
441
449
  });
442
450
  /** Schema for a single webhook entry — either runtimeAction (no url) or explicit url (no runtimeAction). */
@@ -452,10 +460,10 @@ function hasWebhooks(config) {
452
460
  }
453
461
 
454
462
  //#endregion
455
- Object.defineProperty(exports, 'AdminUiSdkSchema', {
463
+ Object.defineProperty(exports, 'AdminUiSchema', {
456
464
  enumerable: true,
457
465
  get: function () {
458
- return AdminUiSdkSchema;
466
+ return AdminUiSchema;
459
467
  }
460
468
  });
461
469
  Object.defineProperty(exports, 'EventingSchema', {
@@ -476,10 +484,10 @@ Object.defineProperty(exports, 'WebhooksSchema', {
476
484
  return WebhooksSchema;
477
485
  }
478
486
  });
479
- Object.defineProperty(exports, 'hasAdminUiSdk', {
487
+ Object.defineProperty(exports, 'hasAdminUi', {
480
488
  enumerable: true,
481
489
  get: function () {
482
- return hasAdminUiSdk;
490
+ return hasAdminUi;
483
491
  }
484
492
  });
485
493
  Object.defineProperty(exports, 'hasCommerceEvents', {
@@ -12,7 +12,7 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { n as CommerceAppConfig } from "../../app-DrYHK-z1.mjs";
15
+ import { n as CommerceAppConfig } from "../../app-D3P-Z6uY.mjs";
16
16
  import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
17
17
 
18
18
  //#region source/actions/app-config/router.d.ts