@adobe/aio-commerce-lib-app 1.0.2 → 1.2.0

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 (54) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/cjs/actions/app-config.cjs +18 -4
  3. package/dist/cjs/actions/app-config.d.cts +17 -3
  4. package/dist/cjs/actions/config.cjs +17 -3
  5. package/dist/cjs/actions/config.d.cts +16 -2
  6. package/dist/cjs/actions/installation.cjs +70 -16
  7. package/dist/cjs/actions/installation.d.cts +18 -4
  8. package/dist/cjs/actions/scope-tree.cjs +17 -3
  9. package/dist/cjs/actions/scope-tree.d.cts +17 -3
  10. package/dist/cjs/{app-DWX5-Hsf.d.cts → app-DcQMhW2N.d.cts} +159 -2
  11. package/dist/cjs/commands/index.cjs +41 -27
  12. package/dist/cjs/commands/index.d.cts +14 -0
  13. package/dist/cjs/config/index.cjs +27 -12
  14. package/dist/cjs/config/index.d.cts +614 -6
  15. package/dist/cjs/{parser-BPpg_9QB.cjs → config-BppBKCFj.cjs} +17 -3
  16. package/dist/cjs/error-Dn7ool6k.cjs +38 -0
  17. package/dist/{es/runner-BD-lItnK.d.mts → cjs/index-DZxladgt.d.cts} +122 -9
  18. package/dist/cjs/logging-4s36JTiN.cjs +39 -0
  19. package/dist/cjs/management/index.cjs +23 -8
  20. package/dist/cjs/management/index.d.cts +16 -2
  21. package/dist/cjs/{runner-NHMvoMO2.cjs → management-iLQubQ7K.cjs} +462 -48
  22. package/dist/cjs/{router-DCw7oEQ9.cjs → router-KeQRduO3.cjs} +15 -1
  23. package/dist/cjs/{schemas-CZ6c8Id9.cjs → schemas-nkIxa8sL.cjs} +34 -0
  24. package/dist/cjs/{validate-Btzn9ilZ.cjs → validate-CeUCT_7k.cjs} +36 -15
  25. package/dist/cjs/{installation-CLbceU9F.cjs → webhooks-CLtDxwMa.cjs} +138 -1
  26. package/dist/es/actions/app-config.d.mts +17 -3
  27. package/dist/es/actions/app-config.mjs +17 -3
  28. package/dist/es/actions/config.d.mts +16 -2
  29. package/dist/es/actions/config.mjs +17 -3
  30. package/dist/es/actions/installation.d.mts +18 -4
  31. package/dist/es/actions/installation.mjs +64 -10
  32. package/dist/es/actions/scope-tree.d.mts +17 -3
  33. package/dist/es/actions/scope-tree.mjs +17 -3
  34. package/dist/es/{app-BAiyvNo2.d.mts → app-DJr-mN9d.d.mts} +159 -2
  35. package/dist/es/commands/index.d.mts +14 -0
  36. package/dist/es/commands/index.mjs +21 -7
  37. package/dist/es/config/index.d.mts +614 -6
  38. package/dist/es/config/index.mjs +18 -4
  39. package/dist/es/{parser-CQZTVG6i.mjs → config-BohwKkQS.mjs} +16 -2
  40. package/dist/es/error-DHlYzkbb.mjs +32 -0
  41. package/dist/{cjs/runner-DemKouFJ.d.cts → es/index-BmYXe7kp.d.mts} +122 -9
  42. package/dist/es/logging-XIUXDK5T.mjs +32 -0
  43. package/dist/es/management/index.d.mts +16 -2
  44. package/dist/es/management/index.mjs +16 -2
  45. package/dist/es/{runner-vwAhjD5r.mjs → management-DSexEPTW.mjs} +451 -43
  46. package/dist/es/{router-CJ4VWoCt.mjs → router-BxaxEEu3.mjs} +14 -0
  47. package/dist/es/{schemas-B8yIv0_b.mjs → schemas-CVXHgUhv.mjs} +29 -1
  48. package/dist/es/{validate-DKnju9-R.mjs → validate-CqJdGzyZ.mjs} +27 -6
  49. package/dist/es/{installation-BTL9X7iv.mjs → webhooks-CYo-pqbR.mjs} +115 -2
  50. package/package.json +12 -8
  51. package/dist/cjs/error-DJ2UAPH2.cjs +0 -24
  52. package/dist/cjs/logging-IDRQG0as.cjs +0 -25
  53. package/dist/es/error-CMV3IjBz.mjs +0 -18
  54. package/dist/es/logging-CzmXDzxI.mjs +0 -18
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @adobe/aio-commerce-lib-app
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#351](https://github.com/adobe/aio-commerce-sdk/pull/351) [`8af56e1`](https://github.com/adobe/aio-commerce-sdk/commit/8af56e142179b4d15249ce385bda23117003c133) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Add workspace ID to the event provider instance ID to ensure uniqueness within the IMS org.
8
+
9
+ - [#372](https://github.com/adobe/aio-commerce-sdk/pull/372) [`a04ee2b`](https://github.com/adobe/aio-commerce-sdk/commit/a04ee2b511aa7169e9fcc827f8eddab6192f00ba) Thanks [@asalloum5](https://github.com/asalloum5)! - Added Admin UI SDK installation step to correctly configure extensions in Adobe Commerce instance.
10
+
11
+ ### Patch Changes
12
+
13
+ - [#370](https://github.com/adobe/aio-commerce-sdk/pull/370) [`a627efc`](https://github.com/adobe/aio-commerce-sdk/commit/a627efc95d8176ff20a4506f9cadd828c9886d84) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Only configure the Commerce Eventing Module when it doesn't have a default provider or a workspace configuration.
14
+
15
+ - Updated dependencies [[`fe79660`](https://github.com/adobe/aio-commerce-sdk/commit/fe79660a9f010b5651f36e4e9d85bb11fc856296), [`fe79660`](https://github.com/adobe/aio-commerce-sdk/commit/fe79660a9f010b5651f36e4e9d85bb11fc856296), [`eeef589`](https://github.com/adobe/aio-commerce-sdk/commit/eeef589461f9bd684ed1fcf23ff97dfeba88723e), [`3e4b765`](https://github.com/adobe/aio-commerce-sdk/commit/3e4b7657cd34ff45317d29067846a4a113a3d37f)]:
16
+ - @adobe/aio-commerce-lib-config@1.1.0
17
+
18
+ ## 1.1.0
19
+
20
+ ### Minor Changes
21
+
22
+ - [#273](https://github.com/adobe/aio-commerce-sdk/pull/273) [`660cf05`](https://github.com/adobe/aio-commerce-sdk/commit/660cf058d2439de82b3e22376c3d494b2a83045f) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Added the functionality to define and install webhooks in the installation flow of the app.
23
+
24
+ - [#285](https://github.com/adobe/aio-commerce-sdk/pull/285) [`cda7712`](https://github.com/adobe/aio-commerce-sdk/commit/cda7712ac74b3bd9700aaa243a8b67d3a3d74d91) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Added a new endpoint /installation/validation to perform validation before the app is installed. Added webhook-specific validation for possible conflicts.
25
+
26
+ ### Patch Changes
27
+
28
+ - [#349](https://github.com/adobe/aio-commerce-sdk/pull/349) [`3abfe95`](https://github.com/adobe/aio-commerce-sdk/commit/3abfe9503f491aad3a2105d617fc8aa1c7b4725e) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Normalize event names and application IDs to lowercase to prevent case-sensitivity issues and ensure consistent event delivery.
29
+
30
+ - [#343](https://github.com/adobe/aio-commerce-sdk/pull/343) [`4883afa`](https://github.com/adobe/aio-commerce-sdk/commit/4883afaec90451cd7daf280f0def83ea45a3c87c) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Fixed IMS client secret parsing logic for the webhook subscription
31
+
32
+ - [#310](https://github.com/adobe/aio-commerce-sdk/pull/310) [`8f6ad9d`](https://github.com/adobe/aio-commerce-sdk/commit/8f6ad9ddcaae0f0a5a116bcbbefaae49f97697eb) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Improved validation error messages across schema files.
33
+
34
+ - Updated dependencies [[`660cf05`](https://github.com/adobe/aio-commerce-sdk/commit/660cf058d2439de82b3e22376c3d494b2a83045f), [`cb9c11d`](https://github.com/adobe/aio-commerce-sdk/commit/cb9c11dfd243d3034763374fe5416645015b46a9), [`4883afa`](https://github.com/adobe/aio-commerce-sdk/commit/4883afaec90451cd7daf280f0def83ea45a3c87c)]:
35
+ - @adobe/aio-commerce-lib-webhooks@0.1.0
36
+ - @adobe/aio-commerce-lib-auth@1.0.1
37
+ - @adobe/aio-commerce-lib-api@1.0.1
38
+ - @adobe/aio-commerce-lib-events@1.0.1
39
+ - @adobe/aio-commerce-lib-config@1.0.3
40
+
3
41
  ## 1.0.2
4
42
 
5
43
  ### Patch Changes
@@ -1,12 +1,26 @@
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
+
1
15
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_schemas = require('../schemas-CZ6c8Id9.cjs');
3
- const require_router = require('../router-DCw7oEQ9.cjs');
4
- const require_validate = require('../validate-Btzn9ilZ.cjs');
16
+ const require_schemas = require('../schemas-nkIxa8sL.cjs');
17
+ const require_router = require('../router-KeQRduO3.cjs');
18
+ const require_validate = require('../validate-CeUCT_7k.cjs');
5
19
  let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
6
20
 
7
21
  //#region source/actions/app-config.ts
8
22
  /** Router for the app config actions. */
9
- const router = new require_router.HttpActionRouter().use(require_router.logger({ name: () => "get-app-config" }));
23
+ const router = new require_router.HttpActionRouter().use(require_router.logger({ name: () => "app-config" }));
10
24
  /** GET / - Get app config */
11
25
  router.get("/", { handler: async (_req, { logger, rawParams }) => {
12
26
  logger.debug("Validating app config...");
@@ -1,5 +1,19 @@
1
- import { n as CommerceAppConfigOutputModel } from "../app-DWX5-Hsf.cjs";
2
- import * as _adobe_aio_commerce_lib_core_responses0 from "@adobe/aio-commerce-lib-core/responses";
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 { n as CommerceAppConfigOutputModel } from "../app-DcQMhW2N.cjs";
16
+ import * as _$_adobe_aio_commerce_lib_core_responses0 from "@adobe/aio-commerce-lib-core/responses";
3
17
  import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
4
18
 
5
19
  //#region source/actions/app-config.d.ts
@@ -10,6 +24,6 @@ type RuntimeActionFactoryArgs = {
10
24
  /** Factory to create the route handler for the `app-config` action. */
11
25
  declare const appConfigRuntimeAction: ({
12
26
  appConfig
13
- }: RuntimeActionFactoryArgs) => (params: RuntimeActionParams) => Promise<_adobe_aio_commerce_lib_core_responses0.ActionResponse>;
27
+ }: RuntimeActionFactoryArgs) => (params: RuntimeActionParams) => Promise<_$_adobe_aio_commerce_lib_core_responses0.ActionResponse>;
14
28
  //#endregion
15
29
  export { appConfigRuntimeAction };
@@ -1,7 +1,21 @@
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
+
1
15
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_schemas = require('../schemas-CZ6c8Id9.cjs');
3
- const require_router = require('../router-DCw7oEQ9.cjs');
4
- const require_validate = require('../validate-Btzn9ilZ.cjs');
16
+ const require_schemas = require('../schemas-nkIxa8sL.cjs');
17
+ const require_router = require('../router-KeQRduO3.cjs');
18
+ const require_validate = require('../validate-CeUCT_7k.cjs');
5
19
  let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
6
20
  let valibot = require("valibot");
7
21
  valibot = require_schemas.__toESM(valibot);
@@ -1,4 +1,18 @@
1
- import * as _adobe_aio_commerce_lib_core_responses0 from "@adobe/aio-commerce-lib-core/responses";
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 * as _$_adobe_aio_commerce_lib_core_responses0 from "@adobe/aio-commerce-lib-core/responses";
2
16
  import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
3
17
  import { BusinessConfigSchema } from "@adobe/aio-commerce-lib-config";
4
18
 
@@ -10,6 +24,6 @@ type ConfigActionFactoryArgs = {
10
24
  /** Factory to create the route handler for the `config` action. */
11
25
  declare const configRuntimeAction: ({
12
26
  configSchema
13
- }: ConfigActionFactoryArgs) => (params: RuntimeActionParams) => Promise<_adobe_aio_commerce_lib_core_responses0.ActionResponse>;
27
+ }: ConfigActionFactoryArgs) => (params: RuntimeActionParams) => Promise<_$_adobe_aio_commerce_lib_core_responses0.ActionResponse>;
14
28
  //#endregion
15
29
  export { configRuntimeAction };
@@ -1,7 +1,21 @@
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
+
1
15
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_schemas = require('../schemas-CZ6c8Id9.cjs');
3
- const require_router = require('../router-DCw7oEQ9.cjs');
4
- const require_runner = require('../runner-NHMvoMO2.cjs');
16
+ const require_schemas = require('../schemas-nkIxa8sL.cjs');
17
+ const require_router = require('../router-KeQRduO3.cjs');
18
+ const require_management = require('../management-iLQubQ7K.cjs');
5
19
  let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
6
20
  let valibot = require("valibot");
7
21
  valibot = require_schemas.__toESM(valibot);
@@ -246,13 +260,21 @@ const AppDataSchema = valibot.object({
246
260
  //#endregion
247
261
  //#region source/actions/installation.ts
248
262
  const DEFAULT_ACTION_NAME = "app-management/installation";
263
+ /** Request body schema shared by POST / and POST /validation. */
264
+ const InstallationRequestBodySchema = (0, valibot.object)({
265
+ appData: AppDataSchema,
266
+ commerceBaseUrl: (0, valibot.string)(),
267
+ commerceEnv: (0, valibot.string)(),
268
+ ioEventsUrl: (0, valibot.string)(),
269
+ ioEventsEnv: (0, valibot.string)()
270
+ });
249
271
  /** Creates an installation state store using lib-core combined storage. */
250
272
  function createInstallationStore() {
251
273
  return createCombinedStore({
252
274
  cache: { keyPrefix: "installation" },
253
275
  persistent: {
254
276
  dirPrefix: "installation",
255
- shouldPersist: require_runner.isCompletedState
277
+ shouldPersist: require_management.isCompletedState
256
278
  }
257
279
  });
258
280
  }
@@ -313,23 +335,17 @@ router.get("/", { handler: async (_req, { logger }) => {
313
335
  * 3. If not found or failed: create plan, invoke execution async, return 202 Accepted
314
336
  */
315
337
  router.post("/", {
316
- body: (0, valibot.object)({
317
- appData: AppDataSchema,
318
- commerceBaseUrl: (0, valibot.string)(),
319
- commerceEnv: (0, valibot.string)(),
320
- ioEventsUrl: (0, valibot.string)(),
321
- ioEventsEnv: (0, valibot.string)()
322
- }),
338
+ body: InstallationRequestBodySchema,
323
339
  handler: async (req, { logger, rawParams }) => {
324
340
  logger.debug("Starting installation...");
325
341
  const store = await createInstallationStore();
326
342
  const existingState = await store.get(getStorageKey());
327
343
  if (existingState) {
328
- if (require_runner.isInProgressState(existingState)) {
344
+ if (require_management.isInProgressState(existingState)) {
329
345
  logger.debug(`Installation already in progress: ${existingState.status}`);
330
346
  return (0, _adobe_aio_commerce_lib_core_responses.conflict)(`Installation is already ${existingState.status}. Wait for it to complete.`);
331
347
  }
332
- if (require_runner.isSucceededState(existingState)) {
348
+ if (require_management.isSucceededState(existingState)) {
333
349
  logger.debug("Installation already succeeded");
334
350
  return (0, _adobe_aio_commerce_lib_core_responses.conflict)("Installation has already completed successfully.");
335
351
  }
@@ -337,7 +353,7 @@ router.post("/", {
337
353
  }
338
354
  const appConfig = rawParams.appConfig;
339
355
  if (!appConfig) return (0, _adobe_aio_commerce_lib_core_responses.internalServerError)("Could not find or parse the app.commerce.manifest.json file, is it present and valid?");
340
- const initialState = require_runner.createInitialInstallationState({ config: appConfig });
356
+ const initialState = require_management.createInitialInstallationState({ config: appConfig });
341
357
  logger.debug(`Created initial state: ${initialState.id}`);
342
358
  await store.put(getStorageKey(), initialState);
343
359
  const activation = await (0, openwhisk.default)().actions.invoke({
@@ -385,7 +401,7 @@ router.post("/execution", { handler: async (_req, { logger, rawParams }) => {
385
401
  customScripts: params.customScriptsLoader?.(appConfig, logger) || {}
386
402
  };
387
403
  logger.debug(`Executing installation: ${initialState.id}`);
388
- const result = await require_runner.runInstallation({
404
+ const result = await require_management.runInstallation({
389
405
  installationContext,
390
406
  config: appConfig,
391
407
  initialState,
@@ -393,7 +409,7 @@ router.post("/execution", { handler: async (_req, { logger, rawParams }) => {
393
409
  });
394
410
  await store.put(getStorageKey(), result);
395
411
  logger.debug(`Installation completed: ${result.status}`);
396
- if (require_runner.isFailedState(result)) return (0, _adobe_aio_commerce_lib_core_responses.internalServerError)({ body: {
412
+ if (require_management.isFailedState(result)) return (0, _adobe_aio_commerce_lib_core_responses.internalServerError)({ body: {
397
413
  message: "Installation failed",
398
414
  error: result.error,
399
415
  state: result
@@ -401,6 +417,44 @@ router.post("/execution", { handler: async (_req, { logger, rawParams }) => {
401
417
  return (0, _adobe_aio_commerce_lib_core_responses.ok)({ body: result });
402
418
  } });
403
419
  /**
420
+ * POST /installation/validation - Pre-installation validation
421
+ *
422
+ * Synchronously validates the step tree before installation begins.
423
+ * Accepts the same request body as POST / (installation start) so the
424
+ * frontend can reuse the same parameters without any extra mapping.
425
+ *
426
+ * Flow:
427
+ * 1. Build a ValidationContext from the request parameters
428
+ * 2. Call runValidation() — traverses the step tree and collects issues
429
+ * 3. Return the structured ValidationResult immediately (no async invoke)
430
+ */
431
+ router.post("/validation", {
432
+ body: InstallationRequestBodySchema,
433
+ handler: async (req, { logger, rawParams }) => {
434
+ logger.debug("Running pre-installation validation...");
435
+ const appConfig = rawParams.appConfig;
436
+ if (!appConfig) return (0, _adobe_aio_commerce_lib_core_responses.internalServerError)("Could not find or parse the app.commerce.manifest.json file, is it present and valid?");
437
+ const { appData, ...params } = {
438
+ ...rawParams,
439
+ appData: req.body.appData,
440
+ AIO_EVENTS_API_BASE_URL: req.body.ioEventsUrl,
441
+ AIO_COMMERCE_AUTH_IMS_ENVIRONMENT: req.body.ioEventsEnv,
442
+ AIO_COMMERCE_API_BASE_URL: req.body.commerceBaseUrl,
443
+ AIO_COMMERCE_API_FLAVOR: req.body.commerceEnv
444
+ };
445
+ const result = await require_management.runValidation({
446
+ validationContext: {
447
+ appData,
448
+ params,
449
+ logger
450
+ },
451
+ config: appConfig
452
+ });
453
+ logger.debug(`Validation complete — valid: ${result.valid}, errors: ${result.summary.errors}, warnings: ${result.summary.warnings}`);
454
+ return (0, _adobe_aio_commerce_lib_core_responses.ok)({ body: result });
455
+ }
456
+ });
457
+ /**
404
458
  * DELETE / - Clear installation state
405
459
  *
406
460
  * This endpoint allows clearing the installation state.
@@ -1,6 +1,20 @@
1
- import { n as CommerceAppConfigOutputModel } from "../app-DWX5-Hsf.cjs";
2
- import { P as InstallationContext } from "../runner-DemKouFJ.cjs";
3
- import * as _adobe_aio_commerce_lib_core_responses0 from "@adobe/aio-commerce-lib-core/responses";
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 { n as CommerceAppConfigOutputModel } from "../app-DcQMhW2N.cjs";
16
+ import { V as InstallationContext } from "../index-DZxladgt.cjs";
17
+ import * as _$_adobe_aio_commerce_lib_core_responses0 from "@adobe/aio-commerce-lib-core/responses";
4
18
  import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
5
19
 
6
20
  //#region source/actions/installation.d.ts
@@ -14,6 +28,6 @@ type RuntimeActionFactoryArgs = {
14
28
  declare const installationRuntimeAction: ({
15
29
  appConfig,
16
30
  customScriptsLoader
17
- }: RuntimeActionFactoryArgs) => (params: RuntimeActionParams) => Promise<_adobe_aio_commerce_lib_core_responses0.ActionResponse>;
31
+ }: RuntimeActionFactoryArgs) => (params: RuntimeActionParams) => Promise<_$_adobe_aio_commerce_lib_core_responses0.ActionResponse>;
18
32
  //#endregion
19
33
  export { installationRuntimeAction };
@@ -1,7 +1,21 @@
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
+
1
15
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_schemas = require('../schemas-CZ6c8Id9.cjs');
3
- const require_router = require('../router-DCw7oEQ9.cjs');
4
- const require_logging = require('../logging-IDRQG0as.cjs');
16
+ const require_schemas = require('../schemas-nkIxa8sL.cjs');
17
+ const require_router = require('../router-KeQRduO3.cjs');
18
+ const require_logging = require('../logging-4s36JTiN.cjs');
5
19
  let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
6
20
  let valibot = require("valibot");
7
21
  valibot = require_schemas.__toESM(valibot);
@@ -1,8 +1,22 @@
1
- import * as _adobe_aio_commerce_lib_core_responses0 from "@adobe/aio-commerce-lib-core/responses";
2
- import * as _adobe_aio_commerce_lib_core_params0 from "@adobe/aio-commerce-lib-core/params";
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 * as _$_adobe_aio_commerce_lib_core_responses0 from "@adobe/aio-commerce-lib-core/responses";
16
+ import * as _$_adobe_aio_commerce_lib_core_params0 from "@adobe/aio-commerce-lib-core/params";
3
17
 
4
18
  //#region source/actions/scope-tree.d.ts
5
19
  /** The handler method for the `scope-tree` action. */
6
- declare const scopeTreeRuntimeAction: (args: _adobe_aio_commerce_lib_core_params0.RuntimeActionParams) => Promise<_adobe_aio_commerce_lib_core_responses0.ActionResponse>;
20
+ declare const scopeTreeRuntimeAction: (args: _$_adobe_aio_commerce_lib_core_params0.RuntimeActionParams) => Promise<_$_adobe_aio_commerce_lib_core_responses0.ActionResponse>;
7
21
  //#endregion
8
22
  export { scopeTreeRuntimeAction };
@@ -1,13 +1,27 @@
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
+
1
15
  import * as v from "valibot";
2
16
 
3
17
  //#region source/config/schema/app.d.ts
4
18
  /** The schema used to validate the commerce app config file. */
5
19
  declare const CommerceAppConfigSchema: v.LooseObjectSchema<{
6
20
  readonly metadata: v.ObjectSchema<{
7
- readonly id: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.RegexAction<string, `Only alphanumeric characters and hyphens are allowed in string value of "${string}"${string}`>]>;
21
+ readonly id: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.RegexAction<string, `Only alphanumeric characters and hyphens are allowed in string value of "${string}"${string}`>]>, v.MaxLengthAction<string, 100, "The application id must not be longer than 100 characters">]>;
8
22
  readonly displayName: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.MaxLengthAction<string, 50, "The application display name must not be longer than 50 characters">]>;
9
23
  readonly description: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.MaxLengthAction<string, 255, "The metadata description must not be longer than 255 characters">]>;
10
- readonly version: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.RegexAction<string, "The version must follow semantic versioning (semver) format">]>;
24
+ readonly version: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string for the ${string}`>, v.NonEmptyAction<string, `The ${string} must not be empty`>]>, v.RegexAction<string, "The version must follow semantic versioning (semver) format: Major.Minor.Patch (e.g., '1.0.0', '2.3.1')">]>;
11
25
  }, undefined>;
12
26
  readonly businessConfig: v.OptionalSchema<v.ObjectSchema<{
13
27
  readonly schema: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.VariantSchema<"type", [v.VariantSchema<"selectionMode", [v.ObjectSchema<{
@@ -157,6 +171,18 @@ declare const CommerceAppConfigSchema: v.LooseObjectSchema<{
157
171
  }, undefined>, "Expected an array of external events">;
158
172
  }, undefined>, "Expected an array of external event sources">, undefined>;
159
173
  }, undefined>, undefined>;
174
+ readonly adminUiSdk: v.OptionalSchema<v.ObjectSchema<{
175
+ readonly registration: v.ObjectSchema<{
176
+ readonly menuItems: v.ArraySchema<v.ObjectSchema<{
177
+ readonly id: v.StringSchema<undefined>;
178
+ readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
179
+ readonly parent: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
180
+ readonly sortOrder: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
181
+ readonly sandbox: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
182
+ readonly isSection: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
183
+ }, undefined>, undefined>;
184
+ }, undefined>;
185
+ }, undefined>, undefined>;
160
186
  readonly installation: v.OptionalSchema<v.ObjectSchema<{
161
187
  readonly messages: v.OptionalSchema<v.ObjectSchema<{
162
188
  readonly preInstallation: v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, v.MaxLengthAction<string, 1000, "The preInstallation message must not be longer than 1000 characters">]>, undefined>;
@@ -172,6 +198,137 @@ declare const CommerceAppConfigSchema: v.LooseObjectSchema<{
172
198
  description: string;
173
199
  }[] | undefined, "Duplicate step names detected in custom installation steps. Each step must have a unique name.">]>;
174
200
  }, undefined>, undefined>;
201
+ readonly webhooks: v.OptionalSchema<v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
202
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
203
+ readonly description: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
204
+ readonly category: v.OptionalSchema<v.PicklistSchema<readonly ["validation", "append", "modification"], `Webhook category must be one of: ${string}`>, undefined>;
205
+ readonly runtimeAction: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
206
+ readonly requireAdobeAuth: v.OptionalSchema<v.BooleanSchema<`Expected a boolean value for '${string}'`>, undefined>;
207
+ readonly webhook: v.ObjectSchema<{
208
+ readonly webhook_method: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
209
+ readonly webhook_type: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
210
+ readonly batch_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, v.RegexAction<string, "batch_name must contain only letters, numbers, and underscores">]>;
211
+ readonly batch_order: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
212
+ readonly hook_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, v.RegexAction<string, "hook_name must contain only letters, numbers, and underscores">]>;
213
+ readonly priority: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
214
+ readonly required: v.OptionalSchema<v.BooleanSchema<`Expected a boolean value for '${string}'`>, undefined>;
215
+ readonly soft_timeout: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
216
+ readonly timeout: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
217
+ readonly method: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
218
+ readonly fallback_error_message: v.OptionalSchema<v.StringSchema<`Expected a string value for '${string}'`>, undefined>;
219
+ readonly ttl: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
220
+ readonly fields: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
221
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
222
+ readonly source: v.OptionalSchema<v.StringSchema<`Expected a string value for '${string}'`>, undefined>;
223
+ }, undefined>, "Expected an array of webhook field objects">, undefined>;
224
+ readonly rules: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
225
+ readonly field: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
226
+ readonly operator: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
227
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
228
+ }, undefined>, "Expected an array of webhook rule objects">, undefined>;
229
+ readonly headers: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
230
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
231
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
232
+ }, undefined>, "Expected an array of webhook header objects">, undefined>;
233
+ }, undefined>;
234
+ }, undefined>, v.ObjectSchema<{
235
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
236
+ readonly description: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
237
+ readonly category: v.OptionalSchema<v.PicklistSchema<readonly ["validation", "append", "modification"], `Webhook category must be one of: ${string}`>, undefined>;
238
+ readonly webhook: v.ObjectSchema<{
239
+ readonly url: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.UrlAction<string, "The 'url' field must be a valid absolute URL (e.g., 'https://example.com/webhook')">]>;
240
+ readonly webhook_method: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
241
+ readonly webhook_type: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
242
+ readonly batch_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, v.RegexAction<string, "batch_name must contain only letters, numbers, and underscores">]>;
243
+ readonly batch_order: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
244
+ readonly hook_name: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, v.RegexAction<string, "hook_name must contain only letters, numbers, and underscores">]>;
245
+ readonly priority: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
246
+ readonly required: v.OptionalSchema<v.BooleanSchema<`Expected a boolean value for '${string}'`>, undefined>;
247
+ readonly soft_timeout: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
248
+ readonly timeout: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
249
+ readonly method: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
250
+ readonly fallback_error_message: v.OptionalSchema<v.StringSchema<`Expected a string value for '${string}'`>, undefined>;
251
+ readonly ttl: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
252
+ readonly fields: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
253
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
254
+ readonly source: v.OptionalSchema<v.StringSchema<`Expected a string value for '${string}'`>, undefined>;
255
+ }, undefined>, "Expected an array of webhook field objects">, undefined>;
256
+ readonly rules: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
257
+ readonly field: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
258
+ readonly operator: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
259
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
260
+ }, undefined>, "Expected an array of webhook rule objects">, undefined>;
261
+ readonly headers: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
262
+ readonly name: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
263
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
264
+ }, undefined>, "Expected an array of webhook header objects">, undefined>;
265
+ }, undefined>;
266
+ }, undefined>], "Each webhook entry must define either a 'runtimeAction' (to resolve the URL from a runtime action) or an explicit 'url' inside the 'webhook' object, but not both">, "Expected an array of webhook entries">, v.MinLengthAction<({
267
+ label: string;
268
+ description: string;
269
+ category?: "validation" | "append" | "modification" | undefined;
270
+ runtimeAction: string;
271
+ requireAdobeAuth?: boolean | undefined;
272
+ webhook: {
273
+ webhook_method: string;
274
+ webhook_type: string;
275
+ batch_name: string;
276
+ batch_order?: number | undefined;
277
+ hook_name: string;
278
+ priority?: number | undefined;
279
+ required?: boolean | undefined;
280
+ soft_timeout?: number | undefined;
281
+ timeout?: number | undefined;
282
+ method: string;
283
+ fallback_error_message?: string | undefined;
284
+ ttl?: number | undefined;
285
+ fields?: {
286
+ name: string;
287
+ source?: string | undefined;
288
+ }[] | undefined;
289
+ rules?: {
290
+ field: string;
291
+ operator: string;
292
+ value: string;
293
+ }[] | undefined;
294
+ headers?: {
295
+ name: string;
296
+ value: string;
297
+ }[] | undefined;
298
+ };
299
+ } | {
300
+ label: string;
301
+ description: string;
302
+ category?: "validation" | "append" | "modification" | undefined;
303
+ webhook: {
304
+ url: string;
305
+ webhook_method: string;
306
+ webhook_type: string;
307
+ batch_name: string;
308
+ batch_order?: number | undefined;
309
+ hook_name: string;
310
+ priority?: number | undefined;
311
+ required?: boolean | undefined;
312
+ soft_timeout?: number | undefined;
313
+ timeout?: number | undefined;
314
+ method: string;
315
+ fallback_error_message?: string | undefined;
316
+ ttl?: number | undefined;
317
+ fields?: {
318
+ name: string;
319
+ source?: string | undefined;
320
+ }[] | undefined;
321
+ rules?: {
322
+ field: string;
323
+ operator: string;
324
+ value: string;
325
+ }[] | undefined;
326
+ headers?: {
327
+ name: string;
328
+ value: string;
329
+ }[] | undefined;
330
+ };
331
+ })[], 1, "webhooks array must contain at least one webhook when present">]>, undefined>, undefined>;
175
332
  }, undefined>;
176
333
  /** The input shape of the commerce app config schema. */
177
334
  type CommerceAppConfig = v.InferInput<typeof CommerceAppConfigSchema>;