@adobe/aio-commerce-lib-app 2.2.0-beta-20261105172845 → 2.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 (60) hide show
  1. package/CHANGELOG.md +21 -4
  2. package/dist/cjs/actions/app-config/index.cjs +4 -4
  3. package/dist/cjs/actions/app-config/index.d.cts +2 -2
  4. package/dist/cjs/actions/association/index.cjs +1 -1
  5. package/dist/cjs/actions/config/index.cjs +1 -1
  6. package/dist/cjs/actions/config/index.d.cts +2 -2
  7. package/dist/cjs/actions/installation/index.cjs +60 -20
  8. package/dist/cjs/actions/installation/index.d.cts +4 -3
  9. package/dist/cjs/actions/scope-tree/index.cjs +1 -1
  10. package/dist/cjs/{app-CiZuhrsm.d.cts → app-B3bAEor-.d.cts} +176 -22
  11. package/dist/cjs/commands/index.cjs +25 -11
  12. package/dist/cjs/config/index.browser.d.cts +2 -1
  13. package/dist/cjs/config/index.node.cjs +3 -3
  14. package/dist/cjs/config/index.node.d.cts +60 -16
  15. package/dist/{es/define-9bwRE_UG.d.mts → cjs/define-eBMdGAq6.d.cts} +1 -1
  16. package/dist/cjs/{index-Bu2X-HUh.d.cts → index-BEeludy0.d.cts} +316 -316
  17. package/dist/cjs/{index-DWEigxhy.d.cts → index-vAue-u_y.d.cts} +1 -4
  18. package/dist/cjs/index.cjs +1 -1
  19. package/dist/cjs/index.d.cts +8 -8
  20. package/dist/cjs/{index.node-Boszndri.cjs → index.node-9bfp79rs.cjs} +1 -1
  21. package/dist/cjs/management/index.cjs +1 -1
  22. package/dist/cjs/management/index.d.cts +6 -1
  23. package/dist/cjs/{management-C_cVbr0s.cjs → management-5Et1mEUp.cjs} +41 -6
  24. package/dist/cjs/{openapi-c06taOv1.cjs → openapi-DghfuM8S.cjs} +135 -1
  25. package/dist/cjs/types-DslZGym8.d.cts +23 -0
  26. package/dist/cjs/{utils-B_Ypb2xF.cjs → utils-CoR_PBHz.cjs} +16 -3
  27. package/dist/cjs/{validate-CunJ4fUD.cjs → validate-BC3rnRLc.cjs} +1 -1
  28. package/dist/cjs/{version-CUu8Ks59.cjs → version-5MonNzl5.cjs} +1 -1
  29. package/dist/{es/webhooks-B7UjO8dd.d.mts → cjs/webhooks-DNLuuv9_.d.cts} +133 -16
  30. package/dist/cjs/{webhooks-C5ONLbQ4.cjs → webhooks-ZPh2gVb3.cjs} +11 -9
  31. package/dist/es/actions/app-config/index.d.mts +2 -2
  32. package/dist/es/actions/app-config/index.mjs +4 -4
  33. package/dist/es/actions/association/index.mjs +1 -1
  34. package/dist/es/actions/config/index.d.mts +1 -1
  35. package/dist/es/actions/config/index.mjs +1 -1
  36. package/dist/es/actions/installation/index.d.mts +4 -3
  37. package/dist/es/actions/installation/index.mjs +61 -21
  38. package/dist/es/actions/scope-tree/index.mjs +1 -1
  39. package/dist/es/{app-CiZuhrsm.d.mts → app-B3bAEor-.d.mts} +176 -22
  40. package/dist/es/commands/index.mjs +25 -11
  41. package/dist/es/config/index.browser.d.mts +2 -1
  42. package/dist/es/config/index.node.d.mts +59 -14
  43. package/dist/es/config/index.node.mjs +3 -3
  44. package/dist/{cjs/define-CZRjG5N_.d.cts → es/define-BdXyLAwb.d.mts} +1 -1
  45. package/dist/es/{index-Cho-eRFD.d.mts → index-DE2KVXfH.d.mts} +2 -2
  46. package/dist/es/{index-CgsSXApi.d.mts → index-DUJtT78x.d.mts} +2 -2
  47. package/dist/es/index.d.mts +8 -8
  48. package/dist/es/index.mjs +1 -1
  49. package/dist/es/{index.node-BVO6sC7z.mjs → index.node-CURztkP5.mjs} +1 -1
  50. package/dist/es/management/index.d.mts +6 -1
  51. package/dist/es/management/index.mjs +1 -1
  52. package/dist/es/{management-BYmbjhGb.mjs → management-BAQ64OyR.mjs} +41 -6
  53. package/dist/es/{openapi-C_TGWLou.mjs → openapi-BvPVTUMt.mjs} +135 -1
  54. package/dist/es/types-DslZGym8.d.mts +23 -0
  55. package/dist/es/{utils-SOtVo2VW.mjs → utils-DB8HaSj0.mjs} +11 -4
  56. package/dist/es/{validate-D-Oh-sxE.mjs → validate-xS9Dc-4m.mjs} +1 -1
  57. package/dist/es/{version-C-Pkqohl.mjs → version-BWgrh_QM.mjs} +1 -1
  58. package/dist/{cjs/webhooks-DX7km8wk.d.cts → es/webhooks-DgaLfP36.d.mts} +133 -16
  59. package/dist/es/{webhooks-CMb_05b6.mjs → webhooks-HBe_DEKA.mjs} +11 -9
  60. package/package.json +13 -13
