@adobe/aio-commerce-lib-app 2.1.0-beta-20261028171115 → 2.1.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 +15 -13
- package/dist/cjs/actions/app-config/index.cjs +4 -4
- package/dist/cjs/actions/association/index.cjs +1 -1
- package/dist/cjs/actions/config/index.cjs +2 -2
- package/dist/cjs/actions/installation/index.cjs +88 -100
- package/dist/cjs/actions/installation/index.d.cts +1 -1
- package/dist/cjs/actions/scope-tree/index.cjs +2 -2
- package/dist/cjs/commands/index.cjs +48 -35
- package/dist/cjs/config/index.node.cjs +2 -2
- package/dist/cjs/config/index.node.d.cts +1 -1
- package/dist/cjs/{index-CkejDFwj.d.cts → index-D-Qn-irL.d.cts} +5 -2
- package/dist/cjs/{index.node-BVp-SSw8.cjs → index.node-CxdwPrOg.cjs} +1 -1
- package/dist/cjs/management/index.cjs +1 -1
- package/dist/cjs/management/index.d.cts +1 -1
- package/dist/cjs/{management-Cwm3C9g0.cjs → management-C_JQpgVB.cjs} +2 -2
- package/dist/cjs/{openapi-XsGx1PMf.cjs → openapi-DFoMdZzI.cjs} +15 -175
- package/dist/cjs/{validate-ChXLh7rw.cjs → validate-B0rOILvG.cjs} +14 -1
- package/dist/es/actions/app-config/index.mjs +4 -4
- package/dist/es/actions/association/index.mjs +1 -1
- package/dist/es/actions/config/index.mjs +2 -2
- package/dist/es/actions/installation/index.d.mts +1 -1
- package/dist/es/actions/installation/index.mjs +88 -100
- package/dist/es/actions/scope-tree/index.mjs +2 -2
- package/dist/es/commands/index.mjs +49 -36
- package/dist/es/config/index.node.d.mts +1 -1
- package/dist/es/config/index.node.mjs +2 -2
- package/dist/es/{index-DgbSfJG7.d.mts → index-VgCNSlLP.d.mts} +5 -2
- package/dist/es/{index.node-ptUgKLMP.mjs → index.node-C8EXBW94.mjs} +1 -1
- package/dist/es/management/index.d.mts +1 -1
- package/dist/es/management/index.mjs +1 -1
- package/dist/es/{management-DEpo0JN4.mjs → management-DKDR7-fX.mjs} +2 -2
- package/dist/es/{openapi-DG5-kOUx.mjs → openapi-E_1RFhAr.mjs} +15 -175
- package/dist/es/{validate-Dk9U67PF.mjs → validate-CiJIjyOr.mjs} +9 -2
- package/package.json +9 -9
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { n as
|
|
15
|
+
import { n as logger, t as HttpActionRouter } from "../../router-C23GIyGQ.mjs";
|
|
16
16
|
import { r as nonEmptyStringValueSchema } from "../../schemas-DYMNbFdX.mjs";
|
|
17
|
+
import { C as isLeafStep, S as isBranchStep, _ as getAtPath, b as pathsEqual, c as getCustomScriptStepName, d as isInProgressState, f as isSucceededState, g as createWorkflowError, h as createSucceededState, l as isCompletedState, m as createFailedState, o as createRootInstallationStep, p as toValidationResult, v as isStepConfigured, w as callHook, x as setAtPath, y as nowIsoString } from "../../management-DKDR7-fX.mjs";
|
|
18
|
+
import { n as getAssociationData } from "../../repository-BVBp61y9.mjs";
|
|
17
19
|
import { a as hasCustomInstallationSteps } from "../../webhooks-CfrYeMy_.mjs";
|
|
18
|
-
import { t as validateCommerceAppConfig } from "../../validate-
|
|
19
|
-
import { C as isLeafStep, S as isBranchStep, _ as getAtPath, b as pathsEqual, c as getCustomScriptStepName, d as isInProgressState, f as isSucceededState, g as createWorkflowError, h as createSucceededState, l as isCompletedState, m as createFailedState, o as createRootInstallationStep, p as toValidationResult, v as isStepConfigured, w as callHook, x as setAtPath, y as nowIsoString } from "../../management-DEpo0JN4.mjs";
|
|
20
|
-
import { n as logger, t as HttpActionRouter } from "../../router-C23GIyGQ.mjs";
|
|
20
|
+
import { r as requiresInstallation, t as validateCommerceAppConfig } from "../../validate-CiJIjyOr.mjs";
|
|
21
21
|
import { init } from "@adobe/aio-lib-state";
|
|
22
22
|
import { CommerceSdkErrorBase } from "@adobe/aio-commerce-lib-core/error";
|
|
23
23
|
import { resolveImsAuthParams } from "@adobe/aio-commerce-lib-auth";
|
|
@@ -25,7 +25,6 @@ import * as v from "valibot";
|
|
|
25
25
|
import stringify from "safe-stable-stringify";
|
|
26
26
|
import { accepted, badRequest, conflict, internalServerError, noContent, notFound, ok } from "@adobe/aio-commerce-lib-core/responses";
|
|
27
27
|
import { init as init$1 } from "@adobe/aio-lib-files";
|
|
28
|
-
import { getHeader } from "@adobe/aio-commerce-lib-core/headers";
|
|
29
28
|
import openwhisk from "openwhisk";
|
|
30
29
|
|
|
31
30
|
// source/management/common/workflow/execute.ts
|
|
@@ -380,6 +379,8 @@ const AppDataSchema = v.object({
|
|
|
380
379
|
*/
|
|
381
380
|
const LifecycleRequestContextSchema = v.object({
|
|
382
381
|
appData: AppDataSchema,
|
|
382
|
+
installedState: v.optional(v.literal("business-config-only")),
|
|
383
|
+
installedVersion: v.optional(v.string()),
|
|
383
384
|
ioEventsEnv: v.string(),
|
|
384
385
|
ioEventsUrl: v.string(),
|
|
385
386
|
operation: v.optional(v.literal("uninstall")),
|
|
@@ -1020,18 +1021,6 @@ function createLifecyclePlanStore() {
|
|
|
1020
1021
|
const DEFAULT_ACTION_NAME = "app-management/installation";
|
|
1021
1022
|
/** Path of the custom installation steps' data in the lifecycle data. */
|
|
1022
1023
|
const CUSTOM_INSTALLATION_STEPS_PATH = ["installation", "customInstallationSteps"];
|
|
1023
|
-
/** Header used to identify the source of an installation action request. */
|
|
1024
|
-
const INSTALLATION_INVOCATION_SOURCE_HEADER = "x-aio-commerce-installation-invocation-source";
|
|
1025
|
-
/** Invocation source used by the generated post-deploy hook. */
|
|
1026
|
-
const POST_APP_DEPLOY_INVOCATION_SOURCE = "post-app-deploy";
|
|
1027
|
-
/** Returns the declared installation action invocation source, if present. */
|
|
1028
|
-
function getInstallationInvocationSource(headers) {
|
|
1029
|
-
return getHeader(headers, INSTALLATION_INVOCATION_SOURCE_HEADER);
|
|
1030
|
-
}
|
|
1031
|
-
/** Returns whether the request originated from the generated post-deploy hook. */
|
|
1032
|
-
function isPostAppDeployInvocation(headers) {
|
|
1033
|
-
return getInstallationInvocationSource(headers) === POST_APP_DEPLOY_INVOCATION_SOURCE;
|
|
1034
|
-
}
|
|
1035
1024
|
/**
|
|
1036
1025
|
* Merges the runtime params with the request body and the Commerce instance the app is
|
|
1037
1026
|
* associated with. Returns `null` when the app is not associated.
|
|
@@ -1245,8 +1234,8 @@ async function executeLifecycleAttempt(options) {
|
|
|
1245
1234
|
const executionDeadline = Date.parse(options.executionDeadline);
|
|
1246
1235
|
if (!Number.isFinite(executionDeadline) || executionDeadline <= Date.now()) return await failPendingAttempt(options, state, currentAttempt, new InvalidExecutionDeadlineError(options.executionDeadline));
|
|
1247
1236
|
const { source } = currentAttempt.plan;
|
|
1248
|
-
const baseline = source ? await options.snapshotStore.get(source.snapshotId) : null;
|
|
1249
|
-
if (source && !baseline) return await failPendingAttempt(options, state, currentAttempt, new LifecycleBaselineNotFoundError());
|
|
1237
|
+
const baseline = source?.snapshotId ? await options.snapshotStore.get(source.snapshotId) : null;
|
|
1238
|
+
if (source?.snapshotId && !baseline) return await failPendingAttempt(options, state, currentAttempt, new LifecycleBaselineNotFoundError());
|
|
1250
1239
|
const attempt = {
|
|
1251
1240
|
...currentAttempt,
|
|
1252
1241
|
activations: {
|
|
@@ -1424,11 +1413,8 @@ async function planLifecycle(options) {
|
|
|
1424
1413
|
rootStep: options.rootStep,
|
|
1425
1414
|
target
|
|
1426
1415
|
});
|
|
1427
|
-
const issues = isPlannedFromFallback ? [FALLBACK_BASELINE_ISSUE, ...planning.issues] : planning.issues;
|
|
1428
|
-
const source = baseline ?
|
|
1429
|
-
appVersion: baseline.config.metadata.version,
|
|
1430
|
-
snapshotId: baseline.id
|
|
1431
|
-
} : null;
|
|
1416
|
+
const issues = isPlannedFromFallback && requiresInstallation(fallbackBaselineConfig) ? [FALLBACK_BASELINE_ISSUE, ...planning.issues] : planning.issues;
|
|
1417
|
+
const source = getPlanSource(baseline, isPlannedFromFallback && options.operation === "upgrade" ? fallbackBaselineConfig : void 0);
|
|
1432
1418
|
const plan = {
|
|
1433
1419
|
actionVersion: options.actionVersion,
|
|
1434
1420
|
domains: planning.domains,
|
|
@@ -1450,6 +1436,17 @@ async function planLifecycle(options) {
|
|
|
1450
1436
|
planDiff: diffAgainstReviewedPlan(reviewedPlan, plan)
|
|
1451
1437
|
} : result;
|
|
1452
1438
|
}
|
|
1439
|
+
/** The state a plan starts from: the baseline's, a fallback's version without a snapshot, or nothing. */
|
|
1440
|
+
function getPlanSource(baseline, fallbackConfig) {
|
|
1441
|
+
if (baseline) return {
|
|
1442
|
+
appVersion: baseline.config.metadata.version,
|
|
1443
|
+
snapshotId: baseline.id
|
|
1444
|
+
};
|
|
1445
|
+
return fallbackConfig ? {
|
|
1446
|
+
appVersion: fallbackConfig.metadata.version,
|
|
1447
|
+
snapshotId: null
|
|
1448
|
+
} : null;
|
|
1449
|
+
}
|
|
1453
1450
|
/** Returns the pending plan, or throws when it is not the plan with the given id. */
|
|
1454
1451
|
function requirePendingPlan(state, planId) {
|
|
1455
1452
|
const plan = state.pendingPlan;
|
|
@@ -1797,47 +1794,6 @@ async function findLatestAttemptOf(operation, latestAttempt, attemptStore) {
|
|
|
1797
1794
|
return attempt ?? void 0;
|
|
1798
1795
|
}
|
|
1799
1796
|
/**
|
|
1800
|
-
* The status of the latest attempt with the plans it ran and replaced, every earlier attempt
|
|
1801
|
-
* (newest first, each with its own plans) and the plans made since it.
|
|
1802
|
-
*
|
|
1803
|
-
* @param attempt - The latest attempt.
|
|
1804
|
-
* @param pendingPlan - The pending plan, or `null` when none is pending.
|
|
1805
|
-
* @param stores - The attempt and plan stores.
|
|
1806
|
-
* @param limit - How many earlier attempts to read at most. Reads all of them when absent.
|
|
1807
|
-
* @param operation - Lists only the earlier attempts and pending plans of this operation.
|
|
1808
|
-
*/
|
|
1809
|
-
async function toAttemptHistory(attempt, pendingPlan, stores, limit, operation) {
|
|
1810
|
-
const history = [];
|
|
1811
|
-
let previousId = attempt.previousAttemptId;
|
|
1812
|
-
while (previousId && (limit === void 0 || history.length < limit)) {
|
|
1813
|
-
const previous = await stores.attemptStore.get(previousId);
|
|
1814
|
-
if (!previous) break;
|
|
1815
|
-
if (!operation || previous.operation === operation) history.push({
|
|
1816
|
-
...toAttemptStatus(previous),
|
|
1817
|
-
plans: await readPlanChain(previous.plan, stores.planStore)
|
|
1818
|
-
});
|
|
1819
|
-
previousId = previous.previousAttemptId;
|
|
1820
|
-
}
|
|
1821
|
-
return {
|
|
1822
|
-
...toAttemptStatus(attempt),
|
|
1823
|
-
history,
|
|
1824
|
-
pendingPlans: pendingPlan ? (await readPlanChain(pendingPlan, stores.planStore)).filter((plan) => !operation || plan.operation === operation) : [],
|
|
1825
|
-
plans: await readPlanChain(attempt.plan, stores.planStore)
|
|
1826
|
-
};
|
|
1827
|
-
}
|
|
1828
|
-
/** The given plan followed by the stored plans it replaced, newest first, up to the first missing one. */
|
|
1829
|
-
async function readPlanChain(plan, planStore) {
|
|
1830
|
-
const plans = [plan];
|
|
1831
|
-
let previousId = plan.previousPlanId;
|
|
1832
|
-
while (previousId) {
|
|
1833
|
-
const previous = await planStore.get(previousId);
|
|
1834
|
-
if (!previous) break;
|
|
1835
|
-
plans.push(previous);
|
|
1836
|
-
previousId = previous.previousPlanId;
|
|
1837
|
-
}
|
|
1838
|
-
return plans;
|
|
1839
|
-
}
|
|
1840
|
-
/**
|
|
1841
1797
|
* The response for a request that finds another attempt starting or running. Carries that
|
|
1842
1798
|
* attempt's status when it is a lifecycle attempt, so the caller can follow it.
|
|
1843
1799
|
*/
|
|
@@ -1929,6 +1885,7 @@ async function prepareRequest({ body, logger, rawParams }) {
|
|
|
1929
1885
|
actionVersion,
|
|
1930
1886
|
appConfig,
|
|
1931
1887
|
baseline,
|
|
1888
|
+
businessConfigOnlyVersion: body.installedState === "business-config-only" && body.installedVersion ? body.installedVersion : null,
|
|
1932
1889
|
isBaselineMissing,
|
|
1933
1890
|
latestAttempt: state?.latestAttempt ?? null,
|
|
1934
1891
|
params,
|
|
@@ -1948,7 +1905,7 @@ async function planRequestedOperation(args) {
|
|
|
1948
1905
|
if (resolved.kind === "rejected") return resolved.response;
|
|
1949
1906
|
const { operation } = resolved;
|
|
1950
1907
|
const planned = await planOperation({
|
|
1951
|
-
...getPlanInputs(operation, request.appConfig),
|
|
1908
|
+
...getPlanInputs(operation, request.appConfig, request.businessConfigOnlyVersion),
|
|
1952
1909
|
actionVersion: request.actionVersion,
|
|
1953
1910
|
operation,
|
|
1954
1911
|
runtime: request.runtime
|
|
@@ -1958,9 +1915,10 @@ async function planRequestedOperation(args) {
|
|
|
1958
1915
|
}
|
|
1959
1916
|
/**
|
|
1960
1917
|
* Resolves the operation to plan: `uninstall` when asked for, otherwise `upgrade` when a baseline
|
|
1961
|
-
* exists and `install` when not.
|
|
1918
|
+
* exists and `install` when not. An app installed with only business configuration has no baseline
|
|
1919
|
+
* but is installed, so it resolves `upgrade`. Returns the response that refuses it when it cannot be planned.
|
|
1962
1920
|
*/
|
|
1963
|
-
async function resolveOperation({ appConfig, baseline, isBaselineMissing, latestAttempt, runtime }, requested) {
|
|
1921
|
+
async function resolveOperation({ appConfig, baseline, businessConfigOnlyVersion, isBaselineMissing, latestAttempt, runtime }, requested) {
|
|
1964
1922
|
if (!baseline && await isOrchestrationStateUnreadable(runtime.stateStore)) return rejected(conflict({ body: {
|
|
1965
1923
|
code: "unreadable-state",
|
|
1966
1924
|
message: "The stored lifecycle state cannot be read and there is no installation record to rebuild it from. Nothing was planned."
|
|
@@ -1974,7 +1932,11 @@ async function resolveOperation({ appConfig, baseline, isBaselineMissing, latest
|
|
|
1974
1932
|
message: `The latest lifecycle attempt with ID "${latestAttempt.id}" is an uninstall that failed. Retry the uninstall before planning anything else.`
|
|
1975
1933
|
} }));
|
|
1976
1934
|
if (requested === "uninstall") return resolvedUnlessRefused("uninstall", await refuseLegacyUninstall());
|
|
1977
|
-
if (!baseline)
|
|
1935
|
+
if (!baseline) {
|
|
1936
|
+
const refusal = await refuseLegacyInstall();
|
|
1937
|
+
if (!businessConfigOnlyVersion) return resolvedUnlessRefused("install", refusal);
|
|
1938
|
+
return resolvedUnlessRefused("upgrade", refusal ?? refuseRepeatedVersion(businessConfigOnlyVersion, appConfig));
|
|
1939
|
+
}
|
|
1978
1940
|
return resolvedUnlessRefused("upgrade", refuseUpgrade(baseline, appConfig));
|
|
1979
1941
|
}
|
|
1980
1942
|
/** The operation as resolved, or the refusal when there is one. */
|
|
@@ -1985,12 +1947,30 @@ function resolvedUnlessRefused(operation, refusal) {
|
|
|
1985
1947
|
};
|
|
1986
1948
|
}
|
|
1987
1949
|
/** The target and fallback baseline an operation plans with. */
|
|
1988
|
-
function getPlanInputs(operation, appConfig) {
|
|
1989
|
-
|
|
1950
|
+
function getPlanInputs(operation, appConfig, businessConfigOnlyVersion = null) {
|
|
1951
|
+
if (operation === "uninstall") return {
|
|
1990
1952
|
fallbackBaselineConfig: appConfig,
|
|
1991
1953
|
targetConfig: null
|
|
1954
|
+
};
|
|
1955
|
+
return operation === "upgrade" && businessConfigOnlyVersion ? {
|
|
1956
|
+
fallbackBaselineConfig: toBusinessConfigOnlyConfig(appConfig, businessConfigOnlyVersion),
|
|
1957
|
+
targetConfig: appConfig
|
|
1992
1958
|
} : { targetConfig: appConfig };
|
|
1993
1959
|
}
|
|
1960
|
+
/**
|
|
1961
|
+
* The config an app installed with only business configuration has: the target config at the
|
|
1962
|
+
* installed version, without the sections that need installation.
|
|
1963
|
+
*/
|
|
1964
|
+
function toBusinessConfigOnlyConfig(appConfig, installedVersion) {
|
|
1965
|
+
const { adminUi, eventing, installation, webhooks, ...kept } = appConfig;
|
|
1966
|
+
return {
|
|
1967
|
+
...kept,
|
|
1968
|
+
metadata: {
|
|
1969
|
+
...appConfig.metadata,
|
|
1970
|
+
version: installedVersion
|
|
1971
|
+
}
|
|
1972
|
+
};
|
|
1973
|
+
}
|
|
1994
1974
|
/** Refuses an uninstall while an older library version is uninstalling the app. */
|
|
1995
1975
|
async function refuseLegacyUninstall() {
|
|
1996
1976
|
const record = await (await createUninstallationStore()).get(getStorageKey());
|
|
@@ -2009,7 +1989,11 @@ async function refuseLegacyInstall() {
|
|
|
2009
1989
|
/** Refuses an upgrade that changes the app id or keeps the installed version. */
|
|
2010
1990
|
function refuseUpgrade(baseline, appConfig) {
|
|
2011
1991
|
if (baseline.config.metadata.id !== appConfig.metadata.id) return conflict({ body: { message: `The application ID (metadata.id) cannot be changed during an upgrade. Expected "${baseline.config.metadata.id}", received "${appConfig.metadata.id}".` } });
|
|
2012
|
-
|
|
1992
|
+
return refuseRepeatedVersion(baseline.config.metadata.version, appConfig);
|
|
1993
|
+
}
|
|
1994
|
+
/** Refuses an upgrade to the version that is already installed. */
|
|
1995
|
+
function refuseRepeatedVersion(installedVersion, appConfig) {
|
|
1996
|
+
if (installedVersion === appConfig.metadata.version) return conflict({ body: {
|
|
2013
1997
|
code: "already-current",
|
|
2014
1998
|
message: "The app is already on the target version."
|
|
2015
1999
|
} });
|
|
@@ -2059,27 +2043,16 @@ const OperationSchema = v.optional(v.picklist([
|
|
|
2059
2043
|
"upgrade",
|
|
2060
2044
|
"uninstall"
|
|
2061
2045
|
]));
|
|
2062
|
-
/** Query params that read the latest attempt or its history. */
|
|
2063
|
-
const HistoryQuerySchema = v.object({
|
|
2064
|
-
attemptId: v.optional(v.never()),
|
|
2065
|
-
history: v.optional(v.picklist(["true", "false"]), "false"),
|
|
2066
|
-
limit: v.optional(v.pipe(v.string(), v.toNumber(), v.integer(), v.minValue(1))),
|
|
2067
|
-
operation: OperationSchema
|
|
2068
|
-
});
|
|
2069
|
-
/** Query params that read one attempt by id. */
|
|
2070
|
-
const AttemptQuerySchema = v.object({
|
|
2071
|
-
attemptId: v.pipe(v.string(), v.minLength(1)),
|
|
2072
|
-
history: v.optional(v.never()),
|
|
2073
|
-
limit: v.optional(v.never()),
|
|
2074
|
-
operation: OperationSchema
|
|
2075
|
-
});
|
|
2076
2046
|
/**
|
|
2077
2047
|
* Query params of `GET /`. Query values arrive as strings.
|
|
2078
2048
|
*
|
|
2079
2049
|
* Unknown keys are accepted: with an empty query string the router falls back to every other
|
|
2080
2050
|
* action param, such as `appConfig`.
|
|
2081
2051
|
*/
|
|
2082
|
-
const StatusQuerySchema = v.
|
|
2052
|
+
const StatusQuerySchema = v.object({
|
|
2053
|
+
attemptId: v.optional(v.pipe(v.string(), v.minLength(1))),
|
|
2054
|
+
operation: OperationSchema
|
|
2055
|
+
});
|
|
2083
2056
|
|
|
2084
2057
|
// source/actions/installation/start.ts
|
|
2085
2058
|
/**
|
|
@@ -2106,15 +2079,20 @@ async function startPlannedRequest(args) {
|
|
|
2106
2079
|
logger.warn(`Refused to start plan ${planId} because it is not the pending plan (the pending plan is ${pendingPlan?.id ?? "none"}).`);
|
|
2107
2080
|
return stalePlanConflict("The plan is no longer the pending plan. Call POST /plan again and review the new plan.");
|
|
2108
2081
|
}
|
|
2109
|
-
const
|
|
2082
|
+
const businessConfigOnlyVersion = pendingPlan.operation === "upgrade" && pendingPlan.source?.snapshotId === null ? pendingPlan.source.appVersion : null;
|
|
2083
|
+
const resolved = await resolveOperation({
|
|
2084
|
+
...request,
|
|
2085
|
+
businessConfigOnlyVersion
|
|
2086
|
+
}, pendingPlan.operation === "uninstall" ? "uninstall" : void 0);
|
|
2110
2087
|
if (resolved.kind === "rejected") return resolved.response;
|
|
2111
2088
|
const { operation } = resolved;
|
|
2112
2089
|
if (operation !== pendingPlan.operation) {
|
|
2113
2090
|
logger.warn(`Refused to start plan ${planId} because it is for an ${pendingPlan.operation}, but the app now needs an ${operation}.`);
|
|
2114
2091
|
return stalePlanConflict(`The plan is for an ${pendingPlan.operation}, but the app now needs an ${operation}. Call POST /plan again.`);
|
|
2115
2092
|
}
|
|
2093
|
+
if (businessConfigOnlyVersion && !request.baseline && state) await writeBusinessConfigOnlyBaseline(request, state, businessConfigOnlyVersion);
|
|
2116
2094
|
const planned = await planOperation({
|
|
2117
|
-
...getPlanInputs(operation, request.appConfig),
|
|
2095
|
+
...getPlanInputs(operation, request.appConfig, businessConfigOnlyVersion),
|
|
2118
2096
|
actionVersion: request.actionVersion,
|
|
2119
2097
|
operation,
|
|
2120
2098
|
reviewedPlanId: planId,
|
|
@@ -2129,13 +2107,31 @@ async function startPlannedRequest(args) {
|
|
|
2129
2107
|
runtime: request.runtime
|
|
2130
2108
|
});
|
|
2131
2109
|
}
|
|
2110
|
+
/**
|
|
2111
|
+
* Stores the baseline of an app installed with only business configuration: the target config
|
|
2112
|
+
* without what needs installation, at the installed version, with no installed data.
|
|
2113
|
+
*/
|
|
2114
|
+
async function writeBusinessConfigOnlyBaseline({ appConfig, runtime }, state, installedVersion) {
|
|
2115
|
+
const snapshot = {
|
|
2116
|
+
attemptId: null,
|
|
2117
|
+
config: toBusinessConfigOnlyConfig(appConfig, installedVersion),
|
|
2118
|
+
createdAt: nowIsoString(),
|
|
2119
|
+
data: null,
|
|
2120
|
+
id: crypto.randomUUID()
|
|
2121
|
+
};
|
|
2122
|
+
await runtime.snapshotStore.put(snapshot.id, snapshot);
|
|
2123
|
+
await runtime.stateStore.put(CURRENT_STATE_KEY, {
|
|
2124
|
+
...state,
|
|
2125
|
+
baselineSnapshotId: snapshot.id
|
|
2126
|
+
});
|
|
2127
|
+
}
|
|
2132
2128
|
|
|
2133
2129
|
// source/actions/installation/router.ts
|
|
2134
2130
|
/**
|
|
2135
2131
|
* Installation action router.
|
|
2136
2132
|
*
|
|
2137
2133
|
* Routes:
|
|
2138
|
-
* - GET / Get the status of the latest lifecycle operation
|
|
2134
|
+
* - GET / Get the status of the latest lifecycle operation or of one attempt on `attemptId`
|
|
2139
2135
|
* - POST / Start the pending plan named by `planId`
|
|
2140
2136
|
* - POST /plan Plan an install, upgrade or uninstall for review
|
|
2141
2137
|
* - POST /execution Execute a started lifecycle attempt (internal, called async)
|
|
@@ -2149,11 +2145,8 @@ const router = new HttpActionRouter().use(logger({ name: () => "installation" })
|
|
|
2149
2145
|
* and answers 404 when no such attempt exists. With `operation` too, the attempt must have run that
|
|
2150
2146
|
* operation, or the answer is 404.
|
|
2151
2147
|
*
|
|
2152
|
-
* With `
|
|
2153
|
-
*
|
|
2154
|
-
*
|
|
2155
|
-
* With `operation`, the latest attempt is the most recent one that ran that operation, the history
|
|
2156
|
-
* and the plans made since only list that operation, and the answer is 204 when no attempt ran it.
|
|
2148
|
+
* With `operation`, the latest attempt is the most recent one that ran that operation, and the
|
|
2149
|
+
* answer is 204 when no attempt ran it.
|
|
2157
2150
|
*/
|
|
2158
2151
|
router.get("/", {
|
|
2159
2152
|
handler: async (req, { logger }) => {
|
|
@@ -2172,17 +2165,12 @@ router.get("/", {
|
|
|
2172
2165
|
const attempt = operation ? await findLatestAttemptOf(operation, state?.latestAttempt, persistence.attemptStore) : state?.latestAttempt;
|
|
2173
2166
|
if (state && attempt) {
|
|
2174
2167
|
logger.debug(`Found the ${attempt.operation} attempt ${attempt.id} with status ${attempt.status}.`);
|
|
2175
|
-
if (req.query.history === "true") return ok({ body: await toAttemptHistory(attempt, state.pendingPlan, persistence, req.query.limit, operation) });
|
|
2176
2168
|
return ok({ body: toAttemptStatus(attempt) });
|
|
2177
2169
|
}
|
|
2178
2170
|
if (operation) {
|
|
2179
2171
|
logger.debug(`No ${operation} attempt found`);
|
|
2180
2172
|
return noContent();
|
|
2181
2173
|
}
|
|
2182
|
-
if (isPostAppDeployInvocation(req.headers)) {
|
|
2183
|
-
logger.debug("No lifecycle attempt found");
|
|
2184
|
-
return noContent();
|
|
2185
|
-
}
|
|
2186
2174
|
logger.debug("Getting legacy installation status...");
|
|
2187
2175
|
const store = await createInstallationStore();
|
|
2188
2176
|
return readStateFromStore(store, (msg) => logger.debug(msg));
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { n as logger, t as HttpActionRouter } from "../../router-C23GIyGQ.mjs";
|
|
16
16
|
import { t as inspect } from "../../logging-B1xb568A.mjs";
|
|
17
17
|
import { t as LIFECYCLE_HTTP_CLIENT_TIMEOUT_MS } from "../../constants-C-4fesPr.mjs";
|
|
18
|
-
import {
|
|
18
|
+
import { r as nonEmptyStringValueSchema } from "../../schemas-DYMNbFdX.mjs";
|
|
19
19
|
import { resolveCommerceHttpClientParams } from "@adobe/aio-commerce-lib-api";
|
|
20
20
|
import { getScopeTree, setCustomScopeTree, syncCommerceScopes, unsyncCommerceScopes } from "@adobe/aio-commerce-lib-config";
|
|
21
21
|
import { CommerceEnvSchema } from "@adobe/aio-commerce-lib-core/commerce";
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
* governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { r as
|
|
17
|
-
import { t as parseOrThrow } from "../utils-G-EDWmew.mjs";
|
|
18
|
-
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-ptUgKLMP.mjs";
|
|
16
|
+
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-C8EXBW94.mjs";
|
|
19
17
|
import { a as hasCustomInstallationSteps, d as ADMIN_UI_MASS_ACTION_ENTITIES, m as hasBackendUiV2Components, u as ADMIN_UI_GRID_COLUMN_ENTITIES } from "../webhooks-CfrYeMy_.mjs";
|
|
20
|
-
import {
|
|
18
|
+
import { o as getConfigDomains, t as validateCommerceAppConfig, u as hasBusinessConfigSchema } from "../validate-CiJIjyOr.mjs";
|
|
19
|
+
import { t as parseOrThrow } from "../utils-G-EDWmew.mjs";
|
|
20
|
+
import { r as nonEmptyStringValueSchema } from "../schemas-DYMNbFdX.mjs";
|
|
21
21
|
import { t as inspect } from "../logging-B1xb568A.mjs";
|
|
22
22
|
import { hasDynamicSchema } from "@adobe/aio-commerce-lib-config";
|
|
23
23
|
import { CommerceSdkErrorBase, CommerceSdkValidationError, stringifyError } from "@adobe/aio-commerce-lib-core/error";
|
|
@@ -36,7 +36,7 @@ import { tmpdir } from "os";
|
|
|
36
36
|
import net from "net";
|
|
37
37
|
import aioIms from "@adobe/aio-lib-ims";
|
|
38
38
|
import config from "@adobe/aio-lib-core-config";
|
|
39
|
-
import ky, { HTTPError } from "ky";
|
|
39
|
+
import ky, { HTTPError, TimeoutError } from "ky";
|
|
40
40
|
import { HTTP_CONFLICT } from "@adobe/aio-commerce-lib-core/responses";
|
|
41
41
|
import { setTimeout as setTimeout$1 } from "timers/promises";
|
|
42
42
|
import dotenv from "dotenv";
|
|
@@ -357,7 +357,7 @@ const LEADING_DOT_SLASH_PATTERN$1 = /^\.\//u;
|
|
|
357
357
|
const WEB_SOURCE_DEPENDENCIES = [
|
|
358
358
|
{
|
|
359
359
|
name: "@adobe/aio-commerce-lib-admin-ui",
|
|
360
|
-
version: "^1.2.0
|
|
360
|
+
version: "^1.2.0"
|
|
361
361
|
},
|
|
362
362
|
{
|
|
363
363
|
name: "react",
|
|
@@ -1315,6 +1315,7 @@ async function run$8(appConfig, projectRoot) {
|
|
|
1315
1315
|
}
|
|
1316
1316
|
return;
|
|
1317
1317
|
}
|
|
1318
|
+
consola.log("");
|
|
1318
1319
|
consola.info("Generating app manifest...");
|
|
1319
1320
|
const contents = stringify$1(appConfig, null, 2);
|
|
1320
1321
|
const outputDir = await makeOutputDirFor(getGeneratedDir(EXTENSIBILITY_EXTENSION_POINT_ID), projectRoot);
|
|
@@ -1565,6 +1566,39 @@ function getAioCliEnv() {
|
|
|
1565
1566
|
return config.get("cli.env") === "stage" ? "stage" : "prod";
|
|
1566
1567
|
}
|
|
1567
1568
|
|
|
1569
|
+
// source/commands/common/cams/config.ts
|
|
1570
|
+
/** Environment variable that overrides the CAMS base URL. */
|
|
1571
|
+
const CAMS_URL_ENV_VAR = "AIO_COMMERCE_APP_MANAGEMENT_SERVICE_URL";
|
|
1572
|
+
/** Environment variable that selects the AIO CLI environment. */
|
|
1573
|
+
const AIO_CLI_ENV_VAR = "AIO_CLI_ENV";
|
|
1574
|
+
/** The CAMS host for the stage environment. */
|
|
1575
|
+
const STAGE_CAMS_URL = "https://app-management-stage.api.commerce.adobe.com";
|
|
1576
|
+
/** The CAMS host for the production environment. */
|
|
1577
|
+
const PROD_CAMS_URL = "https://app-management.api.commerce.adobe.com";
|
|
1578
|
+
/**
|
|
1579
|
+
* The time in milliseconds a CAMS request may take before it fails with a timeout.
|
|
1580
|
+
*
|
|
1581
|
+
* CAMS calls the app on Adobe I/O Runtime for some requests, for example to plan an upgrade, and a
|
|
1582
|
+
* cold start after a deploy can take longer than ky's 10 second default.
|
|
1583
|
+
*/
|
|
1584
|
+
const CAMS_REQUEST_TIMEOUT_MS = 6e4;
|
|
1585
|
+
const URL_SCHEME_PATTERN = /^[hH][tT][tT][pP][sS]?:\/\//u;
|
|
1586
|
+
/**
|
|
1587
|
+
* Resolves the base URL of the Commerce App Management Service (CAMS).
|
|
1588
|
+
*
|
|
1589
|
+
* The override variable wins. A value without a scheme is read as an https URL.
|
|
1590
|
+
* Otherwise `AIO_CLI_ENV` (`stage` or `prod`) selects the host, falling back to `env`.
|
|
1591
|
+
*
|
|
1592
|
+
* @param env - The configured AIO CLI environment, used when `AIO_CLI_ENV` is unset or unknown.
|
|
1593
|
+
* @param variables - The environment variables to read the override from.
|
|
1594
|
+
*/
|
|
1595
|
+
function resolveCamsBaseUrl(env, variables = process.env) {
|
|
1596
|
+
const override = variables[CAMS_URL_ENV_VAR]?.trim();
|
|
1597
|
+
if (override) return URL_SCHEME_PATTERN.test(override) ? override : `https://${override}`;
|
|
1598
|
+
const cliEnv = variables[AIO_CLI_ENV_VAR]?.trim();
|
|
1599
|
+
return (cliEnv === "stage" || cliEnv === "prod" ? cliEnv : env) === "stage" ? STAGE_CAMS_URL : PROD_CAMS_URL;
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1568
1602
|
// source/commands/common/cams/errors.ts
|
|
1569
1603
|
const HTTP_BAD_GATEWAY = 502;
|
|
1570
1604
|
const HTTP_SERVICE_UNAVAILABLE = 503;
|
|
@@ -1828,32 +1862,6 @@ async function readLatestUpgrade(httpClient, params, fetchOptions) {
|
|
|
1828
1862
|
return await readAndParseBody(AttemptStatusSchema, response);
|
|
1829
1863
|
}
|
|
1830
1864
|
|
|
1831
|
-
// source/commands/common/cams/config.ts
|
|
1832
|
-
/** Environment variable that overrides the CAMS base URL. */
|
|
1833
|
-
const CAMS_URL_ENV_VAR = "AIO_COMMERCE_APP_MANAGEMENT_SERVICE_URL";
|
|
1834
|
-
/** Environment variable that selects the AIO CLI environment. */
|
|
1835
|
-
const AIO_CLI_ENV_VAR = "AIO_CLI_ENV";
|
|
1836
|
-
/** The CAMS host for the stage environment. */
|
|
1837
|
-
const STAGE_CAMS_URL = "https://app-management-stage.api.commerce.adobe.com";
|
|
1838
|
-
/** The CAMS host for the production environment. */
|
|
1839
|
-
const PROD_CAMS_URL = "https://app-management.api.commerce.adobe.com";
|
|
1840
|
-
const URL_SCHEME_PATTERN = /^[hH][tT][tT][pP][sS]?:\/\//u;
|
|
1841
|
-
/**
|
|
1842
|
-
* Resolves the base URL of the Commerce App Management Service (CAMS).
|
|
1843
|
-
*
|
|
1844
|
-
* The override variable wins. A value without a scheme is read as an https URL.
|
|
1845
|
-
* Otherwise `AIO_CLI_ENV` (`stage` or `prod`) selects the host, falling back to `env`.
|
|
1846
|
-
*
|
|
1847
|
-
* @param env - The configured AIO CLI environment, used when `AIO_CLI_ENV` is unset or unknown.
|
|
1848
|
-
* @param variables - The environment variables to read the override from.
|
|
1849
|
-
*/
|
|
1850
|
-
function resolveCamsBaseUrl(env, variables = process.env) {
|
|
1851
|
-
const override = variables[CAMS_URL_ENV_VAR]?.trim();
|
|
1852
|
-
if (override) return URL_SCHEME_PATTERN.test(override) ? override : `https://${override}`;
|
|
1853
|
-
const cliEnv = variables[AIO_CLI_ENV_VAR]?.trim();
|
|
1854
|
-
return (cliEnv === "stage" || cliEnv === "prod" ? cliEnv : env) === "stage" ? STAGE_CAMS_URL : PROD_CAMS_URL;
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
1865
|
// source/commands/common/cams/http-client.ts
|
|
1858
1866
|
/** Header that carries the organization the request is made for. */
|
|
1859
1867
|
const ORG_HEADER = "x-org-id";
|
|
@@ -1924,7 +1932,8 @@ var CamsHttpClient = class {
|
|
|
1924
1932
|
prefixUrl: this.config.baseUrl,
|
|
1925
1933
|
retry: { async shouldRetry({ error }) {
|
|
1926
1934
|
return isRetryable(error);
|
|
1927
|
-
} }
|
|
1935
|
+
} },
|
|
1936
|
+
timeout: CAMS_REQUEST_TIMEOUT_MS
|
|
1928
1937
|
});
|
|
1929
1938
|
this.httpClient = Object.freeze(fetchOptions ? httpClient.extend(fetchOptions) : httpClient);
|
|
1930
1939
|
this.get = this.httpClient.get.bind(this.httpClient);
|
|
@@ -1943,6 +1952,10 @@ var CamsHttpClient = class {
|
|
|
1943
1952
|
async function toCamsError(error) {
|
|
1944
1953
|
if (error instanceof CamsClientError || error instanceof CommerceSdkValidationError) return error;
|
|
1945
1954
|
if (error instanceof HTTPError) return await toCamsResponseError(error);
|
|
1955
|
+
if (error instanceof TimeoutError) return new CamsClientError(`The Commerce App Management Service did not answer within ${CAMS_REQUEST_TIMEOUT_MS / 1e3} seconds`, {
|
|
1956
|
+
cause: error,
|
|
1957
|
+
retryable: true
|
|
1958
|
+
});
|
|
1946
1959
|
return new CamsClientError("The Commerce App Management Service could not be reached", {
|
|
1947
1960
|
cause: error,
|
|
1948
1961
|
retryable: true
|
|
@@ -2561,10 +2574,10 @@ async function syncImsCredentials(projectRoot) {
|
|
|
2561
2574
|
async function run$4(extension, projectRoot, templatesDir = TEMPLATES_DIR) {
|
|
2562
2575
|
if (await ensureExtensionPointsOrder(projectRoot)) consola$1.warn(`The extension points in ${APP_CONFIG_FILE} were reordered (${EXTENSION_POINT_ORDER.join(", ")}) to ensure an upgrade works reliably. This is a one-off change.`);
|
|
2563
2576
|
const appManifest = await loadAppManifest(projectRoot);
|
|
2577
|
+
await run$8(appManifest, projectRoot);
|
|
2564
2578
|
await prepareRuntimeAppConfigModule(appManifest, projectRoot);
|
|
2565
2579
|
if (extension === "extensibility/1") {
|
|
2566
2580
|
const { doc: extensibilityExtConfig } = await readExtConfig(EXTENSIBILITY_EXTENSION_POINT_ID, projectRoot);
|
|
2567
|
-
await run$8(appManifest, projectRoot);
|
|
2568
2581
|
await generateActionFiles(appManifest, getRuntimeActions(extensibilityExtConfig.toJS(), "app-management"), EXTENSIBILITY_EXTENSION_POINT_ID, templatesDir, projectRoot);
|
|
2569
2582
|
consola$1.info("Syncing IMS credentials...");
|
|
2570
2583
|
consola$1.warn("Deprecated: if your actions use AIO_COMMERCE_AUTH_IMS_* inputs for OAuth Server-to-Server credentials, replace them with the `include-ims-credentials: true` action annotation. This hook still syncs legacy credentials for compatibility; that sync will be removed in a future major release.");
|
|
@@ -3006,7 +3019,7 @@ async function ensureAppConfig(domains, config, projectRoot) {
|
|
|
3006
3019
|
*/
|
|
3007
3020
|
function installDependencies(packageManager, domains, projectRoot) {
|
|
3008
3021
|
const packages = [];
|
|
3009
|
-
if (domains.has("businessConfig.schema")) packages.push(`@adobe/aio-commerce-lib-config@^1.8.1
|
|
3022
|
+
if (domains.has("businessConfig.schema")) packages.push(`@adobe/aio-commerce-lib-config@^1.8.1`);
|
|
3010
3023
|
if (packages.length === 0) {
|
|
3011
3024
|
consola.info("No additional domain dependencies to install.");
|
|
3012
3025
|
return;
|
|
@@ -3041,7 +3054,7 @@ async function ensureInstallYaml(domains, config, projectRoot) {
|
|
|
3041
3054
|
}
|
|
3042
3055
|
|
|
3043
3056
|
// source/commands/init/main.ts
|
|
3044
|
-
const REQUIRED_DEPENDENCIES = ["@adobe/aio-commerce-sdk", `@adobe/aio-commerce-lib-app@2.1.0
|
|
3057
|
+
const REQUIRED_DEPENDENCIES = ["@adobe/aio-commerce-sdk", `@adobe/aio-commerce-lib-app@2.1.0`];
|
|
3045
3058
|
/**
|
|
3046
3059
|
* Initializes a Commerce App project.
|
|
3047
3060
|
* @param flags - Non-interactive initialization answers.
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
import { t as defineConfig } from "../define-C95h_wa0.mjs";
|
|
15
16
|
import { a as CommerceAppConfigSchemas, i as CommerceAppConfigDomain, n as CommerceAppConfig, o as getConfigDomains, r as CommerceAppConfigOutputModel, s as hasConfigDomain, t as AnyCommerceAppConfig } from "../app-Ch19CR6g.mjs";
|
|
16
17
|
import { A as AdminUiConfig, B as hasAdminUi, C as ExternalEventSource, D as hasEventing, E as hasCommerceEvents, F as Menu, I as Notifications, L as OrderViewButton, M as GridColumn, N as GridColumns, O as hasExternalEvents, P as MassAction, R as ViewMassAction, S as ExternalEvent, T as ExternalEventsConfig, V as hasBackendUiV2Components, _ as CommerceEventsConfig, a as WebhookRule, b as EventingSchema, c as WebhooksSchema, d as hasCustomInstallation, f as hasCustomInstallationSteps, g as CommerceEventSourceSchema, h as CommerceEventSource, i as WebhookHeader, j as AdminUiConfiguration, l as hasWebhooks, m as CommerceEvent, n as WebhookEntry, o as WebhooksConfig, p as AppEvent, r as WebhookField, s as WebhooksConfiguration, t as WebhookDefinition, v as EventProvider, w as ExternalEventSourceSchema, x as EventsConfig, y as EventingConfiguration, z as WorkerMassAction } from "../webhooks-C9vMZZDZ.mjs";
|
|
17
|
-
import { t as defineConfig } from "../define-C95h_wa0.mjs";
|
|
18
18
|
import "@adobe/aio-commerce-lib-config";
|
|
19
19
|
import * as v from "valibot";
|
|
20
20
|
import { Get } from "type-fest";
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { a as resolveCommerceAppConfig, i as readCommerceAppConfig, n as isTypeScriptConfig, r as parseCommerceAppConfig } from "../index.node-
|
|
15
|
+
import { a as resolveCommerceAppConfig, i as readCommerceAppConfig, n as isTypeScriptConfig, r as parseCommerceAppConfig } from "../index.node-C8EXBW94.mjs";
|
|
16
16
|
import { t as defineConfig } from "../define-BTmPnTba.mjs";
|
|
17
17
|
import { a as hasCustomInstallationSteps, c as hasEventing, i as hasCustomInstallation, l as hasExternalEvents, m as hasBackendUiV2Components, n as hasWebhooks, p as hasAdminUi, s as hasCommerceEvents } from "../webhooks-CfrYeMy_.mjs";
|
|
18
|
-
import { a as
|
|
18
|
+
import { a as CommerceAppConfigSchemas, c as hasMetadata, l as hasBusinessConfig, n as validateCommerceAppConfigDomain, o as getConfigDomains, s as hasConfigDomain, t as validateCommerceAppConfig, u as hasBusinessConfigSchema } from "../validate-CiJIjyOr.mjs";
|
|
19
19
|
|
|
20
20
|
export { CommerceAppConfigSchemas, defineConfig, getConfigDomains, hasAdminUi, hasBackendUiV2Components, hasBusinessConfig, hasBusinessConfigSchema, hasCommerceEvents, hasConfigDomain, hasCustomInstallation, hasCustomInstallationSteps, hasEventing, hasExternalEvents, hasMetadata, hasWebhooks, isTypeScriptConfig, parseCommerceAppConfig, readCommerceAppConfig, resolveCommerceAppConfig, validateCommerceAppConfig, validateCommerceAppConfigDomain };
|
|
@@ -538,8 +538,11 @@ type LifecyclePlan = {
|
|
|
538
538
|
actionVersion: string;
|
|
539
539
|
/** The state the plan transitions from, or `null` when nothing is installed. */
|
|
540
540
|
source: {
|
|
541
|
-
/**
|
|
542
|
-
|
|
541
|
+
/**
|
|
542
|
+
* Identifier of the baseline snapshot, or `null` when the app was installed with only business
|
|
543
|
+
* configuration and has no baseline yet. Starting the plan writes one.
|
|
544
|
+
*/
|
|
545
|
+
snapshotId: string | null;
|
|
543
546
|
/** App version of the baseline. */
|
|
544
547
|
appVersion: string;
|
|
545
548
|
} | null;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { t as validateCommerceAppConfig } from "./validate-
|
|
15
|
+
import { t as validateCommerceAppConfig } from "./validate-CiJIjyOr.mjs";
|
|
16
16
|
import { stringifyError } from "@adobe/aio-commerce-lib-core/error";
|
|
17
17
|
import { existsSync } from "fs";
|
|
18
18
|
import { access, mkdir, readFile } from "fs/promises";
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { $ as defineLeafStep, A as createInitialState, B as BranchStepOptions, C as defineCustomInstallationStep, D as executePlannedWorkflow, E as createInitialPlanExecutionState, F as StepStartedEvent, G as LifecycleContext, H as InferStepOutput, I as StepSucceededEvent, J as StepMeta, K as Step, L as WorkflowHooks, M as executeWorkflow, N as StepEvent, O as ValidateStepTreeOptions, P as StepFailedEvent, Q as defineBranchStep, R as AnyStep, S as CustomInstallationStepHandler, T as planWorkflow, U as LeafStep, V as ExecutionContext, W as LeafStepOptions, X as ValidationContext, Y as StepMetaInfo, Z as ValidationExecutionContext, _ as createInitialUninstallationState, _t as isFailedState, a as InstallationError, at as ValidationResult, b as runValidation, c as InstallationStatus, ct as FailedWorkflowState, d as CreateInitialUninstallationStateOptions, dt as SucceededWorkflowState, et as isBranchStep, f as InstallationHooks, ft as WorkflowData, g as createInitialInstallationState, gt as isCompletedState, h as RunValidationOptions, ht as WorkflowStateMetadata, i as InstallationData, it as ValidationIssueSeverity, j as executeUninstallWorkflow, k as validateStepTree, l as SucceededInstallationState, lt as InProgressWorkflowState, m as RunUninstallationOptions, mt as WorkflowRunState, n as InProgressInstallationState, nt as StepValidationResult, o as InstallationRetryMetadata, ot as ValidationSummary, p as RunInstallationOptions, pt as WorkflowError, q as StepContextFactory, r as InstallationContext, rt as ValidationIssue, s as InstallationState, st as ExecutionStatus, t as FailedInstallationState, tt as isLeafStep, u as CreateInitialInstallationStateOptions, ut as StepStatus, v as runInstallation, vt as isInProgressState, w as createRetryState, x as CustomInstallationStepDefinition, y as runUninstallation, yt as isSucceededState, z as BranchStep } from "../index-
|
|
15
|
+
import { $ as defineLeafStep, A as createInitialState, B as BranchStepOptions, C as defineCustomInstallationStep, D as executePlannedWorkflow, E as createInitialPlanExecutionState, F as StepStartedEvent, G as LifecycleContext, H as InferStepOutput, I as StepSucceededEvent, J as StepMeta, K as Step, L as WorkflowHooks, M as executeWorkflow, N as StepEvent, O as ValidateStepTreeOptions, P as StepFailedEvent, Q as defineBranchStep, R as AnyStep, S as CustomInstallationStepHandler, T as planWorkflow, U as LeafStep, V as ExecutionContext, W as LeafStepOptions, X as ValidationContext, Y as StepMetaInfo, Z as ValidationExecutionContext, _ as createInitialUninstallationState, _t as isFailedState, a as InstallationError, at as ValidationResult, b as runValidation, c as InstallationStatus, ct as FailedWorkflowState, d as CreateInitialUninstallationStateOptions, dt as SucceededWorkflowState, et as isBranchStep, f as InstallationHooks, ft as WorkflowData, g as createInitialInstallationState, gt as isCompletedState, h as RunValidationOptions, ht as WorkflowStateMetadata, i as InstallationData, it as ValidationIssueSeverity, j as executeUninstallWorkflow, k as validateStepTree, l as SucceededInstallationState, lt as InProgressWorkflowState, m as RunUninstallationOptions, mt as WorkflowRunState, n as InProgressInstallationState, nt as StepValidationResult, o as InstallationRetryMetadata, ot as ValidationSummary, p as RunInstallationOptions, pt as WorkflowError, q as StepContextFactory, r as InstallationContext, rt as ValidationIssue, s as InstallationState, st as ExecutionStatus, t as FailedInstallationState, tt as isLeafStep, u as CreateInitialInstallationStateOptions, ut as StepStatus, v as runInstallation, vt as isInProgressState, w as createRetryState, x as CustomInstallationStepDefinition, y as runUninstallation, yt as isSucceededState, z as BranchStep } from "../index-VgCNSlLP.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, d as isInProgressState, f as isSucceededState, i as runUninstallation, l as isCompletedState, n as createInitialUninstallationState, r as runInstallation, s as defineCustomInstallationStep, t as createInitialInstallationState, u as isFailedState } from "../management-
|
|
15
|
+
import { a as runValidation, d as isInProgressState, f as isSucceededState, i as runUninstallation, l as isCompletedState, n as createInitialUninstallationState, r as runInstallation, s as defineCustomInstallationStep, t as createInitialInstallationState, u as isFailedState } from "../management-DKDR7-fX.mjs";
|
|
16
16
|
|
|
17
17
|
export { createInitialInstallationState, createInitialUninstallationState, defineCustomInstallationStep, isCompletedState, isFailedState, isInProgressState, isSucceededState, runInstallation, runUninstallation, runValidation };
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
import { a as hasCustomInstallationSteps, c as hasEventing, d as ADMIN_UI_MASS_ACTION_ENTITIES, l as hasExternalEvents, n as hasWebhooks, p as hasAdminUi, s as hasCommerceEvents, u as ADMIN_UI_GRID_COLUMN_ENTITIES } from "./webhooks-CfrYeMy_.mjs";
|
|
16
|
+
import { t as LIFECYCLE_HTTP_CLIENT_TIMEOUT_MS } from "./constants-C-4fesPr.mjs";
|
|
15
17
|
import { t as parseOrThrow } from "./utils-G-EDWmew.mjs";
|
|
16
18
|
import { i as getInstallCommerceEnv, t as appliesToEnv } from "./environment-DUhU0_9z.mjs";
|
|
17
19
|
import { C as storeEventProviders, S as sanitizeEventingIdentifier, _ as getRegistrationName, a as generateInstanceId, b as makeWorkspaceConfig, c as getCommerceEventingExistingData, d as getLegacyRegistrationName, f as getNamespacedEvent, g as getRegistrationDescription, h as getProviderSnapshots, i as eventCodeOf, l as getIoEventCode, m as getProviderKeyFromInstanceId, n as EVENTS_STORAGE_KEY, o as generateInstanceIdDeprecated, p as getNamespacedNameOfCode, r as EXTERNAL_PROVIDER_TYPE, s as getCommerceEventingConfigurationUpdateParams, t as COMMERCE_PROVIDER_TYPE, u as getIoEventsExistingData, v as groupEventsByRuntimeActions, x as pruneStoredEventProviders, y as isIoProviderProvenOwnedByApp } from "./utils-SOtVo2VW.mjs";
|
|
18
|
-
import { a as hasCustomInstallationSteps, c as hasEventing, d as ADMIN_UI_MASS_ACTION_ENTITIES, l as hasExternalEvents, n as hasWebhooks, p as hasAdminUi, s as hasCommerceEvents, u as ADMIN_UI_GRID_COLUMN_ENTITIES } from "./webhooks-CfrYeMy_.mjs";
|
|
19
20
|
import { t as inspect } from "./logging-B1xb568A.mjs";
|
|
20
|
-
import { t as LIFECYCLE_HTTP_CLIENT_TIMEOUT_MS } from "./constants-C-4fesPr.mjs";
|
|
21
21
|
import { resolveCommerceHttpClientParams, resolveIoEventsHttpClientParams } from "@adobe/aio-commerce-lib-api";
|
|
22
22
|
import { getSystemConfigByKey, setSystemConfigByKey } from "@adobe/aio-commerce-lib-config";
|
|
23
23
|
import { stringifyError } from "@adobe/aio-commerce-lib-core/error";
|