@adobe/aio-commerce-lib-app 2.2.0 → 2.3.0-alpha-20261203134759
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 +44 -1
- package/bin/cli.mjs +22 -1
- package/dist/cjs/actions/app-config/index.cjs +8 -8
- package/dist/cjs/actions/app-config/index.d.cts +2 -2
- package/dist/cjs/actions/association/index.cjs +4 -4
- package/dist/cjs/actions/config/index.cjs +19 -8
- package/dist/cjs/actions/config/index.d.cts +1 -1
- package/dist/cjs/actions/installation/index.cjs +39 -15
- package/dist/cjs/actions/installation/index.d.cts +3 -3
- package/dist/cjs/actions/scope-tree/index.cjs +6 -6
- package/dist/cjs/{app-B3bAEor-.d.cts → app-Cb6-5mKk.d.cts} +637 -45
- package/dist/cjs/config/index.browser.d.cts +1 -1
- package/dist/cjs/config/index.node.cjs +11 -7
- package/dist/cjs/config/index.node.d.cts +150 -14
- package/dist/cjs/{define-eBMdGAq6.d.cts → define-Dk0uzfO9.d.cts} +1 -1
- package/dist/cjs/{commands → deprecated/commands}/index.cjs +1828 -864
- package/dist/cjs/{environment-CW6M76gS.cjs → environment-CaV1hi2-.cjs} +1 -1
- package/dist/cjs/{index-BEeludy0.d.cts → index-Cmxlkzpm.d.cts} +2 -2
- package/dist/cjs/index.cjs +3 -3
- package/dist/cjs/index.d.cts +1 -1
- package/dist/cjs/index.node-QXhLROom.cjs +117 -0
- package/dist/cjs/{logging-Emi7P923.cjs → logging-r-r2bUWO.cjs} +1 -1
- package/dist/cjs/management/index.cjs +1 -1
- package/dist/cjs/management/index.d.cts +1 -1
- package/dist/cjs/{management-5Et1mEUp.cjs → management-BX9sUQw-.cjs} +123 -108
- package/dist/cjs/{openapi-DghfuM8S.cjs → openapi-BaKoO7GY.cjs} +177 -26
- package/dist/cjs/{index.node-9bfp79rs.cjs → parser-XcHKOYKN.cjs} +46 -16
- package/dist/cjs/project/index.cjs +637 -0
- package/dist/cjs/project/index.d.cts +212 -0
- package/dist/cjs/{rolldown-runtime-CoOt0iuZ.cjs → rolldown-runtime-BKfnhsn2.cjs} +4 -4
- package/dist/cjs/{schemas-B6ITl1bG.cjs → schemas-B-jCi6Oz.cjs} +1 -1
- package/dist/cjs/{utils-CoR_PBHz.cjs → utils-CuzJBLgo.cjs} +2 -2
- package/dist/cjs/{utils-DSS0XlXq.cjs → utils-bwFwJcPW.cjs} +1 -1
- package/dist/cjs/{validate-BC3rnRLc.cjs → validate-BumkVjJy.cjs} +22 -6
- package/dist/cjs/{version-5MonNzl5.cjs → version-Bczstmvz.cjs} +3 -3
- package/dist/{es/webhooks-DgaLfP36.d.mts → cjs/webhooks-BBuoVWq_.d.cts} +382 -43
- package/dist/cjs/{webhooks-ZPh2gVb3.cjs → webhooks-VZTBeI8L.cjs} +84 -23
- package/dist/es/actions/app-config/index.d.mts +2 -2
- package/dist/es/actions/app-config/index.mjs +6 -6
- package/dist/es/actions/association/index.mjs +3 -3
- package/dist/es/actions/config/index.d.mts +2 -2
- package/dist/es/actions/config/index.mjs +19 -8
- package/dist/es/actions/installation/index.d.mts +4 -4
- package/dist/es/actions/installation/index.mjs +38 -14
- package/dist/es/actions/scope-tree/index.mjs +5 -5
- package/dist/es/{app-B3bAEor-.d.mts → app-Cb6-5mKk.d.mts} +637 -45
- package/dist/es/config/index.browser.d.mts +1 -1
- package/dist/es/config/index.node.d.mts +151 -15
- package/dist/es/config/index.node.mjs +5 -4
- package/dist/es/{define-BdXyLAwb.d.mts → define-D7EjSr-Z.d.mts} +1 -1
- package/dist/es/{commands → deprecated/commands}/index.mjs +1773 -807
- package/dist/es/{environment-DUhU0_9z.mjs → environment-B1JJFHZw.mjs} +1 -1
- package/dist/es/{index-DE2KVXfH.d.mts → index-BkqV8WU_.d.mts} +4 -4
- package/dist/es/{index-DUJtT78x.d.mts → index-U7CXicoW.d.mts} +1 -1
- package/dist/es/index.d.mts +2 -2
- package/dist/es/index.mjs +3 -3
- package/dist/es/index.node-DipCrOq_.mjs +112 -0
- package/dist/es/management/index.d.mts +1 -1
- package/dist/es/management/index.mjs +1 -1
- package/dist/es/{management-BAQ64OyR.mjs → management-DSu69_ub.mjs} +128 -113
- package/dist/es/{openapi-BvPVTUMt.mjs → openapi-ChihLuvm.mjs} +177 -26
- package/dist/es/{index.node-CURztkP5.mjs → parser-DdhiGXVf.mjs} +33 -15
- package/dist/es/project/index.d.mts +212 -0
- package/dist/es/project/index.mjs +636 -0
- package/dist/es/{utils-DB8HaSj0.mjs → utils-Bg_LIAGV.mjs} +2 -2
- package/dist/es/{validate-xS9Dc-4m.mjs → validate-CYWj7Nzp.mjs} +10 -6
- package/dist/es/{version-BWgrh_QM.mjs → version-CVSRkbJP.mjs} +1 -1
- package/dist/es/{webhooks-HBe_DEKA.mjs → webhooks-Ba-OdU8e.mjs} +76 -21
- package/dist/{cjs/webhooks-DNLuuv9_.d.cts → es/webhooks-Deujdgcm.d.mts} +382 -43
- package/package.json +29 -24
- /package/dist/cjs/{commands → deprecated/commands}/index.d.cts +0 -0
- /package/dist/cjs/{commands → deprecated/commands}/templates/typescript/webpack-config.cjs +0 -0
- /package/dist/cjs/{commands → project}/templates/admin-ui/tsconfig.json +0 -0
- /package/dist/cjs/{commands → project}/templates/admin-ui/web-src/.babelrc +0 -0
- /package/dist/cjs/{commands → project}/templates/admin-ui/web-src/index.css +0 -0
- /package/dist/cjs/{commands → project}/templates/admin-ui/web-src/index.html +0 -0
- /package/dist/cjs/{commands → project}/templates/admin-ui/web-src/src/app.jsx +0 -0
- /package/dist/cjs/{commands → project}/templates/admin-ui/web-src/src/components/welcome.jsx +0 -0
- /package/dist/cjs/{commands → project}/templates/admin-ui/web-src/src/pages/main-page.jsx +0 -0
- /package/dist/cjs/{commands → project}/templates/admin-ui/web-src-template.d.ts +0 -0
- /package/dist/cjs/{commands → project}/templates/app-management/app-config.js.template +0 -0
- /package/dist/cjs/{commands → project}/templates/app-management/association.js.template +0 -0
- /package/dist/cjs/{commands → project}/templates/app-management/custom-scripts.js.template +0 -0
- /package/dist/cjs/{commands → project}/templates/app-management/installation.js.template +0 -0
- /package/dist/cjs/{commands → project}/templates/business-configuration/config.js.template +0 -0
- /package/dist/cjs/{commands → project}/templates/business-configuration/scope-tree.js.template +0 -0
- /package/dist/es/{commands → deprecated/commands}/index.d.mts +0 -0
- /package/dist/es/{commands → deprecated/commands}/templates/typescript/webpack-config.cjs +0 -0
- /package/dist/es/{commands → project}/templates/admin-ui/tsconfig.json +0 -0
- /package/dist/es/{commands → project}/templates/admin-ui/web-src/.babelrc +0 -0
- /package/dist/es/{commands → project}/templates/admin-ui/web-src/index.css +0 -0
- /package/dist/es/{commands → project}/templates/admin-ui/web-src/index.html +0 -0
- /package/dist/es/{commands → project}/templates/admin-ui/web-src/src/app.jsx +0 -0
- /package/dist/es/{commands → project}/templates/admin-ui/web-src/src/components/welcome.jsx +0 -0
- /package/dist/es/{commands → project}/templates/admin-ui/web-src/src/pages/main-page.jsx +0 -0
- /package/dist/es/{commands → project}/templates/admin-ui/web-src-template.d.ts +0 -0
- /package/dist/es/{commands → project}/templates/app-management/app-config.js.template +0 -0
- /package/dist/es/{commands → project}/templates/app-management/association.js.template +0 -0
- /package/dist/es/{commands → project}/templates/app-management/custom-scripts.js.template +0 -0
- /package/dist/es/{commands → project}/templates/app-management/installation.js.template +0 -0
- /package/dist/es/{commands → project}/templates/business-configuration/config.js.template +0 -0
- /package/dist/es/{commands → project}/templates/business-configuration/scope-tree.js.template +0 -0
|
@@ -0,0 +1,212 @@
|
|
|
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
|
+
/**
|
|
16
|
+
* Describes what an Adobe Commerce app project needs from its files to work with this version of
|
|
17
|
+
* the library. Tools such as the `aio commerce app` CLI plugin read the description and update the
|
|
18
|
+
* project.
|
|
19
|
+
*
|
|
20
|
+
* @packageDocumentation
|
|
21
|
+
*/
|
|
22
|
+
import { r as CommerceAppConfigOutputModel } from "../app-Cb6-5mKk.mjs";
|
|
23
|
+
/** Where the app config comes from. */
|
|
24
|
+
type ConfigSource = {
|
|
25
|
+
/** Path of the `app.commerce.config.*` file, relative to the project root. */
|
|
26
|
+
path: string;
|
|
27
|
+
/** Whether the config module has named exports besides its default export. */
|
|
28
|
+
hasNamedExports: boolean;
|
|
29
|
+
};
|
|
30
|
+
/** What a project needs to work with this version of lib-app, as a function of its app config. */
|
|
31
|
+
type ProjectDescription = {
|
|
32
|
+
/** The files lib-app writes, scaffolds or removes. */
|
|
33
|
+
files: ProjectFiles;
|
|
34
|
+
/**
|
|
35
|
+
* The Commerce extension points the project needs, in the order `app.config.yaml` must list
|
|
36
|
+
* them.
|
|
37
|
+
*/
|
|
38
|
+
extensions: ExtensionNeeds[];
|
|
39
|
+
/** What the project's `package.json` needs. */
|
|
40
|
+
package: PackageNeeds;
|
|
41
|
+
/**
|
|
42
|
+
* Runtime actions the config references and the user writes. They must exist, but a sync can't
|
|
43
|
+
* create them.
|
|
44
|
+
*/
|
|
45
|
+
actionReferences: ActionReference[];
|
|
46
|
+
/**
|
|
47
|
+
* Commands containing one of these strings are removed from every hook of every extension point
|
|
48
|
+
* in `app.config.yaml`, including those the project no longer needs.
|
|
49
|
+
*/
|
|
50
|
+
obsoleteHookCommands: string[];
|
|
51
|
+
/**
|
|
52
|
+
* Whether the project's actions are TypeScript, so App Builder's webpack build must compile `.ts`
|
|
53
|
+
* files.
|
|
54
|
+
*/
|
|
55
|
+
typeScriptActions: boolean;
|
|
56
|
+
/** Work that follows writing the files. */
|
|
57
|
+
after: AfterSync;
|
|
58
|
+
};
|
|
59
|
+
/** Files lib-app writes or removes. Paths are relative to the project root. */
|
|
60
|
+
type ProjectFiles = {
|
|
61
|
+
/** Files lib-app owns, with their full content. They are overwritten on every sync. */
|
|
62
|
+
generated: Record<string, string>;
|
|
63
|
+
/** Files created only when they don't exist yet. */
|
|
64
|
+
scaffolds: Scaffold[];
|
|
65
|
+
/** Files that must no longer exist. */
|
|
66
|
+
obsolete: string[];
|
|
67
|
+
};
|
|
68
|
+
/** A group of files created together. */
|
|
69
|
+
type Scaffold = {
|
|
70
|
+
/** The files and their content. Each one is created only when it doesn't exist. */
|
|
71
|
+
files: Record<string, string>;
|
|
72
|
+
/** The group is skipped when any of these paths exists. */
|
|
73
|
+
unlessExists?: string[];
|
|
74
|
+
/** What the package needs when any file of the group is created. */
|
|
75
|
+
package?: PackageNeeds;
|
|
76
|
+
};
|
|
77
|
+
/** What an extension point needs in `app.config.yaml`, `install.yaml` and its `ext.config.yaml`. */
|
|
78
|
+
type ExtensionNeeds = {
|
|
79
|
+
/** The extension point id, such as `commerce/extensibility/1`. */
|
|
80
|
+
extensionPointId: string;
|
|
81
|
+
/** Path of the extension point's `ext.config.yaml`, relative to the project root. */
|
|
82
|
+
extConfigPath: string;
|
|
83
|
+
/** Commands each hook must run. They join any other commands of the hook with `&&`. */
|
|
84
|
+
hooks: Record<string, string>;
|
|
85
|
+
/** The `web` folder. An existing value wins. */
|
|
86
|
+
web?: string;
|
|
87
|
+
/** The exact list of `workerProcess` action implementations. */
|
|
88
|
+
workerProcess: string[];
|
|
89
|
+
/** The `view` web implementations, used only when the extension point has none. */
|
|
90
|
+
view: string[];
|
|
91
|
+
/** Runtime packages lib-app owns. A sync replaces each package's `actions` map. */
|
|
92
|
+
packages: Record<string, RuntimePackageNeeds>;
|
|
93
|
+
/**
|
|
94
|
+
* Action inputs to remove from the `ext.config.yaml`. With a `value`, only an input with that
|
|
95
|
+
* value is removed.
|
|
96
|
+
*/
|
|
97
|
+
obsoleteInputs: ObsoleteInput[];
|
|
98
|
+
};
|
|
99
|
+
/** A runtime package in an `ext.config.yaml`. */
|
|
100
|
+
type RuntimePackageNeeds = {
|
|
101
|
+
/** The package's license, as an SPDX id. */
|
|
102
|
+
license: string;
|
|
103
|
+
/** Inputs the package must have. Other inputs stay. */
|
|
104
|
+
inputs: Record<string, string>;
|
|
105
|
+
/** The package's actions, by name. They replace the package's `actions` map. */
|
|
106
|
+
actions: Record<string, ActionNeeds>;
|
|
107
|
+
};
|
|
108
|
+
/** A runtime action lib-app owns. */
|
|
109
|
+
type ActionNeeds = {
|
|
110
|
+
/** The action's file, relative to the `ext.config.yaml`. */
|
|
111
|
+
function: string;
|
|
112
|
+
/** The action is always a web action. */
|
|
113
|
+
web: "yes";
|
|
114
|
+
/** The action's annotations, such as `require-adobe-auth`. */
|
|
115
|
+
annotations: Record<string, boolean>;
|
|
116
|
+
/** Inputs the action must have. Other inputs the user added stay. */
|
|
117
|
+
inputs: Record<string, string>;
|
|
118
|
+
/** The action's limits. The timeout is in milliseconds. */
|
|
119
|
+
limits?: {
|
|
120
|
+
timeout: number;
|
|
121
|
+
};
|
|
122
|
+
/** Values used only when the action has none. */
|
|
123
|
+
defaults: {
|
|
124
|
+
runtime: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
/** An action input that must no longer exist. */
|
|
128
|
+
type ObsoleteInput = {
|
|
129
|
+
/** The action, as `<package>/<action>`. */
|
|
130
|
+
action: string;
|
|
131
|
+
/** The input's name. */
|
|
132
|
+
input: string;
|
|
133
|
+
/** Remove the input only when it has this value. */
|
|
134
|
+
value?: string;
|
|
135
|
+
};
|
|
136
|
+
/** What the project's `package.json` needs. */
|
|
137
|
+
type PackageNeeds = {
|
|
138
|
+
/** Entries `imports` must have. */
|
|
139
|
+
imports?: Record<string, string>;
|
|
140
|
+
/**
|
|
141
|
+
* Scripts the project needs. A script that is `partOf` another runs from it as
|
|
142
|
+
* `<package manager> run <name>`.
|
|
143
|
+
*/
|
|
144
|
+
scripts?: PackageScript[];
|
|
145
|
+
/**
|
|
146
|
+
* Packages that must be declared and installed at a matching version, unless the project already
|
|
147
|
+
* declares them.
|
|
148
|
+
*/
|
|
149
|
+
dependencies?: Record<string, string>;
|
|
150
|
+
/** As `dependencies`, for `devDependencies`. */
|
|
151
|
+
devDependencies?: Record<string, string>;
|
|
152
|
+
/** Values `package.json` must have at a key path. */
|
|
153
|
+
fields?: {
|
|
154
|
+
path: string[];
|
|
155
|
+
value: unknown;
|
|
156
|
+
}[];
|
|
157
|
+
};
|
|
158
|
+
/** A `package.json` script. */
|
|
159
|
+
type PackageScript = {
|
|
160
|
+
/** The script's name under `scripts`. */
|
|
161
|
+
name: string;
|
|
162
|
+
/** The command the script runs. */
|
|
163
|
+
command: string;
|
|
164
|
+
/** The script this one runs from, as `<package manager> run <name>`. */
|
|
165
|
+
partOf?: "typecheck";
|
|
166
|
+
};
|
|
167
|
+
/** A runtime action the config references. */
|
|
168
|
+
type ActionReference = {
|
|
169
|
+
/** The action, as `<package>/<action>`. */
|
|
170
|
+
action: string;
|
|
171
|
+
/** The extension point whose `ext.config.yaml` must declare it. */
|
|
172
|
+
extensionPointId: string;
|
|
173
|
+
/** Where the config references it, such as `webhooks.0.runtimeAction`. */
|
|
174
|
+
configPath: string;
|
|
175
|
+
/** Whether the action must be a web action. */
|
|
176
|
+
web: boolean;
|
|
177
|
+
};
|
|
178
|
+
/** Work that follows writing the files. */
|
|
179
|
+
type AfterSync = {
|
|
180
|
+
/**
|
|
181
|
+
* Bundle the TypeScript app config into the module the generated actions import. Paths are
|
|
182
|
+
* relative to the project root. The runtime needs an ESM bundle for the `node` platform with
|
|
183
|
+
* `node22` as the target, and every package kept external.
|
|
184
|
+
*/
|
|
185
|
+
bundleAppConfig?: {
|
|
186
|
+
entry: string;
|
|
187
|
+
outfile: string;
|
|
188
|
+
};
|
|
189
|
+
/** Validate `AIO_COMMERCE_CONFIG_ENCRYPTION_KEY`, or create it when it is missing. */
|
|
190
|
+
encryptionKey: boolean;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Describes what a project needs to work with this version of lib-app: the files lib-app owns, the
|
|
194
|
+
* extension points and their `ext.config.yaml` entries, and what `package.json` needs. The result
|
|
195
|
+
* depends only on the arguments.
|
|
196
|
+
*
|
|
197
|
+
* @param config - The validated app config.
|
|
198
|
+
* @param source - Where the app config comes from.
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```ts
|
|
202
|
+
* import { hasNamedCommerceAppConfigExports, parseCommerceAppConfig } from "@adobe/aio-commerce-lib-app/config";
|
|
203
|
+
* import { describeProject } from "@adobe/aio-commerce-lib-app/project";
|
|
204
|
+
*
|
|
205
|
+
* const description = describeProject(await parseCommerceAppConfig(root), {
|
|
206
|
+
* path: "app.commerce.config.ts",
|
|
207
|
+
* hasNamedExports: await hasNamedCommerceAppConfigExports(root),
|
|
208
|
+
* });
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
export declare function describeProject(config: CommerceAppConfigOutputModel, source: ConfigSource): ProjectDescription;
|
|
212
|
+
export type { ActionNeeds, ActionReference, AfterSync, ConfigSource, ExtensionNeeds, ObsoleteInput, PackageNeeds, PackageScript, ProjectDescription, ProjectFiles, RuntimePackageNeeds, Scaffold };
|