@@ -12,18 +12,18 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
+ /**
16
+ * Public entrypoint for `@adobe/aio-commerce-lib-app`. Exposes helpers that
17
+ * runtime actions use to retrieve the Commerce instance the app is currently
18
+ * associated with.
19
+ *
20
+ * @packageDocumentation
21
+ */
22
+ import { t as AssociatedCommerceData } from "./types-DslZGym8.mjs";
15
23
  import { AdobeCommerceHttpClient, CommerceHttpClientParams } from "@adobe/aio-commerce-lib-api";
16
24
  import { CommerceSdkErrorBase, CommerceSdkErrorBaseOptions } from "@adobe/aio-commerce-lib-core/error";
17
25
  import { ImsAuthParams, ImsAuthProvider } from "@adobe/aio-commerce-lib-auth";
18
- import { CommerceEnv } from "@adobe/aio-commerce-lib-core/commerce";
19
26
  import { AdobeIoEventsApiClient } from "@adobe/aio-commerce-lib-events/io-events";
20
- /** The Commerce instance data an app is associated with. */
21
- type AssociatedCommerceData = {
22
- /** Commerce API base URL. */
23
- baseUrl: string;
24
- /** Deployment type of the Commerce instance. */
25
- env: CommerceEnv;
26
- };
27
27
  /**
28
28
  * Returns the Commerce instance this app is currently associated with.
29
29
  *
package/dist/es/index.mjs CHANGED
@@ -13,7 +13,7 @@
13
13
  */
14
14
 
15
15
  import { n as getAssociationData } from "./repository-BVBp61y9.mjs";
16
- import { f as getNamespacedEvent, l as getIoEventCode, n as EVENTS_STORAGE_KEY, r as EXTERNAL_PROVIDER_TYPE, t as COMMERCE_PROVIDER_TYPE } from "./utils-SOtVo2VW.mjs";
16
+ import { f as getNamespacedEvent, l as getIoEventCode, n as EVENTS_STORAGE_KEY, r as EXTERNAL_PROVIDER_TYPE, t as COMMERCE_PROVIDER_TYPE } from "./utils-DB8HaSj0.mjs";
17
17
  import { AdobeCommerceHttpClient } from "@adobe/aio-commerce-lib-api";
18
18
  import { getSystemConfigByKey } from "@adobe/aio-commerce-lib-config";
19
19
  import { CommerceSdkErrorBase } from "@adobe/aio-commerce-lib-core/error";
@@ -12,7 +12,7 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { t as validateCommerceAppConfig } from "./validate-D-Oh-sxE.mjs";
15
+ import { t as validateCommerceAppConfig } from "./validate-xS9Dc-4m.mjs";
16
16
  import { stringifyError } from "@adobe/aio-commerce-lib-core/error";
17
17
  import { existsSync } from "fs";
18
18
  import { access, mkdir, readFile } from "fs/promises";
