@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.
- package/CHANGELOG.md +21 -4
- package/dist/cjs/actions/app-config/index.cjs +4 -4
- package/dist/cjs/actions/app-config/index.d.cts +2 -2
- package/dist/cjs/actions/association/index.cjs +1 -1
- package/dist/cjs/actions/config/index.cjs +1 -1
- package/dist/cjs/actions/config/index.d.cts +2 -2
- package/dist/cjs/actions/installation/index.cjs +60 -20
- package/dist/cjs/actions/installation/index.d.cts +4 -3
- package/dist/cjs/actions/scope-tree/index.cjs +1 -1
- package/dist/cjs/{app-CiZuhrsm.d.cts → app-B3bAEor-.d.cts} +176 -22
- package/dist/cjs/commands/index.cjs +25 -11
- package/dist/cjs/config/index.browser.d.cts +2 -1
- package/dist/cjs/config/index.node.cjs +3 -3
- package/dist/cjs/config/index.node.d.cts +60 -16
- package/dist/{es/define-9bwRE_UG.d.mts → cjs/define-eBMdGAq6.d.cts} +1 -1
- package/dist/cjs/{index-Bu2X-HUh.d.cts → index-BEeludy0.d.cts} +316 -316
- package/dist/cjs/{index-DWEigxhy.d.cts → index-vAue-u_y.d.cts} +1 -4
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.d.cts +8 -8
- package/dist/cjs/{index.node-Boszndri.cjs → index.node-9bfp79rs.cjs} +1 -1
- package/dist/cjs/management/index.cjs +1 -1
- package/dist/cjs/management/index.d.cts +6 -1
- package/dist/cjs/{management-C_cVbr0s.cjs → management-5Et1mEUp.cjs} +41 -6
- package/dist/cjs/{openapi-c06taOv1.cjs → openapi-DghfuM8S.cjs} +135 -1
- package/dist/cjs/types-DslZGym8.d.cts +23 -0
- package/dist/cjs/{utils-B_Ypb2xF.cjs → utils-CoR_PBHz.cjs} +16 -3
- package/dist/cjs/{validate-CunJ4fUD.cjs → validate-BC3rnRLc.cjs} +1 -1
- package/dist/cjs/{version-CUu8Ks59.cjs → version-5MonNzl5.cjs} +1 -1
- package/dist/{es/webhooks-B7UjO8dd.d.mts → cjs/webhooks-DNLuuv9_.d.cts} +133 -16
- package/dist/cjs/{webhooks-C5ONLbQ4.cjs → webhooks-ZPh2gVb3.cjs} +11 -9
- package/dist/es/actions/app-config/index.d.mts +2 -2
- package/dist/es/actions/app-config/index.mjs +4 -4
- package/dist/es/actions/association/index.mjs +1 -1
- package/dist/es/actions/config/index.d.mts +1 -1
- package/dist/es/actions/config/index.mjs +1 -1
- package/dist/es/actions/installation/index.d.mts +4 -3
- package/dist/es/actions/installation/index.mjs +61 -21
- package/dist/es/actions/scope-tree/index.mjs +1 -1
- package/dist/es/{app-CiZuhrsm.d.mts → app-B3bAEor-.d.mts} +176 -22
- package/dist/es/commands/index.mjs +25 -11
- package/dist/es/config/index.browser.d.mts +2 -1
- package/dist/es/config/index.node.d.mts +59 -14
- package/dist/es/config/index.node.mjs +3 -3
- package/dist/{cjs/define-CZRjG5N_.d.cts → es/define-BdXyLAwb.d.mts} +1 -1
- package/dist/es/{index-Cho-eRFD.d.mts → index-DE2KVXfH.d.mts} +2 -2
- package/dist/es/{index-CgsSXApi.d.mts → index-DUJtT78x.d.mts} +2 -2
- package/dist/es/index.d.mts +8 -8
- package/dist/es/index.mjs +1 -1
- package/dist/es/{index.node-BVO6sC7z.mjs → index.node-CURztkP5.mjs} +1 -1
- package/dist/es/management/index.d.mts +6 -1
- package/dist/es/management/index.mjs +1 -1
- package/dist/es/{management-BYmbjhGb.mjs → management-BAQ64OyR.mjs} +41 -6
- package/dist/es/{openapi-C_TGWLou.mjs → openapi-BvPVTUMt.mjs} +135 -1
- package/dist/es/types-DslZGym8.d.mts +23 -0
- package/dist/es/{utils-SOtVo2VW.mjs → utils-DB8HaSj0.mjs} +11 -4
- package/dist/es/{validate-D-Oh-sxE.mjs → validate-xS9Dc-4m.mjs} +1 -1
- package/dist/es/{version-C-Pkqohl.mjs → version-BWgrh_QM.mjs} +1 -1
- package/dist/{cjs/webhooks-DX7km8wk.d.cts → es/webhooks-DgaLfP36.d.mts} +133 -16
- package/dist/es/{webhooks-CMb_05b6.mjs → webhooks-HBe_DEKA.mjs} +11 -9
- package/package.json +13 -13
|
@@ -12,7 +12,4 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
import AioLogger from "@adobe/aio-lib-core-logging";
|
|
17
|
-
import "@adobe/aio-commerce-lib-core/responses";
|
|
18
|
-
import "type-fest";
|
|
15
|
+
export {}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
16
|
const require_repository = require("./repository-C3nn0Mon.cjs");
|
|
17
|
-
const require_utils = require("./utils-
|
|
17
|
+
const require_utils = require("./utils-CoR_PBHz.cjs");
|
|
18
18
|
let _adobe_aio_commerce_lib_api = require("@adobe/aio-commerce-lib-api");
|
|
19
19
|
let _adobe_aio_commerce_lib_config = require("@adobe/aio-commerce-lib-config");
|
|
20
20
|
let _adobe_aio_commerce_lib_core_error = require("@adobe/aio-commerce-lib-core/error");
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -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.cjs";
|
|
15
23
|
import { AdobeCommerceHttpClient, CommerceHttpClientParams } from "@adobe/aio-commerce-lib-api";
|
|
16
24
|
import { ImsAuthParams, ImsAuthProvider } from "@adobe/aio-commerce-lib-auth";
|
|
17
|
-
import { CommerceEnv } from "@adobe/aio-commerce-lib-core/commerce";
|
|
18
25
|
import { CommerceSdkErrorBase, CommerceSdkErrorBaseOptions } from "@adobe/aio-commerce-lib-core/error";
|
|
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
|
*
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
const require_rolldown_runtime = require("./rolldown-runtime-CoOt0iuZ.cjs");
|
|
16
|
-
const require_validate = require("./validate-
|
|
16
|
+
const require_validate = require("./validate-BC3rnRLc.cjs");
|
|
17
17
|
let _adobe_aio_commerce_lib_core_error = require("@adobe/aio-commerce-lib-core/error");
|
|
18
18
|
let fs = require("fs");
|
|
19
19
|
let fs_promises = require("fs/promises");
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_management = require("../management-
|
|
16
|
+
const require_management = require("../management-5Et1mEUp.cjs");
|
|
17
17
|
|
|
18
18
|
exports.createInitialInstallationState = require_management.createInitialInstallationState;
|
|
19
19
|
exports.createInitialUninstallationState = require_management.createInitialUninstallationState;
|
|
@@ -12,5 +12,10 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
|
|
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 BranchStepOptions, A as createInitialState, B as InProgressWorkflowState, C as defineCustomInstallationStep, D as executePlannedWorkflow, E as createInitialPlanExecutionState, F as StepStartedEvent, G as WorkflowRunState, H as SucceededWorkflowState, I as StepSucceededEvent, J as isFailedState, K as WorkflowStateMetadata, L as WorkflowHooks, M as executeWorkflow, N as StepEvent, O as ValidateStepTreeOptions, P as StepFailedEvent, Q as BranchStep, R as ExecutionStatus, S as CustomInstallationStepHandler, T as planWorkflow, U as WorkflowData, V as StepStatus, W as WorkflowError, X as isSucceededState, Y as isInProgressState, Z as AnyStep, _ as createInitialUninstallationState, _t as ValidationIssueSeverity, a as InstallationError, at as Step, b as runValidation, c as InstallationStatus, ct as StepMetaInfo, d as CreateInitialUninstallationStateOptions, dt as defineBranchStep, et as ExecutionContext, f as InstallationHooks, ft as defineLeafStep, g as createInitialInstallationState, gt as ValidationIssue, h as RunValidationOptions, ht as StepValidationResult, i as InstallationData, it as LifecycleContext, j as executeUninstallWorkflow, k as validateStepTree, l as SucceededInstallationState, lt as ValidationContext, m as RunUninstallationOptions, mt as isLeafStep, n as InProgressInstallationState, nt as LeafStep, o as InstallationRetryMetadata, ot as StepContextFactory, p as RunInstallationOptions, pt as isBranchStep, q as isCompletedState, r as InstallationContext, rt as LeafStepOptions, s as InstallationState, st as StepMeta, t as FailedInstallationState, tt as InferStepOutput, u as CreateInitialInstallationStateOptions, ut as ValidationExecutionContext, v as runInstallation, vt as ValidationResult, w as createRetryState, x as CustomInstallationStepDefinition, y as runUninstallation, yt as ValidationSummary, z as FailedWorkflowState } from "../index-BEeludy0.cjs";
|
|
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 };
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
const require_rolldown_runtime = require("./rolldown-runtime-CoOt0iuZ.cjs");
|
|
16
|
-
const require_webhooks = require("./webhooks-
|
|
16
|
+
const require_webhooks = require("./webhooks-ZPh2gVb3.cjs");
|
|
17
17
|
const require_constants = require("./constants-CgeVvu6f.cjs");
|
|
18
18
|
const require_utils = require("./utils-DSS0XlXq.cjs");
|
|
19
19
|
const require_environment = require("./environment-CW6M76gS.cjs");
|
|
20
|
-
const require_utils$1 = require("./utils-
|
|
20
|
+
const require_utils$1 = require("./utils-CoR_PBHz.cjs");
|
|
21
21
|
const require_logging = require("./logging-Emi7P923.cjs");
|
|
22
22
|
let _adobe_aio_commerce_lib_api = require("@adobe/aio-commerce-lib-api");
|
|
23
23
|
let _adobe_aio_commerce_lib_config = require("@adobe/aio-commerce-lib-config");
|
|
@@ -2434,8 +2434,9 @@ async function applyEventingLeaf(plan, context, type) {
|
|
|
2434
2434
|
await runAdds(phases, plan, target, context);
|
|
2435
2435
|
await runUpdates(phases.registrationUpdates, target, context);
|
|
2436
2436
|
await runRemoves(phases.renamedRegistrationRemoves.map((op) => op.before), context);
|
|
2437
|
-
|
|
2438
|
-
await require_utils$1.
|
|
2437
|
+
const stored = getStoredProviders(target, context);
|
|
2438
|
+
await require_utils$1.storeEventProviders(stored);
|
|
2439
|
+
await require_utils$1.pruneStoredEventProviders(getRemovedProviderKeys(plan.operations).filter((key) => !Object.hasOwn(stored, key)));
|
|
2439
2440
|
return { snapshotData: { providers: target.providers } };
|
|
2440
2441
|
}
|
|
2441
2442
|
/** Resolves the leaf's env-scoped target providers, Commerce events and live provider ids. */
|
|
@@ -2545,9 +2546,9 @@ function getStoredProviders(target, context) {
|
|
|
2545
2546
|
}]];
|
|
2546
2547
|
}));
|
|
2547
2548
|
}
|
|
2548
|
-
/** The keys of the providers the plan removes. */
|
|
2549
|
+
/** The keys of the providers the plan removes, and of those whose stored data it removes. */
|
|
2549
2550
|
function getRemovedProviderKeys(operations) {
|
|
2550
|
-
return operations.flatMap((op) => op.kind === "remove" && op.before.resourceType === "provider" ? [op.before.providerKey] : []);
|
|
2551
|
+
return operations.flatMap((op) => op.kind === "remove" && (op.before.resourceType === "provider" || op.before.resourceType === "storedEvents") ? [op.before.providerKey] : []);
|
|
2551
2552
|
}
|
|
2552
2553
|
/** Deletes the live resource a remove operation describes. */
|
|
2553
2554
|
async function removeResource(value, context) {
|
|
@@ -2644,6 +2645,13 @@ function holdsConfiguredValue(field, current, configured) {
|
|
|
2644
2645
|
}
|
|
2645
2646
|
|
|
2646
2647
|
// source/management/domains/events/operations.ts
|
|
2648
|
+
/** The stored event data of a provider, which `publishEvent` reads. */
|
|
2649
|
+
function storedEventsValue(providerKey) {
|
|
2650
|
+
return {
|
|
2651
|
+
providerKey,
|
|
2652
|
+
resourceType: "storedEvents"
|
|
2653
|
+
};
|
|
2654
|
+
}
|
|
2647
2655
|
/** The desired value of a provider. */
|
|
2648
2656
|
function providerValue(target, ctx) {
|
|
2649
2657
|
return {
|
|
@@ -2834,6 +2842,7 @@ function operationId(kind, value) {
|
|
|
2834
2842
|
case "metadata": return `${kind}:metadata:${value.providerKey}:${value.eventCode}`;
|
|
2835
2843
|
case "registration": return `${kind}:registration:${value.providerKey}:${value.runtimeAction}`;
|
|
2836
2844
|
case "subscription": return `${kind}:subscription:${value.name}`;
|
|
2845
|
+
case "storedEvents": return `${kind}:stored-events:${value.providerKey}`;
|
|
2837
2846
|
default: return kind;
|
|
2838
2847
|
}
|
|
2839
2848
|
}
|
|
@@ -2851,6 +2860,7 @@ function operationLabel(kind, value) {
|
|
|
2851
2860
|
case "metadata": return `${verb} event metadata: ${value.eventCode}`;
|
|
2852
2861
|
case "registration": return `${verb} registration: ${value.name}`;
|
|
2853
2862
|
case "subscription": return value.changeMode === "replace" ? `Replace Commerce subscription: ${value.name}` : `${verb} Commerce subscription: ${value.name}`;
|
|
2863
|
+
case "storedEvents": return `${verb} stored event data of provider "${value.providerKey}"`;
|
|
2854
2864
|
default: return verb;
|
|
2855
2865
|
}
|
|
2856
2866
|
}
|
|
@@ -3315,6 +3325,18 @@ async function planEventingLeaf(input, context, leaf) {
|
|
|
3315
3325
|
message: `Event provider "${provider.ioProvider.instance_id}" has no workspace link, so it cannot be confirmed to belong to workspace "${ctx.workspaceId}".`
|
|
3316
3326
|
})));
|
|
3317
3327
|
const operations = planProviders(configs, matches, context.appId, ctx);
|
|
3328
|
+
let storedOperations;
|
|
3329
|
+
try {
|
|
3330
|
+
storedOperations = await planStoredEvents(configs, operations, ctx);
|
|
3331
|
+
} catch (error) {
|
|
3332
|
+
return blocked([{
|
|
3333
|
+
blocking: true,
|
|
3334
|
+
code: "EVENTS_STORED_READ_FAILED",
|
|
3335
|
+
domain: "eventing",
|
|
3336
|
+
message: `Could not read the stored event data to plan against: ${await (0, _adobe_aio_commerce_lib_api_utils.unwrapHttpError)(error)}`
|
|
3337
|
+
}]);
|
|
3338
|
+
}
|
|
3339
|
+
operations.push(...storedOperations);
|
|
3318
3340
|
return {
|
|
3319
3341
|
kind: "planned",
|
|
3320
3342
|
plan: {
|
|
@@ -3413,6 +3435,19 @@ function getTargetSubscriptionNames(configs, ctx) {
|
|
|
3413
3435
|
function getLiveProviderIds(matches) {
|
|
3414
3436
|
return Object.fromEntries(matches.matched.flatMap(({ target, live }) => live ? [[target.key, live.ioProvider.id]] : []));
|
|
3415
3437
|
}
|
|
3438
|
+
/**
|
|
3439
|
+
* Plans the removal of the stored event data of each baseline provider the target drops, when no
|
|
3440
|
+
* operation removes that provider yet the data is still stored. A live provider's removal already
|
|
3441
|
+
* prunes its data. One that is already gone has no operation, so its data would stay.
|
|
3442
|
+
*/
|
|
3443
|
+
async function planStoredEvents(configs, operations, ctx) {
|
|
3444
|
+
const targetKeys = new Set(configs.target.map(({ key }) => key));
|
|
3445
|
+
const dropped = configs.declared.filter(({ key }) => !targetKeys.has(key));
|
|
3446
|
+
if (dropped.length === 0) return [];
|
|
3447
|
+
const stored = new Set(await require_utils$1.getStoredEventProviderKeys());
|
|
3448
|
+
const removedKeys = new Set(operations.flatMap((op) => op.kind === "remove" && op.before.resourceType === "provider" ? [op.before.providerKey] : []));
|
|
3449
|
+
return dropped.filter(({ key }) => stored.has(key) && !removedKeys.has(key)).map(({ key, events }) => remove(storedEventsValue(key), "change", eventRefs(key, events, ctx)));
|
|
3450
|
+
}
|
|
3416
3451
|
/** The eventing module state for the Commerce leaf, tied to its first target provider. */
|
|
3417
3452
|
function getEventingModuleState(live, matches, ctx) {
|
|
3418
3453
|
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.
|
|
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 (0, _adobe_aio_commerce_lib_config.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 =
|
|
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
|
|
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
|
-
|
|
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.
|
|
@@ -481,6 +488,12 @@ Object.defineProperty(exports, "getRegistrationName", {
|
|
|
481
488
|
return getRegistrationName;
|
|
482
489
|
}
|
|
483
490
|
});
|
|
491
|
+
Object.defineProperty(exports, "getStoredEventProviderKeys", {
|
|
492
|
+
enumerable: true,
|
|
493
|
+
get: function () {
|
|
494
|
+
return getStoredEventProviderKeys;
|
|
495
|
+
}
|
|
496
|
+
});
|
|
484
497
|
Object.defineProperty(exports, "groupEventsByRuntimeActions", {
|
|
485
498
|
enumerable: true,
|
|
486
499
|
get: function () {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
const require_rolldown_runtime = require("./rolldown-runtime-CoOt0iuZ.cjs");
|
|
16
|
-
const require_webhooks = require("./webhooks-
|
|
16
|
+
const require_webhooks = require("./webhooks-ZPh2gVb3.cjs");
|
|
17
17
|
const require_schemas = require("./schemas-B6ITl1bG.cjs");
|
|
18
18
|
let _adobe_aio_commerce_lib_config = require("@adobe/aio-commerce-lib-config");
|
|
19
19
|
let _adobe_aio_commerce_lib_core_error = require("@adobe/aio-commerce-lib-core/error");
|
|
@@ -460,7 +460,7 @@ const UNKNOWN_VERSION = "unknown";
|
|
|
460
460
|
* in the `package.json` of the copy of lib-config that lib-app loads, which the app's bundler
|
|
461
461
|
* resolves when it builds the action.
|
|
462
462
|
*/
|
|
463
|
-
const SDK_LIB_VERSIONS = [["lib-app", "2.2.0
|
|
463
|
+
const SDK_LIB_VERSIONS = [["lib-app", "2.2.0"], ["lib-config", _adobe_aio_commerce_lib_config_package_json.default.version ?? UNKNOWN_VERSION]].map(([name, version]) => `${name}="${version}"`).join(", ");
|
|
464
464
|
/** Headers every app-management router adds to its responses. */
|
|
465
465
|
const SDK_LIB_VERSIONS_HEADERS = { [SDK_LIB_VERSIONS_HEADER]: SDK_LIB_VERSIONS };
|
|
466
466
|
|