@adobe/aio-commerce-lib-app 1.5.0 → 1.6.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 +26 -0
- package/dist/cjs/actions/app-config.cjs +17 -4
- package/dist/cjs/actions/app-config.d.cts +3 -4
- package/dist/cjs/actions/config.cjs +21 -16
- package/dist/cjs/actions/config.d.cts +1 -2
- package/dist/cjs/actions/installation.cjs +20 -14
- package/dist/cjs/actions/installation.d.cts +4 -5
- package/dist/cjs/actions/registration.cjs +1 -2
- package/dist/cjs/actions/registration.d.cts +2 -3
- package/dist/cjs/actions/scope-tree.cjs +5 -5
- package/dist/cjs/actions/scope-tree.d.cts +1 -4
- package/dist/cjs/{admin-ui-sdk-BiSopnKI.d.cts → admin-ui-sdk-DZZJCrdT.d.cts} +1 -1
- package/dist/cjs/{app-C6kImBl7.d.cts → app-CakwxQvs.d.cts} +129 -20
- package/dist/cjs/commands/index.cjs +236 -45
- package/dist/cjs/commands/templates/app-management/app-config.js.template +2 -2
- package/dist/cjs/config/index.cjs +3 -3
- package/dist/cjs/config/index.d.cts +354 -391
- package/dist/cjs/{config-ct-qMOGj.cjs → config-FNMclIFO.cjs} +4 -6
- package/dist/cjs/{error-C5LNOZ4f.cjs → error-D-N0PKSl.cjs} +0 -1
- package/dist/cjs/{index-B5WKJ3hJ.d.cts → index-Dw2NvVOY.d.cts} +2 -2
- package/dist/cjs/{logging-BTevALnL.cjs → logging-BVz3weoC.cjs} +1 -1
- package/dist/cjs/management/index.cjs +1 -1
- package/dist/cjs/management/index.d.cts +3 -3
- package/dist/cjs/{management-D1QXg4YU.cjs → management-Cvsz4VMf.cjs} +34 -9
- package/dist/cjs/{router-CFErodHU.cjs → router-BOR7T6qR.cjs} +1 -1
- package/dist/cjs/{schemas-CukVpc19.cjs → schemas-FngDuIeo.cjs} +1 -1
- package/dist/{es/step-0eI2x4C9.d.mts → cjs/step-CKVE0aJi.d.cts} +3 -3
- package/dist/cjs/{validate-b_bI4mDb.cjs → validate-DydOAZha.cjs} +4 -4
- package/dist/cjs/{webhooks-DS1BtgED.cjs → webhooks-tbZy9G3p.cjs} +4 -4
- package/dist/es/actions/app-config.d.mts +3 -4
- package/dist/es/actions/app-config.mjs +18 -4
- package/dist/es/actions/config.d.mts +1 -2
- package/dist/es/actions/config.mjs +20 -15
- package/dist/es/actions/installation.d.mts +4 -5
- package/dist/es/actions/installation.mjs +19 -13
- package/dist/es/actions/registration.d.mts +2 -3
- package/dist/es/actions/registration.mjs +1 -1
- package/dist/es/actions/scope-tree.d.mts +1 -4
- package/dist/es/actions/scope-tree.mjs +4 -4
- package/dist/es/{admin-ui-sdk-CCo2SWiL.d.mts → admin-ui-sdk-hu6iWr0A.d.mts} +1 -1
- package/dist/es/{app-DcY6dJiQ.d.mts → app-CakwxQvs.d.mts} +129 -20
- package/dist/es/commands/index.mjs +218 -27
- package/dist/es/commands/templates/app-management/app-config.js.template +2 -2
- package/dist/es/config/index.d.mts +354 -391
- package/dist/es/config/index.mjs +3 -3
- package/dist/es/{config-DGPFTk6w.mjs → config-CcE0EBG7.mjs} +4 -5
- package/dist/es/{index-CCov0odd.d.mts → index-Bo0tQsVq.d.mts} +2 -2
- package/dist/es/management/index.d.mts +3 -3
- package/dist/es/management/index.mjs +1 -1
- package/dist/es/{management-CCsOfniv.mjs → management-BZ4Y6lVp.mjs} +33 -8
- package/dist/{cjs/step-CWYnKbga.d.cts → es/step-D64mMPrt.d.mts} +3 -3
- package/dist/es/{validate-Dn3lLTGj.mjs → validate-Du3LhCre.mjs} +3 -3
- package/dist/es/{webhooks-Dhrkkip7.mjs → webhooks-B5oq9ULL.mjs} +3 -3
- package/package.json +15 -10
- /package/dist/cjs/{chunk-DS2yp5vX.cjs → chunk-Cozy-1ZF.cjs} +0 -0
- /package/dist/es/{error-DHlYzkbb.mjs → error-_RMwtrUA.mjs} +0 -0
- /package/dist/es/{logging-XIUXDK5T.mjs → logging-DbJHXSKh.mjs} +0 -0
- /package/dist/es/{router-BxaxEEu3.mjs → router-D58JJHHA.mjs} +0 -0
- /package/dist/es/{schemas-DOcnD16x.mjs → schemas-hRovglBF.mjs} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @adobe/aio-commerce-lib-app
|
|
2
2
|
|
|
3
|
+
## 1.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#438](https://github.com/adobe/aio-commerce-sdk/pull/438) [`fbc70ea`](https://github.com/adobe/aio-commerce-sdk/commit/fbc70ea680e5f0f7da10fc1771e5327806aad4bc) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Support `dynamicList` business configuration fields. The generated `config` and `app-config` actions will now resolve list options at request time.
|
|
8
|
+
|
|
9
|
+
- [#469](https://github.com/adobe/aio-commerce-sdk/pull/469) [`ad3d980`](https://github.com/adobe/aio-commerce-sdk/commit/ad3d980f0370e21c61f34426ab2638fb682e008d) Thanks [@aligent-lturner](https://github.com/aligent-lturner)! - Preserve a manually-set `runtime` on generated actions. Codegen no longer overwrites the `runtime` field in `ext.config.yaml`, so you can pin a different Node runtime (e.g. `nodejs:24`) and it survives regeneration.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#470](https://github.com/adobe/aio-commerce-sdk/pull/470) [`ec2d426`](https://github.com/adobe/aio-commerce-sdk/commit/ec2d4262166bde68a434025667f38609313ad712) Thanks [@iivvaannxx](https://github.com/iivvaannxx)! - Fix CJS interop for ESM-only dependencies (`camelcase`, `ky`) on Node.js 22+
|
|
14
|
+
|
|
15
|
+
- [#456](https://github.com/adobe/aio-commerce-sdk/pull/456) [`dac5c04`](https://github.com/adobe/aio-commerce-sdk/commit/dac5c04bbb33cf4e42de819b21fb4a5bc932a586) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Add validation on unique event provider label.
|
|
16
|
+
|
|
17
|
+
- [#456](https://github.com/adobe/aio-commerce-sdk/pull/456) [`dac5c04`](https://github.com/adobe/aio-commerce-sdk/commit/dac5c04bbb33cf4e42de819b21fb4a5bc932a586) Thanks [@oshmyheliuk](https://github.com/oshmyheliuk)! - Fix only one I/O Events registration being created when multiple event providers share the same runtime action.
|
|
18
|
+
|
|
19
|
+
- [#457](https://github.com/adobe/aio-commerce-sdk/pull/457) [`6bc80bc`](https://github.com/adobe/aio-commerce-sdk/commit/6bc80bcf6fb28219998c2f0f7ff0f66f5f4457c0) Thanks [@obarcelonap](https://github.com/obarcelonap)! - Fix event subscription rules not being forwarded to Commerce when installing an app
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [[`ec2d426`](https://github.com/adobe/aio-commerce-sdk/commit/ec2d4262166bde68a434025667f38609313ad712), [`705b3b8`](https://github.com/adobe/aio-commerce-sdk/commit/705b3b89b2bb0f1cee421434be4bc92b71ddc0a9), [`fb28949`](https://github.com/adobe/aio-commerce-sdk/commit/fb2894915c6fa411ed24f3501a7fc600e4eb88ee), [`fbc70ea`](https://github.com/adobe/aio-commerce-sdk/commit/fbc70ea680e5f0f7da10fc1771e5327806aad4bc)]:
|
|
22
|
+
- @adobe/aio-commerce-lib-api@1.2.1
|
|
23
|
+
- @adobe/aio-commerce-lib-core@1.1.1
|
|
24
|
+
- @adobe/aio-commerce-lib-config@1.5.0
|
|
25
|
+
- @adobe/aio-commerce-lib-events@1.2.1
|
|
26
|
+
- @adobe/aio-commerce-lib-webhooks@1.1.1
|
|
27
|
+
- @adobe/aio-commerce-lib-auth@1.1.1
|
|
28
|
+
|
|
3
29
|
## 1.5.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
16
|
+
const require_router = require('../router-BOR7T6qR.cjs');
|
|
17
|
+
const require_validate = require('../validate-DydOAZha.cjs');
|
|
18
|
+
let _adobe_aio_commerce_lib_config = require("@adobe/aio-commerce-lib-config");
|
|
19
19
|
let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
|
|
20
20
|
|
|
21
21
|
//#region source/actions/app-config.ts
|
|
@@ -23,8 +23,21 @@ let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-co
|
|
|
23
23
|
const router = new require_router.HttpActionRouter().use(require_router.logger({ name: () => "app-config" }));
|
|
24
24
|
/** GET / - Get app config */
|
|
25
25
|
router.get("/", { handler: async (_req, { logger, rawParams }) => {
|
|
26
|
+
const rawAppConfig = rawParams.appConfig;
|
|
27
|
+
if (!rawAppConfig) return (0, _adobe_aio_commerce_lib_core_responses.internalServerError)("Could not find or parse the app.commerce.manifest.json file, is it present and valid?");
|
|
28
|
+
let appConfig = rawAppConfig;
|
|
29
|
+
if (require_validate.hasBusinessConfigSchema(rawAppConfig)) {
|
|
30
|
+
logger.debug("Resolving business config schema...");
|
|
31
|
+
const schema = await (0, _adobe_aio_commerce_lib_config.resolveBusinessConfigSchema)(rawAppConfig.businessConfig.schema, rawParams);
|
|
32
|
+
appConfig = {
|
|
33
|
+
...rawAppConfig,
|
|
34
|
+
businessConfig: {
|
|
35
|
+
...rawAppConfig.businessConfig,
|
|
36
|
+
schema
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
26
40
|
logger.debug("Validating app config...");
|
|
27
|
-
const { appConfig } = rawParams;
|
|
28
41
|
const config = require_validate.validateCommerceAppConfig(appConfig);
|
|
29
42
|
logger.debug("Successfully validated the app config");
|
|
30
43
|
return (0, _adobe_aio_commerce_lib_core_responses.ok)({ body: config });
|
|
@@ -12,18 +12,17 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
16
|
-
import * as _$_adobe_aio_commerce_lib_core_responses0 from "@adobe/aio-commerce-lib-core/responses";
|
|
15
|
+
import { t as CommerceAppConfig } from "../app-CakwxQvs.cjs";
|
|
17
16
|
import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
|
|
18
17
|
|
|
19
18
|
//#region source/actions/app-config.d.ts
|
|
20
19
|
/** Arguments for the runtime action factory. */
|
|
21
20
|
type RuntimeActionFactoryArgs = {
|
|
22
|
-
appConfig:
|
|
21
|
+
appConfig: CommerceAppConfig;
|
|
23
22
|
};
|
|
24
23
|
/** Factory to create the route handler for the `app-config` action. */
|
|
25
24
|
declare const appConfigRuntimeAction: ({
|
|
26
25
|
appConfig
|
|
27
|
-
}: RuntimeActionFactoryArgs) => (params: RuntimeActionParams) => Promise<
|
|
26
|
+
}: RuntimeActionFactoryArgs) => (params: RuntimeActionParams) => Promise<import("@adobe/aio-commerce-lib-core/responses").ActionResponse>;
|
|
28
27
|
//#endregion
|
|
29
28
|
export { appConfigRuntimeAction };
|
|
@@ -13,14 +13,13 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_chunk = require('../chunk-
|
|
17
|
-
const require_router = require('../router-
|
|
18
|
-
const require_schemas = require('../schemas-
|
|
19
|
-
|
|
16
|
+
const require_chunk = require('../chunk-Cozy-1ZF.cjs');
|
|
17
|
+
const require_router = require('../router-BOR7T6qR.cjs');
|
|
18
|
+
const require_schemas = require('../schemas-FngDuIeo.cjs');
|
|
19
|
+
let _adobe_aio_commerce_lib_config = require("@adobe/aio-commerce-lib-config");
|
|
20
20
|
let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
|
|
21
21
|
let valibot = require("valibot");
|
|
22
22
|
valibot = require_chunk.__toESM(valibot, 1);
|
|
23
|
-
let _adobe_aio_commerce_lib_config = require("@adobe/aio-commerce-lib-config");
|
|
24
23
|
|
|
25
24
|
//#region source/actions/config.ts
|
|
26
25
|
const MASKED_PASSWORD_VALUE = "*****";
|
|
@@ -60,19 +59,21 @@ router.get("/", {
|
|
|
60
59
|
}),
|
|
61
60
|
handler: async (req, ctx) => {
|
|
62
61
|
const { logger, rawParams } = ctx;
|
|
63
|
-
const configSchema = rawParams
|
|
64
|
-
logger.debug("Validating configuration schema...");
|
|
65
|
-
const validatedSchema = require_validate.validateCommerceAppConfigDomain(configSchema, "businessConfig.schema");
|
|
62
|
+
const { configSchema: rawConfigSchema } = rawParams;
|
|
66
63
|
const env = req.query.commerceEnv;
|
|
67
|
-
const
|
|
68
|
-
|
|
64
|
+
const envFilteredSchema = env ? filterSchemaByEnv(rawConfigSchema, env) : rawConfigSchema;
|
|
65
|
+
logger.debug("Initializing configuration");
|
|
66
|
+
const { configSchema } = await (0, _adobe_aio_commerce_lib_config.initialize)({
|
|
67
|
+
schema: envFilteredSchema,
|
|
68
|
+
params: rawParams
|
|
69
|
+
});
|
|
69
70
|
const { scopeId } = req.query;
|
|
70
71
|
logger.debug(`Retrieving configuration with scope id: ${scopeId}`);
|
|
71
72
|
const appConfiguration = await (0, _adobe_aio_commerce_lib_config.getConfiguration)((0, _adobe_aio_commerce_lib_config.byScopeId)(scopeId), { encryptionKey: rawParams.AIO_COMMERCE_CONFIG_ENCRYPTION_KEY });
|
|
72
73
|
logger.debug("Masking password values...");
|
|
73
|
-
appConfiguration.config = filterPasswordFields(
|
|
74
|
+
appConfiguration.config = filterPasswordFields(configSchema, appConfiguration.config);
|
|
74
75
|
return (0, _adobe_aio_commerce_lib_core_responses.ok)({ body: {
|
|
75
|
-
schema:
|
|
76
|
+
schema: configSchema,
|
|
76
77
|
values: appConfiguration
|
|
77
78
|
} });
|
|
78
79
|
}
|
|
@@ -92,10 +93,12 @@ router.put("/", {
|
|
|
92
93
|
}),
|
|
93
94
|
handler: async (req, ctx) => {
|
|
94
95
|
const { logger, rawParams } = ctx;
|
|
95
|
-
const { configSchema } = rawParams;
|
|
96
96
|
logger.debug(`Setting configuration with scope id: ${req.body.scopeId}`);
|
|
97
97
|
const { scopeId, config } = req.body;
|
|
98
|
-
(0, _adobe_aio_commerce_lib_config.initialize)({
|
|
98
|
+
const { configSchema } = await (0, _adobe_aio_commerce_lib_config.initialize)({
|
|
99
|
+
schema: rawParams.configSchema,
|
|
100
|
+
params: rawParams
|
|
101
|
+
});
|
|
99
102
|
const result = await (0, _adobe_aio_commerce_lib_config.setConfiguration)({ config: config.filter((item) => item.value !== MASKED_PASSWORD_VALUE) }, (0, _adobe_aio_commerce_lib_config.byScopeId)(scopeId), { encryptionKey: rawParams.AIO_COMMERCE_CONFIG_ENCRYPTION_KEY });
|
|
100
103
|
result.config = filterPasswordFields(configSchema, result.config);
|
|
101
104
|
return (0, _adobe_aio_commerce_lib_core_responses.ok)({
|
|
@@ -122,10 +125,12 @@ router.patch("/", {
|
|
|
122
125
|
}),
|
|
123
126
|
handler: async (req, ctx) => {
|
|
124
127
|
const { logger, rawParams } = ctx;
|
|
125
|
-
const { configSchema } = rawParams;
|
|
126
128
|
logger.debug(`Patching configuration with scope id: ${req.body.scopeId}`);
|
|
127
129
|
const { scopeId, config } = req.body;
|
|
128
|
-
(0, _adobe_aio_commerce_lib_config.initialize)({
|
|
130
|
+
const { configSchema } = await (0, _adobe_aio_commerce_lib_config.initialize)({
|
|
131
|
+
schema: rawParams.configSchema,
|
|
132
|
+
params: rawParams
|
|
133
|
+
});
|
|
129
134
|
const result = await (0, _adobe_aio_commerce_lib_config.setConfiguration)({ config }, (0, _adobe_aio_commerce_lib_config.byScopeId)(scopeId), { encryptionKey: rawParams.AIO_COMMERCE_CONFIG_ENCRYPTION_KEY });
|
|
130
135
|
result.config = filterPasswordFields(configSchema, result.config);
|
|
131
136
|
return (0, _adobe_aio_commerce_lib_core_responses.ok)({
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import * as _$_adobe_aio_commerce_lib_core_responses0 from "@adobe/aio-commerce-lib-core/responses";
|
|
16
15
|
import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
|
|
17
16
|
import { BusinessConfigSchema } from "@adobe/aio-commerce-lib-config";
|
|
18
17
|
|
|
@@ -24,6 +23,6 @@ type ConfigActionFactoryArgs = {
|
|
|
24
23
|
/** Factory to create the route handler for the `config` action. */
|
|
25
24
|
declare const configRuntimeAction: ({
|
|
26
25
|
configSchema
|
|
27
|
-
}: ConfigActionFactoryArgs) => (params: RuntimeActionParams) => Promise<
|
|
26
|
+
}: ConfigActionFactoryArgs) => (params: RuntimeActionParams) => Promise<import("@adobe/aio-commerce-lib-core/responses").ActionResponse>;
|
|
28
27
|
//#endregion
|
|
29
28
|
export { configRuntimeAction };
|
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_chunk = require('../chunk-
|
|
17
|
-
const require_router = require('../router-
|
|
18
|
-
const require_schemas = require('../schemas-
|
|
19
|
-
const
|
|
16
|
+
const require_chunk = require('../chunk-Cozy-1ZF.cjs');
|
|
17
|
+
const require_router = require('../router-BOR7T6qR.cjs');
|
|
18
|
+
const require_schemas = require('../schemas-FngDuIeo.cjs');
|
|
19
|
+
const require_validate = require('../validate-DydOAZha.cjs');
|
|
20
|
+
const require_management = require('../management-Cvsz4VMf.cjs');
|
|
20
21
|
let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
|
|
21
22
|
let valibot = require("valibot");
|
|
22
23
|
valibot = require_chunk.__toESM(valibot, 1);
|
|
@@ -399,8 +400,9 @@ router.post("/", {
|
|
|
399
400
|
}
|
|
400
401
|
logger.debug("Previous installation failed, allowing retry");
|
|
401
402
|
}
|
|
402
|
-
const
|
|
403
|
-
if (!
|
|
403
|
+
const rawAppConfig = rawParams.appConfig;
|
|
404
|
+
if (!rawAppConfig) return (0, _adobe_aio_commerce_lib_core_responses.internalServerError)("Could not find or parse the app.commerce.manifest.json file, is it present and valid?");
|
|
405
|
+
const appConfig = require_validate.validateCommerceAppConfig(rawAppConfig);
|
|
404
406
|
const initialState = require_management.createInitialInstallationState({ config: appConfig });
|
|
405
407
|
logger.debug(`Created initial state: ${initialState.id}`);
|
|
406
408
|
await store.put(getStorageKey(), initialState);
|
|
@@ -434,9 +436,10 @@ router.post("/", {
|
|
|
434
436
|
*/
|
|
435
437
|
router.post("/execution", { handler: async (_req, { logger, rawParams }) => {
|
|
436
438
|
const params = rawParams;
|
|
437
|
-
const { initialState, appConfig, appData, AIO_COMMERCE_API_BASE_URL } = params;
|
|
439
|
+
const { initialState, appConfig: rawAppConfig, appData, AIO_COMMERCE_API_BASE_URL } = params;
|
|
438
440
|
if (!initialState) return (0, _adobe_aio_commerce_lib_core_responses.badRequest)("initialState is required for execution");
|
|
439
|
-
if (!
|
|
441
|
+
if (!rawAppConfig) return (0, _adobe_aio_commerce_lib_core_responses.badRequest)("appConfig is required for execution");
|
|
442
|
+
const appConfig = require_validate.validateCommerceAppConfig(rawAppConfig);
|
|
440
443
|
const store = await createInstallationStore();
|
|
441
444
|
const hooks = createInstallationHooks(store, (msg) => logger.debug(msg));
|
|
442
445
|
const installationContext = buildInstallationContext(params, appConfig, logger);
|
|
@@ -472,8 +475,9 @@ router.post("/validation", {
|
|
|
472
475
|
body: InstallationRequestBodySchema,
|
|
473
476
|
handler: async (req, { logger, rawParams }) => {
|
|
474
477
|
logger.debug("Running pre-installation validation...");
|
|
475
|
-
const
|
|
476
|
-
if (!
|
|
478
|
+
const rawAppConfig = rawParams.appConfig;
|
|
479
|
+
if (!rawAppConfig) return (0, _adobe_aio_commerce_lib_core_responses.internalServerError)("Could not find or parse the app.commerce.manifest.json file, is it present and valid?");
|
|
480
|
+
const appConfig = require_validate.validateCommerceAppConfig(rawAppConfig);
|
|
477
481
|
const { appData, ...params } = buildWorkflowParams(req.body, rawParams);
|
|
478
482
|
const result = await require_management.runValidation({
|
|
479
483
|
validationContext: {
|
|
@@ -511,8 +515,9 @@ router.post("/uninstallation", {
|
|
|
511
515
|
handler: async (req, { logger, rawParams }) => {
|
|
512
516
|
const { appData, commerceBaseUrl } = req.body;
|
|
513
517
|
logger.debug(`Starting uninstallation for app "${appData.projectName}" (workspace: "${appData.workspaceName}", commerce: "${commerceBaseUrl}")`);
|
|
514
|
-
const
|
|
515
|
-
if (!
|
|
518
|
+
const rawAppConfig = rawParams.appConfig;
|
|
519
|
+
if (!rawAppConfig) return (0, _adobe_aio_commerce_lib_core_responses.internalServerError)("Could not find or parse the app.commerce.manifest.json file, is it present and valid?");
|
|
520
|
+
const appConfig = require_validate.validateCommerceAppConfig(rawAppConfig);
|
|
516
521
|
const store = await createUninstallationStore();
|
|
517
522
|
const existingState = await store.get(getStorageKey());
|
|
518
523
|
if (existingState && require_management.isInProgressState(existingState)) {
|
|
@@ -555,9 +560,10 @@ router.post("/uninstallation", {
|
|
|
555
560
|
*/
|
|
556
561
|
router.post("/uninstallation/execution", { handler: async (_req, { logger, rawParams }) => {
|
|
557
562
|
const params = rawParams;
|
|
558
|
-
const { initialState, appConfig, appData, AIO_COMMERCE_API_BASE_URL } = params;
|
|
563
|
+
const { initialState, appConfig: rawAppConfig, appData, AIO_COMMERCE_API_BASE_URL } = params;
|
|
559
564
|
if (!initialState) return (0, _adobe_aio_commerce_lib_core_responses.badRequest)("initialState is required for execution");
|
|
560
|
-
if (!
|
|
565
|
+
if (!rawAppConfig) return (0, _adobe_aio_commerce_lib_core_responses.badRequest)("appConfig is required for execution");
|
|
566
|
+
const appConfig = require_validate.validateCommerceAppConfig(rawAppConfig);
|
|
561
567
|
const store = await createUninstallationStore();
|
|
562
568
|
const hooks = createInstallationHooks(store, (msg) => logger.debug(msg));
|
|
563
569
|
const installationContext = buildInstallationContext(params, appConfig, logger);
|
|
@@ -12,22 +12,21 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { n as CommerceAppConfigOutputModel } from "../app-
|
|
16
|
-
import { o as InstallationContext } from "../step-
|
|
17
|
-
import * as _$_adobe_aio_commerce_lib_core_responses0 from "@adobe/aio-commerce-lib-core/responses";
|
|
15
|
+
import { n as CommerceAppConfigOutputModel, t as CommerceAppConfig } from "../app-CakwxQvs.cjs";
|
|
16
|
+
import { o as InstallationContext } from "../step-CKVE0aJi.cjs";
|
|
18
17
|
import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
|
|
19
18
|
|
|
20
19
|
//#region source/actions/installation.d.ts
|
|
21
20
|
type CustomScriptsLoader = (config: CommerceAppConfigOutputModel, logger: InstallationContext["logger"]) => Record<string, unknown>;
|
|
22
21
|
/** Arguments for the runtime action factory. */
|
|
23
22
|
type RuntimeActionFactoryArgs = {
|
|
24
|
-
appConfig:
|
|
23
|
+
appConfig: CommerceAppConfig;
|
|
25
24
|
customScriptsLoader?: CustomScriptsLoader;
|
|
26
25
|
};
|
|
27
26
|
/** Factory to create the route handler for the `installation` action. */
|
|
28
27
|
declare const installationRuntimeAction: ({
|
|
29
28
|
appConfig,
|
|
30
29
|
customScriptsLoader
|
|
31
|
-
}: RuntimeActionFactoryArgs) => (params: RuntimeActionParams) => Promise<
|
|
30
|
+
}: RuntimeActionFactoryArgs) => (params: RuntimeActionParams) => Promise<import("@adobe/aio-commerce-lib-core/responses").ActionResponse>;
|
|
32
31
|
//#endregion
|
|
33
32
|
export { installationRuntimeAction };
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const
|
|
17
|
-
const require_router = require('../router-CFErodHU.cjs');
|
|
16
|
+
const require_router = require('../router-BOR7T6qR.cjs');
|
|
18
17
|
let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
|
|
19
18
|
|
|
20
19
|
//#region source/actions/registration.ts
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { n as AdminUiSdkRegistration } from "../admin-ui-sdk-
|
|
16
|
-
import * as _$_adobe_aio_commerce_lib_core_responses0 from "@adobe/aio-commerce-lib-core/responses";
|
|
15
|
+
import { n as AdminUiSdkRegistration } from "../admin-ui-sdk-DZZJCrdT.cjs";
|
|
17
16
|
import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
|
|
18
17
|
|
|
19
18
|
//#region source/actions/registration.d.ts
|
|
@@ -28,6 +27,6 @@ type RegistrationActionArgs = {
|
|
|
28
27
|
*/
|
|
29
28
|
declare const registrationRuntimeAction: ({
|
|
30
29
|
registration
|
|
31
|
-
}: RegistrationActionArgs) => (params: RuntimeActionParams) => Promise<
|
|
30
|
+
}: RegistrationActionArgs) => (params: RuntimeActionParams) => Promise<import("@adobe/aio-commerce-lib-core/responses").ActionResponse>;
|
|
32
31
|
//#endregion
|
|
33
32
|
export { registrationRuntimeAction };
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
16
|
-
const require_chunk = require('../chunk-
|
|
17
|
-
const require_router = require('../router-
|
|
18
|
-
const require_schemas = require('../schemas-
|
|
19
|
-
const require_logging = require('../logging-
|
|
16
|
+
const require_chunk = require('../chunk-Cozy-1ZF.cjs');
|
|
17
|
+
const require_router = require('../router-BOR7T6qR.cjs');
|
|
18
|
+
const require_schemas = require('../schemas-FngDuIeo.cjs');
|
|
19
|
+
const require_logging = require('../logging-BVz3weoC.cjs');
|
|
20
|
+
let _adobe_aio_commerce_lib_config = require("@adobe/aio-commerce-lib-config");
|
|
20
21
|
let _adobe_aio_commerce_lib_core_responses = require("@adobe/aio-commerce-lib-core/responses");
|
|
21
22
|
let valibot = require("valibot");
|
|
22
23
|
valibot = require_chunk.__toESM(valibot, 1);
|
|
23
|
-
let _adobe_aio_commerce_lib_config = require("@adobe/aio-commerce-lib-config");
|
|
24
24
|
let _adobe_aio_commerce_lib_api = require("@adobe/aio-commerce-lib-api");
|
|
25
25
|
|
|
26
26
|
//#region source/actions/scope-tree.ts
|
|
@@ -12,11 +12,8 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import * as _$_adobe_aio_commerce_lib_core_responses0 from "@adobe/aio-commerce-lib-core/responses";
|
|
16
|
-
import * as _$_adobe_aio_commerce_lib_core_params0 from "@adobe/aio-commerce-lib-core/params";
|
|
17
|
-
|
|
18
15
|
//#region source/actions/scope-tree.d.ts
|
|
19
16
|
/** The handler method for the `scope-tree` action. */
|
|
20
|
-
declare const scopeTreeRuntimeAction: (args:
|
|
17
|
+
declare const scopeTreeRuntimeAction: (args: import("@adobe/aio-commerce-lib-core/params").RuntimeActionParams) => Promise<import("@adobe/aio-commerce-lib-core/responses").ActionResponse>;
|
|
21
18
|
//#endregion
|
|
22
19
|
export { scopeTreeRuntimeAction };
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { n as CommerceAppConfigOutputModel } from "./app-
|
|
15
|
+
import { n as CommerceAppConfigOutputModel } from "./app-CakwxQvs.cjs";
|
|
16
16
|
import * as v from "valibot";
|
|
17
17
|
//#region source/management/installation/admin-ui-sdk/utils.d.ts
|
|
18
18
|
/** Config type when Admin UI SDK registration is configured. */
|