@@ -12,5 +12,10 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { $ as defineLeafStep, A as createInitialState, B as BranchStepOptions, C as defineCustomInstallationStep, D as executePlannedWorkflow, E as createInitialPlanExecutionState, F as StepStartedEvent, G as LifecycleContext, H as InferStepOutput, I as StepSucceededEvent, J as StepMeta, K as Step, L as WorkflowHooks, M as executeWorkflow, N as StepEvent, O as ValidateStepTreeOptions, P as StepFailedEvent, Q as defineBranchStep, R as AnyStep, S as CustomInstallationStepHandler, T as planWorkflow, U as LeafStep, V as ExecutionContext, W as LeafStepOptions, X as ValidationContext, Y as StepMetaInfo, Z as ValidationExecutionContext, _ as createInitialUninstallationState, _t as isFailedState, a as InstallationError, at as ValidationResult, b as runValidation, c as InstallationStatus, ct as FailedWorkflowState, d as CreateInitialUninstallationStateOptions, dt as SucceededWorkflowState, et as isBranchStep, f as InstallationHooks, ft as WorkflowData, g as createInitialInstallationState, gt as isCompletedState, h as RunValidationOptions, ht as WorkflowStateMetadata, i as InstallationData, it as ValidationIssueSeverity, j as executeUninstallWorkflow, k as validateStepTree, l as SucceededInstallationState, lt as InProgressWorkflowState, m as RunUninstallationOptions, mt as WorkflowRunState, n as InProgressInstallationState, nt as StepValidationResult, o as InstallationRetryMetadata, ot as ValidationSummary, p as RunInstallationOptions, pt as WorkflowError, q as StepContextFactory, r as InstallationContext, rt as ValidationIssue, s as InstallationState, st as ExecutionStatus, t as FailedInstallationState, tt as isLeafStep, u as CreateInitialInstallationStateOptions, ut as StepStatus, v as runInstallation, vt as isInProgressState, w as createRetryState, x as CustomInstallationStepDefinition, y as runUninstallation, yt as isSucceededState, z as BranchStep } from "../index-Cho-eRFD.mjs";
15
+ /** biome-ignore-all lint/performance/noBarrelFile: This is the public API for the management entrypoint */
16
+ /**
17
+ * This module exports shared application management utilities for the AIO Commerce SDK.
18
+ * @packageDocumentation
19
+ */
20
+ import { $ as defineLeafStep, A as createInitialState, B as BranchStepOptions, C as defineCustomInstallationStep, D as executePlannedWorkflow, E as createInitialPlanExecutionState, F as StepStartedEvent, G as LifecycleContext, H as InferStepOutput, I as StepSucceededEvent, J as StepMeta, K as Step, L as WorkflowHooks, M as executeWorkflow, N as StepEvent, O as ValidateStepTreeOptions, P as StepFailedEvent, Q as defineBranchStep, R as AnyStep, S as CustomInstallationStepHandler, T as planWorkflow, U as LeafStep, V as ExecutionContext, W as LeafStepOptions, X as ValidationContext, Y as StepMetaInfo, Z as ValidationExecutionContext, _ as createInitialUninstallationState, _t as isFailedState, a as InstallationError, at as ValidationResult, b as runValidation, c as InstallationStatus, ct as FailedWorkflowState, d as CreateInitialUninstallationStateOptions, dt as SucceededWorkflowState, et as isBranchStep, f as InstallationHooks, ft as WorkflowData, g as createInitialInstallationState, gt as isCompletedState, h as RunValidationOptions, ht as WorkflowStateMetadata, i as InstallationData, it as ValidationIssueSeverity, j as executeUninstallWorkflow, k as validateStepTree, l as SucceededInstallationState, lt as InProgressWorkflowState, m as RunUninstallationOptions, mt as WorkflowRunState, n as InProgressInstallationState, nt as StepValidationResult, o as InstallationRetryMetadata, ot as ValidationSummary, p as RunInstallationOptions, pt as WorkflowError, q as StepContextFactory, r as InstallationContext, rt as ValidationIssue, s as InstallationState, st as ExecutionStatus, t as FailedInstallationState, tt as isLeafStep, u as CreateInitialInstallationStateOptions, ut as StepStatus, v as runInstallation, vt as isInProgressState, w as createRetryState, x as CustomInstallationStepDefinition, y as runUninstallation, yt as isSucceededState, z as BranchStep } from "../index-DE2KVXfH.mjs";
16
21
  export { type AnyStep, type BranchStep, type BranchStepOptions, type CreateInitialInstallationStateOptions, type CreateInitialUninstallationStateOptions, type CustomInstallationStepDefinition, type CustomInstallationStepHandler, type ExecutionContext, type ExecutionStatus, type FailedInstallationState, type FailedWorkflowState, type InProgressInstallationState, type InProgressWorkflowState, type InferStepOutput, type InstallationContext, type InstallationData, type InstallationError, type InstallationHooks, type InstallationRetryMetadata, type InstallationState, type InstallationStatus, type LeafStep, type LeafStepOptions, type LifecycleContext, type RunInstallationOptions, type RunUninstallationOptions, type RunValidationOptions, type Step, type StepContextFactory, type StepEvent, type StepFailedEvent, type StepMeta, type StepMetaInfo, type StepStartedEvent, type StepStatus, type StepSucceededEvent, type StepValidationResult, type SucceededInstallationState, type SucceededWorkflowState, type ValidateStepTreeOptions, type ValidationContext, type ValidationExecutionContext, type ValidationIssue, type ValidationIssueSeverity, type ValidationResult, type ValidationSummary, type WorkflowData, type WorkflowError, type WorkflowHooks, type WorkflowRunState, type WorkflowStateMetadata, createInitialInstallationState, type createInitialPlanExecutionState, type createInitialState, createInitialUninstallationState, type createRetryState, type defineBranchStep, defineCustomInstallationStep, type defineLeafStep, type executePlannedWorkflow, type executeUninstallWorkflow, type executeWorkflow, type isBranchStep, isCompletedState, isFailedState, isInProgressState, type isLeafStep, isSucceededState, type planWorkflow, runInstallation, runUninstallation, runValidation, type validateStepTree };
