@adobe/aio-commerce-lib-app 2.1.0-beta-20260930143021 → 2.1.0-beta-20261001090733
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 +10 -8
- package/dist/cjs/actions/app-config/index.cjs +1 -1
- package/dist/cjs/actions/installation/index.cjs +2 -2
- package/dist/cjs/actions/installation/index.d.cts +1 -1
- package/dist/cjs/commands/index.cjs +45 -27
- package/dist/cjs/{common-BnycrLCr.cjs → common-BJqizndF.cjs} +25 -2
- package/dist/cjs/{index-CF8b5k54.d.cts → index-DA6KSlYt.d.cts} +19 -7
- package/dist/cjs/management/index.cjs +1 -1
- package/dist/cjs/management/index.d.cts +1 -1
- package/dist/cjs/{management-CH-HSD9M.cjs → management-Dg4Mtag5.cjs} +6 -5
- package/dist/es/actions/app-config/index.mjs +1 -1
- package/dist/es/actions/installation/index.d.mts +1 -1
- package/dist/es/actions/installation/index.mjs +2 -2
- package/dist/es/commands/index.mjs +45 -27
- package/dist/es/{common-BxivnrmA.mjs → common-D2pT4aXg.mjs} +25 -2
- package/dist/es/{index-FwlXfpWU.d.mts → index-DsrWoPFr.d.mts} +19 -7
- package/dist/es/management/index.d.mts +1 -1
- package/dist/es/management/index.mjs +1 -1
- package/dist/es/{management-CNf5hM8-.mjs → management-CQP_5T_i.mjs} +6 -5
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @adobe/aio-commerce-lib-app
|
|
2
2
|
|
|
3
|
-
## 2.1.0-beta-
|
|
3
|
+
## 2.1.0-beta-20261001090733
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
- [#702](https://github.com/adobe/aio-commerce-sdk/pull/702) [`e6604ab`](https://github.com/adobe/aio-commerce-sdk/commit/e6604ab023e5f929e6e0279a36e06ec4c17f0906) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - The association action now returns the app's IMS client ID in its response.
|
|
10
10
|
|
|
11
|
+
- [#712](https://github.com/adobe/aio-commerce-sdk/pull/712) [`d78221e`](https://github.com/adobe/aio-commerce-sdk/commit/d78221e01894d2209b7864aca6a5fbfab93c7192) Thanks [@obarcelonap](https://github.com/obarcelonap)! - Generated `association` and `installation` actions now receive OAuth Server-to-Server credentials through the `include-ims-credentials` annotation instead of `AIO_COMMERCE_AUTH_IMS_*` inputs. Re-run `generate actions` to add the annotation and drop the legacy inputs from existing projects. The `AIO_COMMERCE_AUTH_IMS_*` fields of `LifecycleContext["params"]` are deprecated; custom installation scripts should use `resolveImsAuthParams(context.params)` from `@adobe/aio-commerce-lib-auth` instead.
|
|
12
|
+
|
|
11
13
|
- [#699](https://github.com/adobe/aio-commerce-sdk/pull/699) [`53f1f8b`](https://github.com/adobe/aio-commerce-sdk/commit/53f1f8be4428862015294f1edc2816972e501a9e) Thanks [@mariam21arauj](https://github.com/mariam21arauj)! - Add a `newsletter` entity to the v2 `adminUi` config so apps can declare Newsletter Subscriber grid columns and mass actions on `commerce/backend-ui/2`.
|
|
12
14
|
|
|
13
15
|
### Patch Changes
|
|
@@ -21,13 +23,13 @@
|
|
|
21
23
|
- [#688](https://github.com/adobe/aio-commerce-sdk/pull/688) [`b27c143`](https://github.com/adobe/aio-commerce-sdk/commit/b27c143b3d4c62de5a43a7184c55942b50e34618) Thanks [@gpl-php](https://github.com/gpl-php)! - Create Commerce event subscriptions sequentially to prevent concurrent configuration writes from dropping events during App Management installation.
|
|
22
24
|
|
|
23
25
|
- [#689](https://github.com/adobe/aio-commerce-sdk/pull/689) [`194db8d`](https://github.com/adobe/aio-commerce-sdk/commit/194db8d382edf49f7976ea9aeffad54acb8e3da1) Thanks [@obarcelonap](https://github.com/obarcelonap)! - Commerce Eventing setup now provides a default technical account when your app authenticates with OAuth Server-to-Server credentials that don't have one, such as those provided via the `include-ims-credentials` annotation, so Commerce can still consume the workspace configuration. The pre-build hook also warns that manually wired `AIO_COMMERCE_AUTH_IMS_*` credentials are deprecated.
|
|
24
|
-
- Updated dependencies [[`264539a`](https://github.com/adobe/aio-commerce-sdk/commit/264539a13371b11b637eb01fd1c0aa185f4349cc), [`cda4f20`](https://github.com/adobe/aio-commerce-sdk/commit/cda4f206c9cd1877046f5a2196fa60478d35dfb9), [`194db8d`](https://github.com/adobe/aio-commerce-sdk/commit/194db8d382edf49f7976ea9aeffad54acb8e3da1), [`53f1f8b`](https://github.com/adobe/aio-commerce-sdk/commit/53f1f8be4428862015294f1edc2816972e501a9e)]:
|
|
25
|
-
- @adobe/aio-commerce-lib-admin-ui@1.2.0-beta-
|
|
26
|
-
- @adobe/aio-commerce-lib-config@1.8.1-beta-
|
|
27
|
-
- @adobe/aio-commerce-lib-
|
|
28
|
-
- @adobe/aio-commerce-lib-
|
|
29
|
-
- @adobe/aio-commerce-lib-events@1.4.1-beta-
|
|
30
|
-
- @adobe/aio-commerce-lib-webhooks@1.2.3-beta-
|
|
26
|
+
- Updated dependencies [[`264539a`](https://github.com/adobe/aio-commerce-sdk/commit/264539a13371b11b637eb01fd1c0aa185f4349cc), [`cda4f20`](https://github.com/adobe/aio-commerce-sdk/commit/cda4f206c9cd1877046f5a2196fa60478d35dfb9), [`d78221e`](https://github.com/adobe/aio-commerce-sdk/commit/d78221e01894d2209b7864aca6a5fbfab93c7192), [`194db8d`](https://github.com/adobe/aio-commerce-sdk/commit/194db8d382edf49f7976ea9aeffad54acb8e3da1), [`53f1f8b`](https://github.com/adobe/aio-commerce-sdk/commit/53f1f8be4428862015294f1edc2816972e501a9e)]:
|
|
27
|
+
- @adobe/aio-commerce-lib-admin-ui@1.2.0-beta-20261001090733
|
|
28
|
+
- @adobe/aio-commerce-lib-config@1.8.1-beta-20261001090733
|
|
29
|
+
- @adobe/aio-commerce-lib-api@1.4.1-beta-20261001090733
|
|
30
|
+
- @adobe/aio-commerce-lib-auth@1.2.0-beta-20261001090733
|
|
31
|
+
- @adobe/aio-commerce-lib-events@1.4.1-beta-20261001090733
|
|
32
|
+
- @adobe/aio-commerce-lib-webhooks@1.2.3-beta-20261001090733
|
|
31
33
|
|
|
32
34
|
## 2.0.0
|
|
33
35
|
|
|
@@ -80,7 +80,7 @@ function pruneUnusedTags(spec) {
|
|
|
80
80
|
* @param domains - The active config domains.
|
|
81
81
|
*/
|
|
82
82
|
function getOpenApiCacheKey(domains) {
|
|
83
|
-
const input = `2.1.0-beta-
|
|
83
|
+
const input = `2.1.0-beta-20261001090733:${[...domains].sort().join(",")}:3.1.0`;
|
|
84
84
|
return (0, crypto.createHash)("sha256").update(input).digest("hex").slice(0, 8);
|
|
85
85
|
}
|
|
86
86
|
/** Returns the server URL to be set in the OpenAPI spec, based on the current namespace. */
|
|
@@ -17,8 +17,8 @@ const require_rolldown_runtime = require('../../rolldown-runtime-CDQd2xEI.cjs');
|
|
|
17
17
|
const require_repository = require('../../repository-CbceYZqc.cjs');
|
|
18
18
|
const require_schemas = require('../../schemas-3e49M8zz.cjs');
|
|
19
19
|
const require_validate = require('../../validate-DvewC1jV.cjs');
|
|
20
|
-
const require_common = require('../../common-
|
|
21
|
-
const require_management = require('../../management-
|
|
20
|
+
const require_common = require('../../common-BJqizndF.cjs');
|
|
21
|
+
const require_management = require('../../management-Dg4Mtag5.cjs');
|
|
22
22
|
const require_router = require('../../router-CxDTb6r1.cjs');
|
|
23
23
|
let valibot = require("valibot");
|
|
24
24
|
valibot = require_rolldown_runtime.__toESM(valibot, 1);
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
import "../../index-DWEigxhy.cjs";
|
|
16
16
|
import { n as CommerceAppConfig, r as CommerceAppConfigOutputModel } from "../../app-f9arYxnr.cjs";
|
|
17
|
-
import { J as LifecycleContext } from "../../index-
|
|
17
|
+
import { J as LifecycleContext } from "../../index-DA6KSlYt.cjs";
|
|
18
18
|
import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
|
|
19
19
|
import "@adobe/aio-commerce-lib-core/responses";
|
|
20
20
|
//#region source/actions/installation/common.d.ts
|
|
@@ -18,7 +18,7 @@ const require_error = require('../error-D-N0PKSl.cjs');
|
|
|
18
18
|
const require_index_node = require('../index.node-Blr0OCOE.cjs');
|
|
19
19
|
const require_webhooks = require('../webhooks-zgRbVnDA.cjs');
|
|
20
20
|
const require_validate = require('../validate-DvewC1jV.cjs');
|
|
21
|
-
const require_common = require('../common-
|
|
21
|
+
const require_common = require('../common-BJqizndF.cjs');
|
|
22
22
|
const require_logging = require('../logging-Br3xfBNe.cjs');
|
|
23
23
|
let _adobe_aio_commerce_lib_config = require("@adobe/aio-commerce-lib-config");
|
|
24
24
|
let _adobe_aio_commerce_lib_core_error = require("@adobe/aio-commerce-lib-core/error");
|
|
@@ -107,17 +107,6 @@ const __filename$1 = (0, url.fileURLToPath)(require("url").pathToFileURL(__filen
|
|
|
107
107
|
const __dirname$1 = (0, path.dirname)(__filename$1);
|
|
108
108
|
/** The path to the action templates directory, sibling to this file. */
|
|
109
109
|
const TEMPLATES_DIR = (0, path.join)(__dirname$1, "templates");
|
|
110
|
-
/** The list of Commerce variables that are required for the runtime actions. */
|
|
111
|
-
const COMMERCE_VARIABLES = [
|
|
112
|
-
"AIO_COMMERCE_AUTH_IMS_CLIENT_ID",
|
|
113
|
-
"AIO_COMMERCE_AUTH_IMS_CLIENT_SECRETS",
|
|
114
|
-
"AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_ID",
|
|
115
|
-
"AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_EMAIL",
|
|
116
|
-
"AIO_COMMERCE_AUTH_IMS_ORG_ID",
|
|
117
|
-
"AIO_COMMERCE_AUTH_IMS_SCOPES"
|
|
118
|
-
];
|
|
119
|
-
/** The inputs for the generated runtime actions. */
|
|
120
|
-
const COMMERCE_ACTION_INPUTS = Object.fromEntries(COMMERCE_VARIABLES.map((variable) => [variable, `$${variable}`]));
|
|
121
110
|
const CUSTOM_IMPORTS_PLACEHOLDER = "// {{CUSTOM_SCRIPTS_IMPORTS}}";
|
|
122
111
|
const CUSTOM_SCRIPTS_MAP_PLACEHOLDER = "// {{CUSTOM_SCRIPTS_MAP}}";
|
|
123
112
|
const CUSTOM_SCRIPTS_LOADER_PLACEHOLDER = "// {{CUSTOM_SCRIPTS_LOADER}}";
|
|
@@ -378,7 +367,7 @@ const LEADING_DOT_SLASH_PATTERN$1 = /^\.\//u;
|
|
|
378
367
|
const WEB_SOURCE_DEPENDENCIES = [
|
|
379
368
|
{
|
|
380
369
|
name: "@adobe/aio-commerce-lib-admin-ui",
|
|
381
|
-
version: "^1.2.0-beta-
|
|
370
|
+
version: "^1.2.0-beta-20261001090733"
|
|
382
371
|
},
|
|
383
372
|
{
|
|
384
373
|
name: "react",
|
|
@@ -625,7 +614,8 @@ function createActionDefinition(actionName, config = {}, options = {}) {
|
|
|
625
614
|
...options,
|
|
626
615
|
annotations: {
|
|
627
616
|
final: true,
|
|
628
|
-
"require-adobe-auth": true
|
|
617
|
+
"require-adobe-auth": true,
|
|
618
|
+
...config.requiresImsCredentials && { "include-ims-credentials": true }
|
|
629
619
|
},
|
|
630
620
|
function: `${GENERATED_ACTIONS_PATH}/${actionName}.js`,
|
|
631
621
|
runtime: "nodejs:24",
|
|
@@ -638,12 +628,6 @@ function createActionDefinition(actionName, config = {}, options = {}) {
|
|
|
638
628
|
return def;
|
|
639
629
|
}
|
|
640
630
|
/**
|
|
641
|
-
* Inputs shared by the runtime actions that talk to the Commerce App Management
|
|
642
|
-
* Service. `LOG_LEVEL` is declared once at the package level, so it's omitted
|
|
643
|
-
* here to avoid duplicating it on every action.
|
|
644
|
-
*/
|
|
645
|
-
const RUNTIME_ACTION_INPUTS = COMMERCE_ACTION_INPUTS;
|
|
646
|
-
/**
|
|
647
631
|
* Gets the runtime actions to be generated from the ext.config.yaml configuration.
|
|
648
632
|
* @param extConfig - The ext.config.yaml configuration.
|
|
649
633
|
* @param dir - Directory containing the runtime action templates.
|
|
@@ -674,7 +658,7 @@ function buildAppManagementExtConfig(appConfig) {
|
|
|
674
658
|
runtimeManifest: { packages: { [PACKAGE_NAME]: {
|
|
675
659
|
actions: {
|
|
676
660
|
"app-config": createActionDefinition("app-config"),
|
|
677
|
-
association: createActionDefinition("association", {
|
|
661
|
+
association: createActionDefinition("association", { requiresImsCredentials: true })
|
|
678
662
|
},
|
|
679
663
|
inputs: { LOG_LEVEL: "$LOG_LEVEL" },
|
|
680
664
|
license: "Apache-2.0"
|
|
@@ -685,10 +669,10 @@ function buildAppManagementExtConfig(appConfig) {
|
|
|
685
669
|
impl: `${PACKAGE_NAME}/installation`,
|
|
686
670
|
type: "action"
|
|
687
671
|
});
|
|
688
|
-
extConfig.runtimeManifest.packages[PACKAGE_NAME].actions.installation = createActionDefinition("installation", {
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
});
|
|
672
|
+
extConfig.runtimeManifest.packages[PACKAGE_NAME].actions.installation = createActionDefinition("installation", {
|
|
673
|
+
requiresEncryptionKey: hasPasswordFieldsInSchema,
|
|
674
|
+
requiresImsCredentials: true
|
|
675
|
+
}, { limits: { timeout: 6e5 } });
|
|
692
676
|
return extConfig;
|
|
693
677
|
}
|
|
694
678
|
/** Builds the ext.config.yaml configuration for the business configuration extension. */
|
|
@@ -1144,6 +1128,39 @@ async function readExtConfig(extensionPointId, projectRoot) {
|
|
|
1144
1128
|
].join("\n"), { cause: error });
|
|
1145
1129
|
}
|
|
1146
1130
|
}
|
|
1131
|
+
/** Inputs superseded by the `include-ims-credentials` action annotation. */
|
|
1132
|
+
const LEGACY_IMS_CREDENTIAL_INPUTS = [
|
|
1133
|
+
"AIO_COMMERCE_AUTH_IMS_CLIENT_ID",
|
|
1134
|
+
"AIO_COMMERCE_AUTH_IMS_CLIENT_SECRETS",
|
|
1135
|
+
"AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_ID",
|
|
1136
|
+
"AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_EMAIL",
|
|
1137
|
+
"AIO_COMMERCE_AUTH_IMS_ORG_ID",
|
|
1138
|
+
"AIO_COMMERCE_AUTH_IMS_SCOPES"
|
|
1139
|
+
];
|
|
1140
|
+
/**
|
|
1141
|
+
* Removes the legacy `AIO_COMMERCE_AUTH_IMS_*` inputs from the existing
|
|
1142
|
+
* `ext.config.yaml` document for every action annotated with `include-ims-credentials`.
|
|
1143
|
+
* @param extConfigDoc - The existing `ext.config.yaml` document, mutated in place.
|
|
1144
|
+
* @param extConfig - The generated extension config.
|
|
1145
|
+
*/
|
|
1146
|
+
function removeLegacyImsInputs(extConfigDoc, extConfig) {
|
|
1147
|
+
const packages = Object.entries(extConfig.runtimeManifest?.packages ?? {});
|
|
1148
|
+
for (const [packageName, { actions = {} }] of packages) for (const [actionName, action] of Object.entries(actions)) {
|
|
1149
|
+
if (action.annotations?.["include-ims-credentials"] !== true) continue;
|
|
1150
|
+
const inputsPath = [
|
|
1151
|
+
"runtimeManifest",
|
|
1152
|
+
"packages",
|
|
1153
|
+
packageName,
|
|
1154
|
+
"actions",
|
|
1155
|
+
actionName,
|
|
1156
|
+
"inputs"
|
|
1157
|
+
];
|
|
1158
|
+
for (const input of LEGACY_IMS_CREDENTIAL_INPUTS) {
|
|
1159
|
+
const inputPath = [...inputsPath, input];
|
|
1160
|
+
if (extConfigDoc.hasIn(inputPath)) extConfigDoc.deleteIn(inputPath);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1147
1164
|
/**
|
|
1148
1165
|
* Updates an extension point's ext.config.yaml with generated configuration.
|
|
1149
1166
|
* @param appConfig - App configuration used to build the extension config.
|
|
@@ -1167,6 +1184,7 @@ async function updateExtConfig(appConfig, extensionPointId, projectRoot) {
|
|
|
1167
1184
|
break;
|
|
1168
1185
|
default: throw new Error(`Unsupported extension point: ${extensionPointId}`);
|
|
1169
1186
|
}
|
|
1187
|
+
removeLegacyImsInputs(extConfigDoc, extConfig);
|
|
1170
1188
|
await createOrUpdateExtConfig(extConfigPath, extConfig, extConfigDoc);
|
|
1171
1189
|
return extConfig;
|
|
1172
1190
|
}
|
|
@@ -2092,7 +2110,7 @@ async function ensureAppConfig(domains, config, projectRoot) {
|
|
|
2092
2110
|
*/
|
|
2093
2111
|
function installDependencies(packageManager, domains, projectRoot) {
|
|
2094
2112
|
const packages = [];
|
|
2095
|
-
if (domains.has("businessConfig.schema")) packages.push(`@adobe/aio-commerce-lib-config@^1.8.1-beta-
|
|
2113
|
+
if (domains.has("businessConfig.schema")) packages.push(`@adobe/aio-commerce-lib-config@^1.8.1-beta-20261001090733`);
|
|
2096
2114
|
if (packages.length === 0) {
|
|
2097
2115
|
consola.consola.info("No additional domain dependencies to install.");
|
|
2098
2116
|
return;
|
|
@@ -2128,7 +2146,7 @@ async function ensureInstallYaml(domains, config, projectRoot) {
|
|
|
2128
2146
|
|
|
2129
2147
|
//#endregion
|
|
2130
2148
|
//#region source/commands/init/main.ts
|
|
2131
|
-
const REQUIRED_DEPENDENCIES = ["@adobe/aio-commerce-sdk", `@adobe/aio-commerce-lib-app@2.1.0-beta-
|
|
2149
|
+
const REQUIRED_DEPENDENCIES = ["@adobe/aio-commerce-sdk", `@adobe/aio-commerce-lib-app@2.1.0-beta-20261001090733`];
|
|
2132
2150
|
/**
|
|
2133
2151
|
* Initializes a Commerce App project.
|
|
2134
2152
|
* @param flags - Non-interactive initialization answers.
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
const require_management = require('./management-
|
|
15
|
+
const require_management = require('./management-Dg4Mtag5.cjs');
|
|
16
16
|
let _adobe_aio_lib_state = require("@adobe/aio-lib-state");
|
|
17
|
+
let _adobe_aio_commerce_lib_auth = require("@adobe/aio-commerce-lib-auth");
|
|
17
18
|
let _adobe_aio_commerce_lib_core_headers = require("@adobe/aio-commerce-lib-core/headers");
|
|
18
19
|
let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
|
|
19
20
|
let _adobe_aio_lib_files = require("@adobe/aio-lib-files");
|
|
@@ -415,6 +416,25 @@ function buildWorkflowParams(body, rawParams) {
|
|
|
415
416
|
};
|
|
416
417
|
}
|
|
417
418
|
/**
|
|
419
|
+
* Returns the deprecated `AIO_COMMERCE_AUTH_IMS_*` params resolved from the
|
|
420
|
+
* given runtime params, or an empty object if no IMS credentials can be resolved.
|
|
421
|
+
*/
|
|
422
|
+
function getLegacyImsParams(params) {
|
|
423
|
+
try {
|
|
424
|
+
const { clientId, clientSecrets, imsOrgId, scopes, technicalAccountEmail, technicalAccountId } = (0, _adobe_aio_commerce_lib_auth.resolveImsAuthParams)(params);
|
|
425
|
+
return Object.fromEntries(Object.entries({
|
|
426
|
+
AIO_COMMERCE_AUTH_IMS_CLIENT_ID: clientId,
|
|
427
|
+
AIO_COMMERCE_AUTH_IMS_CLIENT_SECRETS: clientSecrets,
|
|
428
|
+
AIO_COMMERCE_AUTH_IMS_ORG_ID: imsOrgId,
|
|
429
|
+
AIO_COMMERCE_AUTH_IMS_SCOPES: scopes,
|
|
430
|
+
AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_EMAIL: technicalAccountEmail,
|
|
431
|
+
AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_ID: technicalAccountId
|
|
432
|
+
}).filter(([, value]) => value !== void 0));
|
|
433
|
+
} catch {
|
|
434
|
+
return {};
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
418
438
|
* Builds a LifecycleContext from merged workflow params.
|
|
419
439
|
* Shared by installation, uninstallation, and upgrade execution.
|
|
420
440
|
*/
|
|
@@ -423,7 +443,10 @@ function buildLifecycleContext(params, appConfig, logFn) {
|
|
|
423
443
|
appData: params.appData,
|
|
424
444
|
customScripts: params.customScriptsLoader?.(appConfig, logFn) ?? {},
|
|
425
445
|
logger: logFn,
|
|
426
|
-
params
|
|
446
|
+
params: {
|
|
447
|
+
...getLegacyImsParams(params),
|
|
448
|
+
...params
|
|
449
|
+
}
|
|
427
450
|
};
|
|
428
451
|
}
|
|
429
452
|
/**
|
|
@@ -144,14 +144,26 @@ type ValidationIssue = {
|
|
|
144
144
|
type LifecycleContext = {
|
|
145
145
|
/** The credentials of the app being managed. */
|
|
146
146
|
appData: AppData;
|
|
147
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* The raw action parameters from the App Builder runtime action.
|
|
149
|
+
*
|
|
150
|
+
* The `AIO_COMMERCE_AUTH_IMS_*` fields are deprecated: generated actions receive
|
|
151
|
+
* OAuth Server-to-Server credentials via the `include-ims-credentials` annotation.
|
|
152
|
+
* Use `resolveImsAuthParams(context.params)` from `@adobe/aio-commerce-lib-auth` instead.
|
|
153
|
+
*/
|
|
148
154
|
params: RuntimeActionParams & {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
+
/** @deprecated Use `resolveImsAuthParams(context.params).clientId` instead. */
|
|
156
|
+
AIO_COMMERCE_AUTH_IMS_CLIENT_ID?: string;
|
|
157
|
+
/** @deprecated Use `resolveImsAuthParams(context.params).clientSecrets` instead. */
|
|
158
|
+
AIO_COMMERCE_AUTH_IMS_CLIENT_SECRETS?: string | string[];
|
|
159
|
+
/** @deprecated Use `resolveImsAuthParams(context.params).technicalAccountId` instead. */
|
|
160
|
+
AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_ID?: string;
|
|
161
|
+
/** @deprecated Use `resolveImsAuthParams(context.params).technicalAccountEmail` instead. */
|
|
162
|
+
AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_EMAIL?: string;
|
|
163
|
+
/** @deprecated Use `resolveImsAuthParams(context.params).imsOrgId` instead. */
|
|
164
|
+
AIO_COMMERCE_AUTH_IMS_ORG_ID?: string;
|
|
165
|
+
/** @deprecated Use `resolveImsAuthParams(context.params).scopes` instead. */
|
|
166
|
+
AIO_COMMERCE_AUTH_IMS_SCOPES?: string | string[];
|
|
155
167
|
};
|
|
156
168
|
/** Logger instance for workflow logging. */
|
|
157
169
|
logger: ReturnType<typeof AioLogger>;
|
|
@@ -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-Dg4Mtag5.cjs');
|
|
17
17
|
|
|
18
18
|
exports.createInitialInstallationState = require_management.createInitialInstallationState;
|
|
19
19
|
exports.createInitialUninstallationState = require_management.createInitialUninstallationState;
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { $ as ValidationContext, A as createRetryState, B as WorkflowHooks, C as defineCustomInstallationStep, D as ValidationSummary, E as ValidationResult, F as executePlannedWorkflow, G as InferStepOutput, H as BranchStep, I as StepEvent, J as LifecycleContext, K as LeafStep, L as StepFailedEvent, M as executeWorkflow, N as planWorkflow, O as validateStepTree, P as createInitialPlanExecutionState, Q as StepMetaInfo, R as StepStartedEvent, S as CustomInstallationStepHandler, T as ValidateStepTreeOptions, U as BranchStepOptions, V as AnyStep, W as ExecutionContext, X as StepContextFactory, Y as Step, Z as StepMeta, _ as createInitialUninstallationState, _t as isFailedState, a as InstallationError, at as isBranchStep, b as runValidation, c as InstallationStatus, ct as FailedWorkflowState, d as CreateInitialUninstallationStateOptions, dt as SucceededWorkflowState, et as ValidationExecutionContext, f as InstallationHooks, ft as WorkflowData, g as createInitialInstallationState, gt as isCompletedState, h as RunValidationOptions, ht as WorkflowStateMetadata, i as InstallationData, it as defineLeafStep, j as executeUninstallWorkflow, k as createInitialState, l as SucceededInstallationState, lt as InProgressWorkflowState, m as RunUninstallationOptions, mt as WorkflowRunState, n as InProgressInstallationState, nt as ValidationIssueSeverity, o as InstallationRetryMetadata, ot as isLeafStep, p as RunInstallationOptions, pt as WorkflowError, q as LeafStepOptions, r as InstallationContext, rt as defineBranchStep, s as InstallationState, st as ExecutionStatus, t as FailedInstallationState, tt as ValidationIssue, u as CreateInitialInstallationStateOptions, ut as StepStatus, v as runInstallation, vt as isInProgressState, w as StepValidationResult, x as CustomInstallationStepDefinition, y as runUninstallation, yt as isSucceededState, z as StepSucceededEvent } from "../index-
|
|
15
|
+
import { $ as ValidationContext, A as createRetryState, B as WorkflowHooks, C as defineCustomInstallationStep, D as ValidationSummary, E as ValidationResult, F as executePlannedWorkflow, G as InferStepOutput, H as BranchStep, I as StepEvent, J as LifecycleContext, K as LeafStep, L as StepFailedEvent, M as executeWorkflow, N as planWorkflow, O as validateStepTree, P as createInitialPlanExecutionState, Q as StepMetaInfo, R as StepStartedEvent, S as CustomInstallationStepHandler, T as ValidateStepTreeOptions, U as BranchStepOptions, V as AnyStep, W as ExecutionContext, X as StepContextFactory, Y as Step, Z as StepMeta, _ as createInitialUninstallationState, _t as isFailedState, a as InstallationError, at as isBranchStep, b as runValidation, c as InstallationStatus, ct as FailedWorkflowState, d as CreateInitialUninstallationStateOptions, dt as SucceededWorkflowState, et as ValidationExecutionContext, f as InstallationHooks, ft as WorkflowData, g as createInitialInstallationState, gt as isCompletedState, h as RunValidationOptions, ht as WorkflowStateMetadata, i as InstallationData, it as defineLeafStep, j as executeUninstallWorkflow, k as createInitialState, l as SucceededInstallationState, lt as InProgressWorkflowState, m as RunUninstallationOptions, mt as WorkflowRunState, n as InProgressInstallationState, nt as ValidationIssueSeverity, o as InstallationRetryMetadata, ot as isLeafStep, p as RunInstallationOptions, pt as WorkflowError, q as LeafStepOptions, r as InstallationContext, rt as defineBranchStep, s as InstallationState, st as ExecutionStatus, t as FailedInstallationState, tt as ValidationIssue, u as CreateInitialInstallationStateOptions, ut as StepStatus, v as runInstallation, vt as isInProgressState, w as StepValidationResult, x as CustomInstallationStepDefinition, y as runUninstallation, yt as isSucceededState, z as StepSucceededEvent } from "../index-DA6KSlYt.cjs";
|
|
16
16
|
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 };
|
|
@@ -1328,7 +1328,7 @@ async function putRegistration(providerData, type, runtimeAction, events, metada
|
|
|
1328
1328
|
const registration = findDeployedRegistration(providerData, runtimeAction, existingData, context);
|
|
1329
1329
|
const name = require_utils.getRegistrationName(providerData, runtimeAction);
|
|
1330
1330
|
const payload = {
|
|
1331
|
-
clientId: params.
|
|
1331
|
+
clientId: (0, _adobe_aio_commerce_lib_auth.resolveImsAuthParams)(params).clientId,
|
|
1332
1332
|
consumerOrgId: appData.consumerOrgId,
|
|
1333
1333
|
deliveryType: "webhook",
|
|
1334
1334
|
description: require_utils.getRegistrationDescription(providerData, events, runtimeAction),
|
|
@@ -1478,7 +1478,7 @@ async function reconcileChangedSubscriptions(providerId, targetEvents, baselineE
|
|
|
1478
1478
|
}
|
|
1479
1479
|
/** Finds a deployed registration by its current or legacy name. */
|
|
1480
1480
|
function findDeployedRegistration(providerData, runtimeAction, existingData, context) {
|
|
1481
|
-
const clientId = context.params
|
|
1481
|
+
const { clientId } = (0, _adobe_aio_commerce_lib_auth.resolveImsAuthParams)(context.params);
|
|
1482
1482
|
return require_utils.findExistingRegistrations(existingData.registrations, clientId, require_utils.getRegistrationName(providerData, runtimeAction)) ?? require_utils.findExistingRegistrations(existingData.registrations, clientId, require_utils.getLegacyRegistrationName(providerData, runtimeAction));
|
|
1483
1483
|
}
|
|
1484
1484
|
|
|
@@ -1588,7 +1588,7 @@ async function createIoEventRegistration(params) {
|
|
|
1588
1588
|
const description = require_utils.getRegistrationDescription(provider, events, runtimeAction);
|
|
1589
1589
|
const payload = {
|
|
1590
1590
|
...appCredentials,
|
|
1591
|
-
clientId: runtimeParams.
|
|
1591
|
+
clientId: (0, _adobe_aio_commerce_lib_auth.resolveImsAuthParams)(runtimeParams).clientId,
|
|
1592
1592
|
deliveryType: "webhook",
|
|
1593
1593
|
description,
|
|
1594
1594
|
enabled: true,
|
|
@@ -1613,7 +1613,7 @@ async function createOrGetIoEventRegistration(params, registrations) {
|
|
|
1613
1613
|
const { context, provider, runtimeAction } = params;
|
|
1614
1614
|
const { logger, params: runtimeParams } = context;
|
|
1615
1615
|
const name = require_utils.getRegistrationName(provider, runtimeAction);
|
|
1616
|
-
const existing = require_utils.findExistingRegistrations(registrations, runtimeParams.
|
|
1616
|
+
const existing = require_utils.findExistingRegistrations(registrations, (0, _adobe_aio_commerce_lib_auth.resolveImsAuthParams)(runtimeParams).clientId, name);
|
|
1617
1617
|
if (existing) {
|
|
1618
1618
|
logger.info(`Registration "${name}" already exists for provider "${provider.label}" with ID '${existing.id}', skipping creation.`);
|
|
1619
1619
|
return existing;
|
|
@@ -1824,7 +1824,8 @@ async function deleteIoEventRegistrations(providerData, provider, events, regist
|
|
|
1824
1824
|
const actionEventsMap = require_utils.groupEventsByRuntimeActions(events);
|
|
1825
1825
|
const runtimeActions = Array.from(actionEventsMap.keys());
|
|
1826
1826
|
const registrationNames = /* @__PURE__ */ new Set([...runtimeActions.map((runtimeAction) => require_utils.getRegistrationName(providerData, runtimeAction)), ...runtimeActions.map((runtimeAction) => require_utils.getLegacyRegistrationName(providerData, runtimeAction))]);
|
|
1827
|
-
const
|
|
1827
|
+
const { clientId } = (0, _adobe_aio_commerce_lib_auth.resolveImsAuthParams)(runtimeParams);
|
|
1828
|
+
const providerRegistrations = registrations.filter((reg) => reg.client_id === clientId && registrationNames.has(reg.name));
|
|
1828
1829
|
if (providerRegistrations.length === 0) {
|
|
1829
1830
|
logger.info(`No I/O Events registrations found for provider "${provider.label}" (instance ID: "${providerData.instance_id}").`);
|
|
1830
1831
|
return;
|
|
@@ -77,7 +77,7 @@ function pruneUnusedTags(spec) {
|
|
|
77
77
|
* @param domains - The active config domains.
|
|
78
78
|
*/
|
|
79
79
|
function getOpenApiCacheKey(domains) {
|
|
80
|
-
const input = `2.1.0-beta-
|
|
80
|
+
const input = `2.1.0-beta-20261001090733:${[...domains].sort().join(",")}:3.1.0`;
|
|
81
81
|
return createHash("sha256").update(input).digest("hex").slice(0, 8);
|
|
82
82
|
}
|
|
83
83
|
/** Returns the server URL to be set in the OpenAPI spec, based on the current namespace. */
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
import "../../index-CgsSXApi.mjs";
|
|
16
16
|
import { n as CommerceAppConfig, r as CommerceAppConfigOutputModel } from "../../app-f9arYxnr.mjs";
|
|
17
|
-
import { J as LifecycleContext } from "../../index-
|
|
17
|
+
import { J as LifecycleContext } from "../../index-DsrWoPFr.mjs";
|
|
18
18
|
import "@adobe/aio-commerce-lib-core/responses";
|
|
19
19
|
import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
|
|
20
20
|
//#region source/actions/installation/common.d.ts
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
import { n as getAssociationData } from "../../repository-BGmy0YeZ.mjs";
|
|
16
16
|
import { r as nonEmptyStringValueSchema } from "../../schemas-hRovglBF.mjs";
|
|
17
17
|
import { r as validateRecordedCommerceAppConfig, t as validateCommerceAppConfig } from "../../validate-Dtz14mqi.mjs";
|
|
18
|
-
import { _ as CURRENT_STATE_KEY, a as buildWorkflowParams, b as requireCurrentAttempt, c as createLifecyclePersistence, d as getExecutedCustomInstallationSteps, f as getStorageKey, g as getCurrentLifecycleBaseline, h as createOrchestrationStateStore, i as buildLifecycleContext, l as createLifecycleRuntime, m as readStateFromStore, o as createInstallationHooks, p as isPostAppDeployInvocation, s as createInstallationStore, t as DEFAULT_ACTION_NAME, u as createUninstallationStore, v as normalizeExpiredAttempt, x as requireState, y as readOrInitializeState } from "../../common-
|
|
19
|
-
import { C as callHook, S as isLeafStep, _ as isStepConfigured, a as runValidation, b as setAtPath, d as isSucceededState, f as createRetryState, g as getAtPath, h as createWorkflowError, i as runUninstallation, l as isFailedState, m as createSucceededState, n as createInitialUninstallationState, p as createFailedState, r as runInstallation, t as createInitialInstallationState, u as isInProgressState, v as nowIsoString, x as isBranchStep, y as pathsEqual } from "../../management-
|
|
18
|
+
import { _ as CURRENT_STATE_KEY, a as buildWorkflowParams, b as requireCurrentAttempt, c as createLifecyclePersistence, d as getExecutedCustomInstallationSteps, f as getStorageKey, g as getCurrentLifecycleBaseline, h as createOrchestrationStateStore, i as buildLifecycleContext, l as createLifecycleRuntime, m as readStateFromStore, o as createInstallationHooks, p as isPostAppDeployInvocation, s as createInstallationStore, t as DEFAULT_ACTION_NAME, u as createUninstallationStore, v as normalizeExpiredAttempt, x as requireState, y as readOrInitializeState } from "../../common-D2pT4aXg.mjs";
|
|
19
|
+
import { C as callHook, S as isLeafStep, _ as isStepConfigured, a as runValidation, b as setAtPath, d as isSucceededState, f as createRetryState, g as getAtPath, h as createWorkflowError, i as runUninstallation, l as isFailedState, m as createSucceededState, n as createInitialUninstallationState, p as createFailedState, r as runInstallation, t as createInitialInstallationState, u as isInProgressState, v as nowIsoString, x as isBranchStep, y as pathsEqual } from "../../management-CQP_5T_i.mjs";
|
|
20
20
|
import { n as logger, t as HttpActionRouter } from "../../router-BshIPAR1.mjs";
|
|
21
21
|
import * as v from "valibot";
|
|
22
22
|
import { CommerceEnvSchema } from "@adobe/aio-commerce-lib-core/commerce";
|
|
@@ -17,7 +17,7 @@ import { t as stringifyError } from "../error-_RMwtrUA.mjs";
|
|
|
17
17
|
import { _ as makeOutputDirFor, a as resolveCommerceAppConfig, c as getExecCommand, d as getPackageExecutionCommand, f as getProjectInstallCommand, g as loadPackageJson, h as isESM, i as readCommerceAppConfig, l as getInstallCommand, m as getRunScriptCommand, n as isTypeScriptConfig, o as appendCommand, p as getProjectRootDirectory, r as parseCommerceAppConfig, s as detectPackageManager, t as hasNamedCommerceAppConfigExports, u as getPackageDependencyInstallPlan, v as mergePackageJsonDependencies, y as readPackageJson } from "../index.node-Ba-Fbybm.mjs";
|
|
18
18
|
import { a as hasCustomInstallationSteps, d as ADMIN_UI_MASS_ACTION_ENTITIES, m as hasBackendUiV2Components, u as ADMIN_UI_GRID_COLUMN_ENTITIES } from "../webhooks-24rGz8lk.mjs";
|
|
19
19
|
import { o as getConfigDomains, t as validateCommerceAppConfig, u as hasBusinessConfigSchema } from "../validate-Dtz14mqi.mjs";
|
|
20
|
-
import { n as INSTALLATION_INVOCATION_SOURCE_HEADER, r as POST_APP_DEPLOY_INVOCATION_SOURCE } from "../common-
|
|
20
|
+
import { n as INSTALLATION_INVOCATION_SOURCE_HEADER, r as POST_APP_DEPLOY_INVOCATION_SOURCE } from "../common-D2pT4aXg.mjs";
|
|
21
21
|
import { t as inspect } from "../logging-CXesop3u.mjs";
|
|
22
22
|
import { hasDynamicSchema } from "@adobe/aio-commerce-lib-config";
|
|
23
23
|
import { CommerceSdkValidationError } from "@adobe/aio-commerce-lib-core/error";
|
|
@@ -98,17 +98,6 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
98
98
|
const __dirname = dirname(__filename);
|
|
99
99
|
/** The path to the action templates directory, sibling to this file. */
|
|
100
100
|
const TEMPLATES_DIR = join(__dirname, "templates");
|
|
101
|
-
/** The list of Commerce variables that are required for the runtime actions. */
|
|
102
|
-
const COMMERCE_VARIABLES = [
|
|
103
|
-
"AIO_COMMERCE_AUTH_IMS_CLIENT_ID",
|
|
104
|
-
"AIO_COMMERCE_AUTH_IMS_CLIENT_SECRETS",
|
|
105
|
-
"AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_ID",
|
|
106
|
-
"AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_EMAIL",
|
|
107
|
-
"AIO_COMMERCE_AUTH_IMS_ORG_ID",
|
|
108
|
-
"AIO_COMMERCE_AUTH_IMS_SCOPES"
|
|
109
|
-
];
|
|
110
|
-
/** The inputs for the generated runtime actions. */
|
|
111
|
-
const COMMERCE_ACTION_INPUTS = Object.fromEntries(COMMERCE_VARIABLES.map((variable) => [variable, `$${variable}`]));
|
|
112
101
|
const CUSTOM_IMPORTS_PLACEHOLDER = "// {{CUSTOM_SCRIPTS_IMPORTS}}";
|
|
113
102
|
const CUSTOM_SCRIPTS_MAP_PLACEHOLDER = "// {{CUSTOM_SCRIPTS_MAP}}";
|
|
114
103
|
const CUSTOM_SCRIPTS_LOADER_PLACEHOLDER = "// {{CUSTOM_SCRIPTS_LOADER}}";
|
|
@@ -369,7 +358,7 @@ const LEADING_DOT_SLASH_PATTERN$1 = /^\.\//u;
|
|
|
369
358
|
const WEB_SOURCE_DEPENDENCIES = [
|
|
370
359
|
{
|
|
371
360
|
name: "@adobe/aio-commerce-lib-admin-ui",
|
|
372
|
-
version: "^1.2.0-beta-
|
|
361
|
+
version: "^1.2.0-beta-20261001090733"
|
|
373
362
|
},
|
|
374
363
|
{
|
|
375
364
|
name: "react",
|
|
@@ -616,7 +605,8 @@ function createActionDefinition(actionName, config = {}, options = {}) {
|
|
|
616
605
|
...options,
|
|
617
606
|
annotations: {
|
|
618
607
|
final: true,
|
|
619
|
-
"require-adobe-auth": true
|
|
608
|
+
"require-adobe-auth": true,
|
|
609
|
+
...config.requiresImsCredentials && { "include-ims-credentials": true }
|
|
620
610
|
},
|
|
621
611
|
function: `${GENERATED_ACTIONS_PATH}/${actionName}.js`,
|
|
622
612
|
runtime: "nodejs:24",
|
|
@@ -629,12 +619,6 @@ function createActionDefinition(actionName, config = {}, options = {}) {
|
|
|
629
619
|
return def;
|
|
630
620
|
}
|
|
631
621
|
/**
|
|
632
|
-
* Inputs shared by the runtime actions that talk to the Commerce App Management
|
|
633
|
-
* Service. `LOG_LEVEL` is declared once at the package level, so it's omitted
|
|
634
|
-
* here to avoid duplicating it on every action.
|
|
635
|
-
*/
|
|
636
|
-
const RUNTIME_ACTION_INPUTS = COMMERCE_ACTION_INPUTS;
|
|
637
|
-
/**
|
|
638
622
|
* Gets the runtime actions to be generated from the ext.config.yaml configuration.
|
|
639
623
|
* @param extConfig - The ext.config.yaml configuration.
|
|
640
624
|
* @param dir - Directory containing the runtime action templates.
|
|
@@ -665,7 +649,7 @@ function buildAppManagementExtConfig(appConfig) {
|
|
|
665
649
|
runtimeManifest: { packages: { [PACKAGE_NAME]: {
|
|
666
650
|
actions: {
|
|
667
651
|
"app-config": createActionDefinition("app-config"),
|
|
668
|
-
association: createActionDefinition("association", {
|
|
652
|
+
association: createActionDefinition("association", { requiresImsCredentials: true })
|
|
669
653
|
},
|
|
670
654
|
inputs: { LOG_LEVEL: "$LOG_LEVEL" },
|
|
671
655
|
license: "Apache-2.0"
|
|
@@ -676,10 +660,10 @@ function buildAppManagementExtConfig(appConfig) {
|
|
|
676
660
|
impl: `${PACKAGE_NAME}/installation`,
|
|
677
661
|
type: "action"
|
|
678
662
|
});
|
|
679
|
-
extConfig.runtimeManifest.packages[PACKAGE_NAME].actions.installation = createActionDefinition("installation", {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
});
|
|
663
|
+
extConfig.runtimeManifest.packages[PACKAGE_NAME].actions.installation = createActionDefinition("installation", {
|
|
664
|
+
requiresEncryptionKey: hasPasswordFieldsInSchema,
|
|
665
|
+
requiresImsCredentials: true
|
|
666
|
+
}, { limits: { timeout: 6e5 } });
|
|
683
667
|
return extConfig;
|
|
684
668
|
}
|
|
685
669
|
/** Builds the ext.config.yaml configuration for the business configuration extension. */
|
|
@@ -1135,6 +1119,39 @@ async function readExtConfig(extensionPointId, projectRoot) {
|
|
|
1135
1119
|
].join("\n"), { cause: error });
|
|
1136
1120
|
}
|
|
1137
1121
|
}
|
|
1122
|
+
/** Inputs superseded by the `include-ims-credentials` action annotation. */
|
|
1123
|
+
const LEGACY_IMS_CREDENTIAL_INPUTS = [
|
|
1124
|
+
"AIO_COMMERCE_AUTH_IMS_CLIENT_ID",
|
|
1125
|
+
"AIO_COMMERCE_AUTH_IMS_CLIENT_SECRETS",
|
|
1126
|
+
"AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_ID",
|
|
1127
|
+
"AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_EMAIL",
|
|
1128
|
+
"AIO_COMMERCE_AUTH_IMS_ORG_ID",
|
|
1129
|
+
"AIO_COMMERCE_AUTH_IMS_SCOPES"
|
|
1130
|
+
];
|
|
1131
|
+
/**
|
|
1132
|
+
* Removes the legacy `AIO_COMMERCE_AUTH_IMS_*` inputs from the existing
|
|
1133
|
+
* `ext.config.yaml` document for every action annotated with `include-ims-credentials`.
|
|
1134
|
+
* @param extConfigDoc - The existing `ext.config.yaml` document, mutated in place.
|
|
1135
|
+
* @param extConfig - The generated extension config.
|
|
1136
|
+
*/
|
|
1137
|
+
function removeLegacyImsInputs(extConfigDoc, extConfig) {
|
|
1138
|
+
const packages = Object.entries(extConfig.runtimeManifest?.packages ?? {});
|
|
1139
|
+
for (const [packageName, { actions = {} }] of packages) for (const [actionName, action] of Object.entries(actions)) {
|
|
1140
|
+
if (action.annotations?.["include-ims-credentials"] !== true) continue;
|
|
1141
|
+
const inputsPath = [
|
|
1142
|
+
"runtimeManifest",
|
|
1143
|
+
"packages",
|
|
1144
|
+
packageName,
|
|
1145
|
+
"actions",
|
|
1146
|
+
actionName,
|
|
1147
|
+
"inputs"
|
|
1148
|
+
];
|
|
1149
|
+
for (const input of LEGACY_IMS_CREDENTIAL_INPUTS) {
|
|
1150
|
+
const inputPath = [...inputsPath, input];
|
|
1151
|
+
if (extConfigDoc.hasIn(inputPath)) extConfigDoc.deleteIn(inputPath);
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1138
1155
|
/**
|
|
1139
1156
|
* Updates an extension point's ext.config.yaml with generated configuration.
|
|
1140
1157
|
* @param appConfig - App configuration used to build the extension config.
|
|
@@ -1158,6 +1175,7 @@ async function updateExtConfig(appConfig, extensionPointId, projectRoot) {
|
|
|
1158
1175
|
break;
|
|
1159
1176
|
default: throw new Error(`Unsupported extension point: ${extensionPointId}`);
|
|
1160
1177
|
}
|
|
1178
|
+
removeLegacyImsInputs(extConfigDoc, extConfig);
|
|
1161
1179
|
await createOrUpdateExtConfig(extConfigPath, extConfig, extConfigDoc);
|
|
1162
1180
|
return extConfig;
|
|
1163
1181
|
}
|
|
@@ -2083,7 +2101,7 @@ async function ensureAppConfig(domains, config, projectRoot) {
|
|
|
2083
2101
|
*/
|
|
2084
2102
|
function installDependencies(packageManager, domains, projectRoot) {
|
|
2085
2103
|
const packages = [];
|
|
2086
|
-
if (domains.has("businessConfig.schema")) packages.push(`@adobe/aio-commerce-lib-config@^1.8.1-beta-
|
|
2104
|
+
if (domains.has("businessConfig.schema")) packages.push(`@adobe/aio-commerce-lib-config@^1.8.1-beta-20261001090733`);
|
|
2087
2105
|
if (packages.length === 0) {
|
|
2088
2106
|
consola.info("No additional domain dependencies to install.");
|
|
2089
2107
|
return;
|
|
@@ -2119,7 +2137,7 @@ async function ensureInstallYaml(domains, config, projectRoot) {
|
|
|
2119
2137
|
|
|
2120
2138
|
//#endregion
|
|
2121
2139
|
//#region source/commands/init/main.ts
|
|
2122
|
-
const REQUIRED_DEPENDENCIES = ["@adobe/aio-commerce-sdk", `@adobe/aio-commerce-lib-app@2.1.0-beta-
|
|
2140
|
+
const REQUIRED_DEPENDENCIES = ["@adobe/aio-commerce-sdk", `@adobe/aio-commerce-lib-app@2.1.0-beta-20261001090733`];
|
|
2123
2141
|
/**
|
|
2124
2142
|
* Initializes a Commerce App project.
|
|
2125
2143
|
* @param flags - Non-interactive initialization answers.
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { c as isCompletedState, d as isSucceededState, o as createRootInstallationStep } from "./management-
|
|
15
|
+
import { c as isCompletedState, d as isSucceededState, o as createRootInstallationStep } from "./management-CQP_5T_i.mjs";
|
|
16
16
|
import { init } from "@adobe/aio-lib-state";
|
|
17
|
+
import { resolveImsAuthParams } from "@adobe/aio-commerce-lib-auth";
|
|
17
18
|
import { getHeader } from "@adobe/aio-commerce-lib-core/headers";
|
|
18
19
|
import { noContent, ok } from "@adobe/aio-commerce-lib-core/responses";
|
|
19
20
|
import { init as init$1 } from "@adobe/aio-lib-files";
|
|
@@ -415,6 +416,25 @@ function buildWorkflowParams(body, rawParams) {
|
|
|
415
416
|
};
|
|
416
417
|
}
|
|
417
418
|
/**
|
|
419
|
+
* Returns the deprecated `AIO_COMMERCE_AUTH_IMS_*` params resolved from the
|
|
420
|
+
* given runtime params, or an empty object if no IMS credentials can be resolved.
|
|
421
|
+
*/
|
|
422
|
+
function getLegacyImsParams(params) {
|
|
423
|
+
try {
|
|
424
|
+
const { clientId, clientSecrets, imsOrgId, scopes, technicalAccountEmail, technicalAccountId } = resolveImsAuthParams(params);
|
|
425
|
+
return Object.fromEntries(Object.entries({
|
|
426
|
+
AIO_COMMERCE_AUTH_IMS_CLIENT_ID: clientId,
|
|
427
|
+
AIO_COMMERCE_AUTH_IMS_CLIENT_SECRETS: clientSecrets,
|
|
428
|
+
AIO_COMMERCE_AUTH_IMS_ORG_ID: imsOrgId,
|
|
429
|
+
AIO_COMMERCE_AUTH_IMS_SCOPES: scopes,
|
|
430
|
+
AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_EMAIL: technicalAccountEmail,
|
|
431
|
+
AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_ID: technicalAccountId
|
|
432
|
+
}).filter(([, value]) => value !== void 0));
|
|
433
|
+
} catch {
|
|
434
|
+
return {};
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
418
438
|
* Builds a LifecycleContext from merged workflow params.
|
|
419
439
|
* Shared by installation, uninstallation, and upgrade execution.
|
|
420
440
|
*/
|
|
@@ -423,7 +443,10 @@ function buildLifecycleContext(params, appConfig, logFn) {
|
|
|
423
443
|
appData: params.appData,
|
|
424
444
|
customScripts: params.customScriptsLoader?.(appConfig, logFn) ?? {},
|
|
425
445
|
logger: logFn,
|
|
426
|
-
params
|
|
446
|
+
params: {
|
|
447
|
+
...getLegacyImsParams(params),
|
|
448
|
+
...params
|
|
449
|
+
}
|
|
427
450
|
};
|
|
428
451
|
}
|
|
429
452
|
/**
|
|
@@ -144,14 +144,26 @@ type ValidationIssue = {
|
|
|
144
144
|
type LifecycleContext = {
|
|
145
145
|
/** The credentials of the app being managed. */
|
|
146
146
|
appData: AppData;
|
|
147
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* The raw action parameters from the App Builder runtime action.
|
|
149
|
+
*
|
|
150
|
+
* The `AIO_COMMERCE_AUTH_IMS_*` fields are deprecated: generated actions receive
|
|
151
|
+
* OAuth Server-to-Server credentials via the `include-ims-credentials` annotation.
|
|
152
|
+
* Use `resolveImsAuthParams(context.params)` from `@adobe/aio-commerce-lib-auth` instead.
|
|
153
|
+
*/
|
|
148
154
|
params: RuntimeActionParams & {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
+
/** @deprecated Use `resolveImsAuthParams(context.params).clientId` instead. */
|
|
156
|
+
AIO_COMMERCE_AUTH_IMS_CLIENT_ID?: string;
|
|
157
|
+
/** @deprecated Use `resolveImsAuthParams(context.params).clientSecrets` instead. */
|
|
158
|
+
AIO_COMMERCE_AUTH_IMS_CLIENT_SECRETS?: string | string[];
|
|
159
|
+
/** @deprecated Use `resolveImsAuthParams(context.params).technicalAccountId` instead. */
|
|
160
|
+
AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_ID?: string;
|
|
161
|
+
/** @deprecated Use `resolveImsAuthParams(context.params).technicalAccountEmail` instead. */
|
|
162
|
+
AIO_COMMERCE_AUTH_IMS_TECHNICAL_ACCOUNT_EMAIL?: string;
|
|
163
|
+
/** @deprecated Use `resolveImsAuthParams(context.params).imsOrgId` instead. */
|
|
164
|
+
AIO_COMMERCE_AUTH_IMS_ORG_ID?: string;
|
|
165
|
+
/** @deprecated Use `resolveImsAuthParams(context.params).scopes` instead. */
|
|
166
|
+
AIO_COMMERCE_AUTH_IMS_SCOPES?: string | string[];
|
|
155
167
|
};
|
|
156
168
|
/** Logger instance for workflow logging. */
|
|
157
169
|
logger: ReturnType<typeof AioLogger>;
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { $ as ValidationContext, A as createRetryState, B as WorkflowHooks, C as defineCustomInstallationStep, D as ValidationSummary, E as ValidationResult, F as executePlannedWorkflow, G as InferStepOutput, H as BranchStep, I as StepEvent, J as LifecycleContext, K as LeafStep, L as StepFailedEvent, M as executeWorkflow, N as planWorkflow, O as validateStepTree, P as createInitialPlanExecutionState, Q as StepMetaInfo, R as StepStartedEvent, S as CustomInstallationStepHandler, T as ValidateStepTreeOptions, U as BranchStepOptions, V as AnyStep, W as ExecutionContext, X as StepContextFactory, Y as Step, Z as StepMeta, _ as createInitialUninstallationState, _t as isFailedState, a as InstallationError, at as isBranchStep, b as runValidation, c as InstallationStatus, ct as FailedWorkflowState, d as CreateInitialUninstallationStateOptions, dt as SucceededWorkflowState, et as ValidationExecutionContext, f as InstallationHooks, ft as WorkflowData, g as createInitialInstallationState, gt as isCompletedState, h as RunValidationOptions, ht as WorkflowStateMetadata, i as InstallationData, it as defineLeafStep, j as executeUninstallWorkflow, k as createInitialState, l as SucceededInstallationState, lt as InProgressWorkflowState, m as RunUninstallationOptions, mt as WorkflowRunState, n as InProgressInstallationState, nt as ValidationIssueSeverity, o as InstallationRetryMetadata, ot as isLeafStep, p as RunInstallationOptions, pt as WorkflowError, q as LeafStepOptions, r as InstallationContext, rt as defineBranchStep, s as InstallationState, st as ExecutionStatus, t as FailedInstallationState, tt as ValidationIssue, u as CreateInitialInstallationStateOptions, ut as StepStatus, v as runInstallation, vt as isInProgressState, w as StepValidationResult, x as CustomInstallationStepDefinition, y as runUninstallation, yt as isSucceededState, z as StepSucceededEvent } from "../index-
|
|
15
|
+
import { $ as ValidationContext, A as createRetryState, B as WorkflowHooks, C as defineCustomInstallationStep, D as ValidationSummary, E as ValidationResult, F as executePlannedWorkflow, G as InferStepOutput, H as BranchStep, I as StepEvent, J as LifecycleContext, K as LeafStep, L as StepFailedEvent, M as executeWorkflow, N as planWorkflow, O as validateStepTree, P as createInitialPlanExecutionState, Q as StepMetaInfo, R as StepStartedEvent, S as CustomInstallationStepHandler, T as ValidateStepTreeOptions, U as BranchStepOptions, V as AnyStep, W as ExecutionContext, X as StepContextFactory, Y as Step, Z as StepMeta, _ as createInitialUninstallationState, _t as isFailedState, a as InstallationError, at as isBranchStep, b as runValidation, c as InstallationStatus, ct as FailedWorkflowState, d as CreateInitialUninstallationStateOptions, dt as SucceededWorkflowState, et as ValidationExecutionContext, f as InstallationHooks, ft as WorkflowData, g as createInitialInstallationState, gt as isCompletedState, h as RunValidationOptions, ht as WorkflowStateMetadata, i as InstallationData, it as defineLeafStep, j as executeUninstallWorkflow, k as createInitialState, l as SucceededInstallationState, lt as InProgressWorkflowState, m as RunUninstallationOptions, mt as WorkflowRunState, n as InProgressInstallationState, nt as ValidationIssueSeverity, o as InstallationRetryMetadata, ot as isLeafStep, p as RunInstallationOptions, pt as WorkflowError, q as LeafStepOptions, r as InstallationContext, rt as defineBranchStep, s as InstallationState, st as ExecutionStatus, t as FailedInstallationState, tt as ValidationIssue, u as CreateInitialInstallationStateOptions, ut as StepStatus, v as runInstallation, vt as isInProgressState, w as StepValidationResult, x as CustomInstallationStepDefinition, y as runUninstallation, yt as isSucceededState, z as StepSucceededEvent } from "../index-DsrWoPFr.mjs";
|
|
16
16
|
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, c as isCompletedState, d as isSucceededState, i as runUninstallation, l as isFailedState, n as createInitialUninstallationState, r as runInstallation, s as defineCustomInstallationStep, t as createInitialInstallationState, u as isInProgressState } from "../management-
|
|
15
|
+
import { a as runValidation, c as isCompletedState, d as isSucceededState, i as runUninstallation, l as isFailedState, n as createInitialUninstallationState, r as runInstallation, s as defineCustomInstallationStep, t as createInitialInstallationState, u as isInProgressState } from "../management-CQP_5T_i.mjs";
|
|
16
16
|
|
|
17
17
|
export { createInitialInstallationState, createInitialUninstallationState, defineCustomInstallationStep, isCompletedState, isFailedState, isInProgressState, isSucceededState, runInstallation, runUninstallation, runValidation };
|
|
@@ -1324,7 +1324,7 @@ async function putRegistration(providerData, type, runtimeAction, events, metada
|
|
|
1324
1324
|
const registration = findDeployedRegistration(providerData, runtimeAction, existingData, context);
|
|
1325
1325
|
const name = getRegistrationName(providerData, runtimeAction);
|
|
1326
1326
|
const payload = {
|
|
1327
|
-
clientId: params.
|
|
1327
|
+
clientId: resolveImsAuthParams(params).clientId,
|
|
1328
1328
|
consumerOrgId: appData.consumerOrgId,
|
|
1329
1329
|
deliveryType: "webhook",
|
|
1330
1330
|
description: getRegistrationDescription(providerData, events, runtimeAction),
|
|
@@ -1474,7 +1474,7 @@ async function reconcileChangedSubscriptions(providerId, targetEvents, baselineE
|
|
|
1474
1474
|
}
|
|
1475
1475
|
/** Finds a deployed registration by its current or legacy name. */
|
|
1476
1476
|
function findDeployedRegistration(providerData, runtimeAction, existingData, context) {
|
|
1477
|
-
const clientId = context.params
|
|
1477
|
+
const { clientId } = resolveImsAuthParams(context.params);
|
|
1478
1478
|
return findExistingRegistrations(existingData.registrations, clientId, getRegistrationName(providerData, runtimeAction)) ?? findExistingRegistrations(existingData.registrations, clientId, getLegacyRegistrationName(providerData, runtimeAction));
|
|
1479
1479
|
}
|
|
1480
1480
|
|
|
@@ -1584,7 +1584,7 @@ async function createIoEventRegistration(params) {
|
|
|
1584
1584
|
const description = getRegistrationDescription(provider, events, runtimeAction);
|
|
1585
1585
|
const payload = {
|
|
1586
1586
|
...appCredentials,
|
|
1587
|
-
clientId: runtimeParams.
|
|
1587
|
+
clientId: resolveImsAuthParams(runtimeParams).clientId,
|
|
1588
1588
|
deliveryType: "webhook",
|
|
1589
1589
|
description,
|
|
1590
1590
|
enabled: true,
|
|
@@ -1609,7 +1609,7 @@ async function createOrGetIoEventRegistration(params, registrations) {
|
|
|
1609
1609
|
const { context, provider, runtimeAction } = params;
|
|
1610
1610
|
const { logger, params: runtimeParams } = context;
|
|
1611
1611
|
const name = getRegistrationName(provider, runtimeAction);
|
|
1612
|
-
const existing = findExistingRegistrations(registrations, runtimeParams.
|
|
1612
|
+
const existing = findExistingRegistrations(registrations, resolveImsAuthParams(runtimeParams).clientId, name);
|
|
1613
1613
|
if (existing) {
|
|
1614
1614
|
logger.info(`Registration "${name}" already exists for provider "${provider.label}" with ID '${existing.id}', skipping creation.`);
|
|
1615
1615
|
return existing;
|
|
@@ -1820,7 +1820,8 @@ async function deleteIoEventRegistrations(providerData, provider, events, regist
|
|
|
1820
1820
|
const actionEventsMap = groupEventsByRuntimeActions(events);
|
|
1821
1821
|
const runtimeActions = Array.from(actionEventsMap.keys());
|
|
1822
1822
|
const registrationNames = /* @__PURE__ */ new Set([...runtimeActions.map((runtimeAction) => getRegistrationName(providerData, runtimeAction)), ...runtimeActions.map((runtimeAction) => getLegacyRegistrationName(providerData, runtimeAction))]);
|
|
1823
|
-
const
|
|
1823
|
+
const { clientId } = resolveImsAuthParams(runtimeParams);
|
|
1824
|
+
const providerRegistrations = registrations.filter((reg) => reg.client_id === clientId && registrationNames.has(reg.name));
|
|
1824
1825
|
if (providerRegistrations.length === 0) {
|
|
1825
1826
|
logger.info(`No I/O Events registrations found for provider "${provider.label}" (instance ID: "${providerData.instance_id}").`);
|
|
1826
1827
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/aio-commerce-lib-app",
|
|
3
|
-
"version": "2.1.0-beta-
|
|
3
|
+
"version": "2.1.0-beta-20261001090733",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "App configuration management library for Adobe Commerce applications",
|
|
6
6
|
"keywords": [
|
|
@@ -92,13 +92,13 @@
|
|
|
92
92
|
"README.md"
|
|
93
93
|
],
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@adobe/aio-commerce-lib-admin-ui": "1.2.0-beta-
|
|
96
|
-
"@adobe/aio-commerce-lib-api": "1.4.1-beta-
|
|
97
|
-
"@adobe/aio-commerce-lib-auth": "1.2.0-beta-
|
|
98
|
-
"@adobe/aio-commerce-lib-config": "1.8.1-beta-
|
|
95
|
+
"@adobe/aio-commerce-lib-admin-ui": "1.2.0-beta-20261001090733",
|
|
96
|
+
"@adobe/aio-commerce-lib-api": "1.4.1-beta-20261001090733",
|
|
97
|
+
"@adobe/aio-commerce-lib-auth": "1.2.0-beta-20261001090733",
|
|
98
|
+
"@adobe/aio-commerce-lib-config": "1.8.1-beta-20261001090733",
|
|
99
99
|
"@adobe/aio-commerce-lib-core": "1.2.0",
|
|
100
|
-
"@adobe/aio-commerce-lib-events": "1.4.1-beta-
|
|
101
|
-
"@adobe/aio-commerce-lib-webhooks": "1.2.3-beta-
|
|
100
|
+
"@adobe/aio-commerce-lib-events": "1.4.1-beta-20261001090733",
|
|
101
|
+
"@adobe/aio-commerce-lib-webhooks": "1.2.3-beta-20261001090733",
|
|
102
102
|
"@adobe/aio-lib-core-config": "^5.0.1",
|
|
103
103
|
"@adobe/aio-lib-core-logging": "^3.0.2",
|
|
104
104
|
"@adobe/aio-lib-files": "^4.1.2",
|