@@ -12,6 +12,6 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { a as runValidation, d as isInProgressState, f as isSucceededState, i as runUninstallation, l as isCompletedState, n as createInitialUninstallationState, r as runInstallation, s as defineCustomInstallationStep, t as createInitialInstallationState, u as isFailedState } from "../management-BYmbjhGb.mjs";
15
+ import { a as runValidation, d as isInProgressState, f as isSucceededState, i as runUninstallation, l as isCompletedState, n as createInitialUninstallationState, r as runInstallation, s as defineCustomInstallationStep, t as createInitialInstallationState, u as isFailedState } from "../management-BAQ64OyR.mjs";
16
16
 
17
17
  export { createInitialInstallationState, createInitialUninstallationState, defineCustomInstallationStep, isCompletedState, isFailedState, isInProgressState, isSucceededState, runInstallation, runUninstallation, runValidation };
@@ -12,11 +12,11 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { a as hasCustomInstallationSteps, c as hasEventing, d as ADMIN_UI_MASS_ACTION_ENTITIES, f as ADMIN_UI_VIEW_BUTTON_ENTITIES, l as hasExternalEvents, m as hasAdminUi, n as hasWebhooks, s as hasCommerceEvents, u as ADMIN_UI_GRID_COLUMN_ENTITIES } from "./webhooks-CMb_05b6.mjs";
15
+ import { a as hasCustomInstallationSteps, c as hasEventing, d as ADMIN_UI_MASS_ACTION_ENTITIES, f as ADMIN_UI_VIEW_BUTTON_ENTITIES, l as hasExternalEvents, m as hasAdminUi, n as hasWebhooks, s as hasCommerceEvents, u as ADMIN_UI_GRID_COLUMN_ENTITIES } from "./webhooks-HBe_DEKA.mjs";
16
16
  import { t as LIFECYCLE_HTTP_CLIENT_TIMEOUT_MS } from "./constants-C-4fesPr.mjs";
17
17
  import { t as parseOrThrow } from "./utils-G-EDWmew.mjs";
18
18
  import { i as getInstallCommerceEnv, t as appliesToEnv } from "./environment-DUhU0_9z.mjs";
19
- import { C as storeEventProviders, S as sanitizeEventingIdentifier, _ as getRegistrationName, a as generateInstanceId, b as makeWorkspaceConfig, c as getCommerceEventingExistingData, d as getLegacyRegistrationName, f as getNamespacedEvent, g as getRegistrationDescription, h as getProviderSnapshots, i as eventCodeOf, l as getIoEventCode, m as getProviderKeyFromInstanceId, n as EVENTS_STORAGE_KEY, o as generateInstanceIdDeprecated, p as getNamespacedNameOfCode, r as EXTERNAL_PROVIDER_TYPE, s as getCommerceEventingConfigurationUpdateParams, t as COMMERCE_PROVIDER_TYPE, u as getIoEventsExistingData, v as groupEventsByRuntimeActions, x as pruneStoredEventProviders, y as isIoProviderProvenOwnedByApp } from "./utils-SOtVo2VW.mjs";
19
+ import { C as sanitizeEventingIdentifier, S as pruneStoredEventProviders, _ as getRegistrationName, a as generateInstanceId, b as isIoProviderProvenOwnedByApp, c as getCommerceEventingExistingData, d as getLegacyRegistrationName, f as getNamespacedEvent, g as getRegistrationDescription, h as getProviderSnapshots, i as eventCodeOf, l as getIoEventCode, m as getProviderKeyFromInstanceId, n as EVENTS_STORAGE_KEY, o as generateInstanceIdDeprecated, p as getNamespacedNameOfCode, r as EXTERNAL_PROVIDER_TYPE, s as getCommerceEventingConfigurationUpdateParams, t as COMMERCE_PROVIDER_TYPE, u as getIoEventsExistingData, v as getStoredEventProviderKeys, w as storeEventProviders, x as makeWorkspaceConfig, y as groupEventsByRuntimeActions } from "./utils-DB8HaSj0.mjs";
20
20
  import { t as inspect } from "./logging-B1xb568A.mjs";
21
21
  import { resolveCommerceHttpClientParams, resolveIoEventsHttpClientParams } from "@adobe/aio-commerce-lib-api";
22
22
  import { getSystemConfigByKey, setSystemConfigByKey } from "@adobe/aio-commerce-lib-config";
@@ -2430,8 +2430,9 @@ async function applyEventingLeaf(plan, context, type) {
2430
2430
  await runAdds(phases, plan, target, context);
2431
2431
  await runUpdates(phases.registrationUpdates, target, context);
2432
2432
  await runRemoves(phases.renamedRegistrationRemoves.map((op) => op.before), context);
2433
- await storeEventProviders(getStoredProviders(target, context));
2434
- await pruneStoredEventProviders(getRemovedProviderKeys(plan.operations));
2433
+ const stored = getStoredProviders(target, context);
2434
+ await storeEventProviders(stored);
2435
+ await pruneStoredEventProviders(getRemovedProviderKeys(plan.operations).filter((key) => !Object.hasOwn(stored, key)));
2435
2436
  return { snapshotData: { providers: target.providers } };
2436
2437
  }
2437
2438
  /** Resolves the leaf's env-scoped target providers, Commerce events and live provider ids. */
@@ -2541,9 +2542,9 @@ function getStoredProviders(target, context) {
2541
2542
  }]];
2542
2543
  }));
2543
2544
  }
2544
- /** The keys of the providers the plan removes. */
2545
+ /** The keys of the providers the plan removes, and of those whose stored data it removes. */
2545
2546
  function getRemovedProviderKeys(operations) {
2546
- return operations.flatMap((op) => op.kind === "remove" && op.before.resourceType === "provider" ? [op.before.providerKey] : []);
2547
+ return operations.flatMap((op) => op.kind === "remove" && (op.before.resourceType === "provider" || op.before.resourceType === "storedEvents") ? [op.before.providerKey] : []);
2547
2548
  }
2548
2549
  /** Deletes the live resource a remove operation describes. */
2549
2550
  async function removeResource(value, context) {
@@ -2640,6 +2641,13 @@ function holdsConfiguredValue(field, current, configured) {
2640
2641
  }
2641
2642
 
2642
2643
  // source/management/domains/events/operations.ts
2644
+ /** The stored event data of a provider, which `publishEvent` reads. */
2645
+ function storedEventsValue(providerKey) {
2646
+ return {
2647
+ providerKey,
2648
+ resourceType: "storedEvents"
2649
+ };
2650
+ }
2643
2651
  /** The desired value of a provider. */
2644
2652
  function providerValue(target, ctx) {
2645
2653
  return {
@@ -2830,6 +2838,7 @@ function operationId(kind, value) {
2830
2838
  case "metadata": return `${kind}:metadata:${value.providerKey}:${value.eventCode}`;
2831
2839
  case "registration": return `${kind}:registration:${value.providerKey}:${value.runtimeAction}`;
2832
2840
  case "subscription": return `${kind}:subscription:${value.name}`;
2841
+ case "storedEvents": return `${kind}:stored-events:${value.providerKey}`;
2833
2842
  default: return kind;
2834
2843
  }
2835
2844
  }
@@ -2847,6 +2856,7 @@ function operationLabel(kind, value) {
2847
2856
  case "metadata": return `${verb} event metadata: ${value.eventCode}`;
2848
2857
  case "registration": return `${verb} registration: ${value.name}`;
2849
2858
  case "subscription": return value.changeMode === "replace" ? `Replace Commerce subscription: ${value.name}` : `${verb} Commerce subscription: ${value.name}`;
2859
+ case "storedEvents": return `${verb} stored event data of provider "${value.providerKey}"`;
2850
2860
  default: return verb;
2851
2861
  }
2852
2862
  }
@@ -3311,6 +3321,18 @@ async function planEventingLeaf(input, context, leaf) {
3311
3321
  message: `Event provider "${provider.ioProvider.instance_id}" has no workspace link, so it cannot be confirmed to belong to workspace "${ctx.workspaceId}".`
3312
3322
  })));
3313
3323
  const operations = planProviders(configs, matches, context.appId, ctx);
3324
+ let storedOperations;
3325
+ try {
3326
+ storedOperations = await planStoredEvents(configs, operations, ctx);
3327
+ } catch (error) {
3328
+ return blocked([{
3329
+ blocking: true,
3330
+ code: "EVENTS_STORED_READ_FAILED",
3331
+ domain: "eventing",
3332
+ message: `Could not read the stored event data to plan against: ${await unwrapHttpError(error)}`
3333
+ }]);
3334
+ }
3335
+ operations.push(...storedOperations);
3314
3336
  return {
3315
3337
  kind: "planned",
3316
3338
  plan: {
@@ -3409,6 +3431,19 @@ function getTargetSubscriptionNames(configs, ctx) {
3409
3431
  function getLiveProviderIds(matches) {
3410
3432
  return Object.fromEntries(matches.matched.flatMap(({ target, live }) => live ? [[target.key, live.ioProvider.id]] : []));
3411
3433
  }
3434
+ /**
3435
+ * Plans the removal of the stored event data of each baseline provider the target drops, when no
3436
+ * operation removes that provider yet the data is still stored. A live provider's removal already
3437
+ * prunes its data. One that is already gone has no operation, so its data would stay.
3438
+ */
3439
+ async function planStoredEvents(configs, operations, ctx) {
3440
+ const targetKeys = new Set(configs.target.map(({ key }) => key));
3441
+ const dropped = configs.declared.filter(({ key }) => !targetKeys.has(key));
3442
+ if (dropped.length === 0) return [];
3443
+ const stored = new Set(await getStoredEventProviderKeys());
3444
+ const removedKeys = new Set(operations.flatMap((op) => op.kind === "remove" && op.before.resourceType === "provider" ? [op.before.providerKey] : []));
3445
+ return dropped.filter(({ key }) => stored.has(key) && !removedKeys.has(key)).map(({ key, events }) => remove(storedEventsValue(key), "change", eventRefs(key, events, ctx)));
3446
+ }
3412
3447
  /** The eventing module state for the Commerce leaf, tied to its first target provider. */
3413
3448
  function getEventingModuleState(live, matches, ctx) {
3414
3449
  const [first] = matches.matched;
@@ -23,7 +23,7 @@ var info = {
23
23
  "identifier": "Apache-2.0",
24
24
  "name": "Apache-2.0"
25
25
  },
26
- "x-meta": { "packageVersion": "2.1.0" }
26
+ "x-meta": { "packageVersion": "2.2.0" }
27
27
  };
28
28
  var servers = [{ "url": "/" }];
29
29
  var paths = {
@@ -2308,6 +2308,13 @@ var components = {
2308
2308
  }
2309
2309
  }
2310
2310
  },
2311
+ "rma": {
2312
+ "type": "object",
2313
+ "properties": { "viewButtons": {
2314
+ "type": "array",
2315
+ "items": { "$ref": "#/components/schemas/AdminUiRmaViewButton" }
2316
+ } }
2317
+ },
2311
2318
  "shipment": {
2312
2319
  "type": "object",
2313
2320
  "properties": { "gridColumns": { "$ref": "#/components/schemas/AdminUiGridColumns" } }
@@ -2621,6 +2628,119 @@ var components = {
2621
2628
  "runtimeAction"
2622
2629
  ]
2623
2630
  },
2631
+ "AdminUiRmaViewButton": {
2632
+ "discriminator": {
2633
+ "propertyName": "type",
2634
+ "mapping": {
2635
+ "view": "#/components/schemas/AdminUiRmaViewNavigationButton",
2636
+ "worker": "#/components/schemas/AdminUiRmaViewWorkerButton"
2637
+ }
2638
+ },
2639
+ "oneOf": [{ "$ref": "#/components/schemas/AdminUiRmaViewNavigationButton" }, { "$ref": "#/components/schemas/AdminUiRmaViewWorkerButton" }]
2640
+ },
2641
+ "AdminUiRmaViewNavigationButton": {
2642
+ "type": "object",
2643
+ "properties": {
2644
+ "type": {
2645
+ "type": "string",
2646
+ "const": "view"
2647
+ },
2648
+ "id": {
2649
+ "type": "string",
2650
+ "minLength": 1
2651
+ },
2652
+ "label": {
2653
+ "type": "string",
2654
+ "minLength": 1
2655
+ },
2656
+ "description": {
2657
+ "type": "string",
2658
+ "minLength": 1
2659
+ },
2660
+ "title": {
2661
+ "type": "string",
2662
+ "minLength": 1
2663
+ },
2664
+ "path": {
2665
+ "type": "string",
2666
+ "minLength": 1
2667
+ },
2668
+ "aclProtected": { "type": "boolean" },
2669
+ "level": {
2670
+ "type": "number",
2671
+ "enum": [
2672
+ -1,
2673
+ 0,
2674
+ 1
2675
+ ]
2676
+ },
2677
+ "sortOrder": {
2678
+ "type": "number",
2679
+ "minimum": 0
2680
+ },
2681
+ "confirm": { "$ref": "#/components/schemas/AdminUiConfirm" },
2682
+ "sandboxPermissions": { "$ref": "#/components/schemas/AdminUiSandboxPermissions" },
2683
+ "notifications": { "$ref": "#/components/schemas/AdminUiNotifications" }
2684
+ },
2685
+ "additionalProperties": false,
2686
+ "required": [
2687
+ "type",
2688
+ "id",
2689
+ "label",
2690
+ "path"
2691
+ ]
2692
+ },
2693
+ "AdminUiRmaViewWorkerButton": {
2694
+ "type": "object",
2695
+ "properties": {
2696
+ "type": {
2697
+ "type": "string",
2698
+ "const": "worker"
2699
+ },
2700
+ "id": {
2701
+ "type": "string",
2702
+ "minLength": 1
2703
+ },
2704
+ "label": {
2705
+ "type": "string",
2706
+ "minLength": 1
2707
+ },
2708
+ "description": {
2709
+ "type": "string",
2710
+ "minLength": 1
2711
+ },
2712
+ "runtimeAction": {
2713
+ "type": "string",
2714
+ "minLength": 1
2715
+ },
2716
+ "aclProtected": { "type": "boolean" },
2717
+ "level": {
2718
+ "type": "number",
2719
+ "enum": [
2720
+ -1,
2721
+ 0,
2722
+ 1
2723
+ ]
2724
+ },
2725
+ "sortOrder": {
2726
+ "type": "number",
2727
+ "minimum": 0
2728
+ },
2729
+ "confirm": { "$ref": "#/components/schemas/AdminUiConfirm" },
2730
+ "timeout": {
2731
+ "type": "number",
2732
+ "minimum": 0
2733
+ },
2734
+ "notifications": { "$ref": "#/components/schemas/AdminUiNotifications" }
2735
+ },
2736
+ "additionalProperties": false,
2737
+ "required": [
2738
+ "type",
2739
+ "id",
2740
+ "label",
2741
+ "runtimeAction"
2742
+ ]
2743
+ },
2624
2744
  "AdminUiConfirm": {
2625
2745
  "type": "object",
2626
2746
  "properties": {
@@ -2928,6 +3048,20 @@ var components = {
2928
3048
  "appData": { "$ref": "#/components/schemas/AppData" },
2929
3049
  "ioEventsUrl": { "type": "string" },
2930
3050
  "ioEventsEnv": { "type": "string" },
3051
+ "commerceBaseUrl": {
3052
+ "description": "The base URL of the Commerce instance.",
3053
+ "type": ["string", "null"],
3054
+ "format": "uri"
3055
+ },
3056
+ "commerceEnv": {
3057
+ "description": "The deployment type of the Commerce instance.",
3058
+ "type": ["string", "null"],
3059
+ "enum": [
3060
+ "saas",
3061
+ "paas",
3062
+ null
3063
+ ]
3064
+ },
2931
3065
  "operation": {
2932
3066
  "description": "Set to `uninstall` to plan an uninstallation. Without it, `POST /installation/plan` plans the install or upgrade the installed state calls for.",
2933
3067
  "const": "uninstall"
@@ -0,0 +1,23 @@
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 { CommerceEnv } from "@adobe/aio-commerce-lib-core/commerce";
16
+ /** The Commerce instance data an app is associated with. */
17
+ type AssociatedCommerceData = {
18
+ /** Commerce API base URL. */
19
+ baseUrl: string;
20
+ /** Deployment type of the Commerce instance. */
21
+ env: CommerceEnv;
22
+ };
23
+ export { AssociatedCommerceData as t };
@@ -39,6 +39,11 @@ async function storeEventProviders(providers) {
39
39
  ...providers
40
40
  } });
41
41
  }
42
+ /** The keys of the providers that have stored events data. Empty when nothing is stored. */
43
+ async function getStoredEventProviderKeys() {
44
+ const existing = await getSystemConfigByKey(EVENTS_STORAGE_KEY);
45
+ return Object.keys(existing?.providers ?? {});
46
+ }
42
47
  /**
43
48
  * Prunes the given providers from the stored events data.
44
49
  * @param providerKeys - The keys of the providers to prune.
@@ -318,15 +323,17 @@ function makeWorkspaceConfig(context) {
318
323
  }
319
324
  } };
320
325
  }
321
- const PROVIDER_WORKSPACE_PATH = /^\/events\/[^/]+\/[^/]+\/(?<workspace>[^/]+)\/providers\//u;
326
+ const PROVIDER_WORKSPACE_PATH = /^(?:https?:\/\/[^/?#]+)?\/events\/[^/]+\/[^/]+\/(?<workspace>[^/]+)\/providers\//u;
322
327
  /**
323
328
  * The workspace id of an I/O provider, read from its `rel:update` link
324
- * (`/events/{org}/{project}/{workspace}/providers/{id}`). Null when the provider has no such link.
329
+ * (`/events/{org}/{project}/{workspace}/providers/{id}`), relative or absolute. Null when the
330
+ * provider has no such link or the link has another shape.
325
331
  *
326
332
  * @param links - The HAL links of the provider.
327
333
  */
328
334
  function getProviderWorkspaceId(links) {
329
- return (links?.["rel:update"]?.href)?.match(PROVIDER_WORKSPACE_PATH)?.[1] ?? null;
335
+ const href = links?.["rel:update"]?.href;
336
+ return typeof href === "string" ? href.match(PROVIDER_WORKSPACE_PATH)?.groups?.workspace ?? null : null;
330
337
  }
331
338
  /**
332
339
  * Retrieves the current existing data and returns it in a normalized way.
@@ -379,4 +386,4 @@ async function getCommerceEventingExistingData(context) {
379
386
  };
380
387
  }
381
388
 
382
- export { storeEventProviders as C, sanitizeEventingIdentifier as S, getRegistrationName as _, generateInstanceId as a, makeWorkspaceConfig as b, getCommerceEventingExistingData as c, getLegacyRegistrationName as d, getNamespacedEvent as f, getRegistrationDescription as g, getProviderSnapshots as h, eventCodeOf as i, getIoEventCode as l, getProviderKeyFromInstanceId as m, EVENTS_STORAGE_KEY as n, generateInstanceIdDeprecated as o, getNamespacedNameOfCode as p, EXTERNAL_PROVIDER_TYPE as r, getCommerceEventingConfigurationUpdateParams as s, COMMERCE_PROVIDER_TYPE as t, getIoEventsExistingData as u, groupEventsByRuntimeActions as v, pruneStoredEventProviders as x, isIoProviderProvenOwnedByApp as y };
389
+ export { sanitizeEventingIdentifier as C, pruneStoredEventProviders as S, getRegistrationName as _, generateInstanceId as a, isIoProviderProvenOwnedByApp as b, getCommerceEventingExistingData as c, getLegacyRegistrationName as d, getNamespacedEvent as f, getRegistrationDescription as g, getProviderSnapshots as h, eventCodeOf as i, getIoEventCode as l, getProviderKeyFromInstanceId as m, EVENTS_STORAGE_KEY as n, generateInstanceIdDeprecated as o, getNamespacedNameOfCode as p, EXTERNAL_PROVIDER_TYPE as r, getCommerceEventingConfigurationUpdateParams as s, COMMERCE_PROVIDER_TYPE as t, getIoEventsExistingData as u, getStoredEventProviderKeys as v, storeEventProviders as w, makeWorkspaceConfig as x, groupEventsByRuntimeActions as y };
@@ -12,7 +12,7 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { a as hasCustomInstallationSteps, i as hasCustomInstallation, l as hasExternalEvents, m as hasAdminUi, n as hasWebhooks, o as EventingSchema, p as AdminUiSchema, r as InstallationSchema, s as hasCommerceEvents, t as WebhooksSchema } from "./webhooks-CMb_05b6.mjs";
15
+ import { a as hasCustomInstallationSteps, i as hasCustomInstallation, l as hasExternalEvents, m as hasAdminUi, n as hasWebhooks, o as EventingSchema, p as AdminUiSchema, r as InstallationSchema, s as hasCommerceEvents, t as WebhooksSchema } from "./webhooks-HBe_DEKA.mjs";
16
16
  import { t as alphaNumericOrHyphenSchema } from "./schemas-DYMNbFdX.mjs";
17
17
  import { RecordedSchemaBusinessConfig, SchemaBusinessConfig } from "@adobe/aio-commerce-lib-config";
18
18
  import { CommerceSdkValidationError } from "@adobe/aio-commerce-lib-core/error";
@@ -457,7 +457,7 @@ const UNKNOWN_VERSION = "unknown";
457
457
  * in the `package.json` of the copy of lib-config that lib-app loads, which the app's bundler
458
458
  * resolves when it builds the action.
459
459
  */
460
- const SDK_LIB_VERSIONS = [["lib-app", "2.2.0-beta-20261105172845"], ["lib-config", libConfigPkg.version ?? UNKNOWN_VERSION]].map(([name, version]) => `${name}="${version}"`).join(", ");
460
+ const SDK_LIB_VERSIONS = [["lib-app", "2.2.0"], ["lib-config", libConfigPkg.version ?? UNKNOWN_VERSION]].map(([name, version]) => `${name}="${version}"`).join(", ");
461
461
  /** Headers every app-management router adds to its responses. */
462
462
  const SDK_LIB_VERSIONS_HEADERS = { [SDK_LIB_VERSIONS_HEADER]: SDK_LIB_VERSIONS };
463
463