@adobe/aio-commerce-lib-app 2.1.0-beta-20261029164417 → 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.
Files changed (34) hide show
  1. package/CHANGELOG.md +15 -13
  2. package/dist/cjs/actions/app-config/index.cjs +4 -4
  3. package/dist/cjs/actions/association/index.cjs +1 -1
  4. package/dist/cjs/actions/config/index.cjs +2 -2
  5. package/dist/cjs/actions/installation/index.cjs +88 -100
  6. package/dist/cjs/actions/installation/index.d.cts +1 -1
  7. package/dist/cjs/actions/scope-tree/index.cjs +2 -2
  8. package/dist/cjs/commands/index.cjs +50 -38
  9. package/dist/cjs/config/index.node.cjs +2 -2
  10. package/dist/cjs/config/index.node.d.cts +1 -1
  11. package/dist/cjs/{index-CkejDFwj.d.cts → index-D-Qn-irL.d.cts} +5 -2
  12. package/dist/cjs/{index.node-DtwuUlYL.cjs → index.node-CxdwPrOg.cjs} +2 -2
  13. package/dist/cjs/management/index.cjs +1 -1
  14. package/dist/cjs/management/index.d.cts +1 -1
  15. package/dist/cjs/{management-Cwm3C9g0.cjs → management-C_JQpgVB.cjs} +2 -2
  16. package/dist/cjs/{openapi-XsGx1PMf.cjs → openapi-DFoMdZzI.cjs} +15 -175
  17. package/dist/cjs/{validate-ChXLh7rw.cjs → validate-B0rOILvG.cjs} +14 -1
  18. package/dist/es/actions/app-config/index.mjs +4 -4
  19. package/dist/es/actions/association/index.mjs +1 -1
  20. package/dist/es/actions/config/index.mjs +2 -2
  21. package/dist/es/actions/installation/index.d.mts +1 -1
  22. package/dist/es/actions/installation/index.mjs +88 -100
  23. package/dist/es/actions/scope-tree/index.mjs +2 -2
  24. package/dist/es/commands/index.mjs +49 -37
  25. package/dist/es/config/index.node.d.mts +1 -1
  26. package/dist/es/config/index.node.mjs +2 -2
  27. package/dist/es/{index-DgbSfJG7.d.mts → index-VgCNSlLP.d.mts} +5 -2
  28. package/dist/es/{index.node-D0Tp-i2F.mjs → index.node-C8EXBW94.mjs} +2 -2
  29. package/dist/es/management/index.d.mts +1 -1
  30. package/dist/es/management/index.mjs +1 -1
  31. package/dist/es/{management-DEpo0JN4.mjs → management-DKDR7-fX.mjs} +2 -2
  32. package/dist/es/{openapi-DG5-kOUx.mjs → openapi-E_1RFhAr.mjs} +15 -175
  33. package/dist/es/{validate-Dk9U67PF.mjs → validate-CiJIjyOr.mjs} +9 -2
  34. package/package.json +9 -9
@@ -23,7 +23,7 @@ var info = {
23
23
  "identifier": "Apache-2.0",
24
24
  "name": "Apache-2.0"
25
25
  },
26
- "x-meta": { "packageVersion": "2.0.0" }
26
+ "x-meta": { "packageVersion": "2.1.0" }
27
27
  };
28
28
  var servers = [{ "url": "/" }];
29
29
  var paths = {
@@ -974,12 +974,12 @@ var paths = {
974
974
  "get": {
975
975
  "operationId": "getInstallationState",
976
976
  "summary": "Get Installation State",
977
- "description": "Returns the status of the latest lifecycle attempt, whatever its operation. With `attemptId`, returns the status of that attempt instead, whether it is the latest or an earlier one. With `attemptId` and `operation`, returns that attempt only when it ran that operation. With `operation` alone, returns the latest attempt that ran that operation instead, and `history` lists only the earlier attempts and pending plans of that operation. With `history=true`, also returns the plans of that attempt, the earlier attempts with their plans, and the plans made since the latest attempt. Without a lifecycle attempt, returns the installation record of an older library version, if any, and ignores `history` and `limit`. With `operation` alone, it answers `204` instead when no attempt ran the operation.",
977
+ "description": "Returns the status of the latest lifecycle attempt, whatever its operation. With `attemptId`, returns the status of that attempt instead, whether it is the latest or an earlier one. With `attemptId` and `operation`, returns that attempt only when it ran that operation. With `operation` alone, returns the latest attempt that ran that operation instead. Without a lifecycle attempt, returns the installation record of an older library version, if any. With `operation` alone, it answers `204` instead when no attempt ran the operation.",
978
978
  "parameters": [
979
979
  {
980
980
  "name": "attemptId",
981
981
  "in": "query",
982
- "description": "The attempt to read. With `operation`, the attempt must have run that operation, or the answer is `404`. Cannot be combined with `history` or `limit`.",
982
+ "description": "The attempt to read. With `operation`, the attempt must have run that operation, or the answer is `404`.",
983
983
  "required": false,
984
984
  "schema": {
985
985
  "type": "string",
@@ -989,7 +989,7 @@ var paths = {
989
989
  {
990
990
  "name": "operation",
991
991
  "in": "query",
992
- "description": "Reads the latest attempt that ran this operation, which can be an earlier attempt than the latest one. With `history=true`, `history` and `pendingPlans` list only this operation. With `attemptId`, it only checks that the attempt ran this operation.",
992
+ "description": "Reads the latest attempt that ran this operation, which can be an earlier attempt than the latest one. With `attemptId`, it only checks that the attempt ran this operation.",
993
993
  "required": false,
994
994
  "schema": {
995
995
  "type": "string",
@@ -1000,51 +1000,19 @@ var paths = {
1000
1000
  ]
1001
1001
  }
1002
1002
  },
1003
- {
1004
- "name": "history",
1005
- "in": "query",
1006
- "description": "When `true`, the body also carries `plans`, `history` and `pendingPlans`. Plans carry the full target configuration.",
1007
- "required": false,
1008
- "schema": {
1009
- "type": "string",
1010
- "default": "false",
1011
- "enum": ["true", "false"]
1012
- }
1013
- },
1014
- {
1015
- "name": "limit",
1016
- "in": "query",
1017
- "description": "How many earlier attempts `history` lists at most. Applies only with `history=true`. When omitted, `history` lists every earlier attempt.",
1018
- "required": false,
1019
- "schema": {
1020
- "type": "integer",
1021
- "minimum": 1
1022
- }
1023
- },
1024
1003
  {
1025
1004
  "name": "x-gw-ims-org-id",
1026
1005
  "in": "header",
1027
1006
  "description": "Adobe IMS organization ID that identifies the organization for the request.",
1028
1007
  "required": true,
1029
1008
  "schema": { "type": "string" }
1030
- },
1031
- {
1032
- "name": "x-aio-commerce-installation-invocation-source",
1033
- "in": "header",
1034
- "description": "Identifies the source of the request. When set to `post-app-deploy` and no lifecycle attempt exists, returns `204` instead of an older library version's installation record.",
1035
- "required": false,
1036
- "schema": {
1037
- "type": "string",
1038
- "enum": ["post-app-deploy"]
1039
- }
1040
1009
  }
1041
1010
  ],
1042
1011
  "responses": {
1043
1012
  "200": {
1044
- "description": "The latest lifecycle attempt, the latest one that ran `operation`, or the one named by `attemptId`, with its history on `history=true`, or the installation record of an older library version.",
1013
+ "description": "The latest lifecycle attempt, the latest one that ran `operation`, or the one named by `attemptId`, or the installation record of an older library version.",
1045
1014
  "content": { "application/json": { "schema": { "oneOf": [
1046
1015
  { "$ref": "#/components/schemas/LifecycleAttemptStatus" },
1047
- { "$ref": "#/components/schemas/LifecycleAttemptHistory" },
1048
1016
  { "$ref": "#/components/schemas/InProgressWorkflowState" },
1049
1017
  { "$ref": "#/components/schemas/SucceededWorkflowState" },
1050
1018
  { "$ref": "#/components/schemas/FailedWorkflowState" }
@@ -1052,7 +1020,7 @@ var paths = {
1052
1020
  },
1053
1021
  "204": { "description": "No installation workflow state or lifecycle attempt has been stored yet, or no attempt ran the requested `operation`." },
1054
1022
  "400": {
1055
- "description": "The `attemptId`, `history`, `limit` or `operation` query parameter is invalid, or `attemptId` is combined with `history` or `limit`.",
1023
+ "description": "The `attemptId` or `operation` query parameter is invalid.",
1056
1024
  "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationErrorResponse" } } }
1057
1025
  },
1058
1026
  "401": { "description": "You are not authorized to access this resource. Ensure the IMS token and the x-gw-ims-org-id header are correctly set and valid." },
@@ -1078,15 +1046,6 @@ var paths = {
1078
1046
  "description": "Adobe IMS organization ID that identifies the organization for the request.",
1079
1047
  "required": true,
1080
1048
  "schema": { "type": "string" }
1081
- }, {
1082
- "name": "x-aio-commerce-installation-invocation-source",
1083
- "in": "header",
1084
- "description": "Identifies the source of the request. The generated post-deploy hook sends `post-app-deploy`; when that source is present and the app is not installed, reconciliation returns `409 not-installed` instead of starting a first-time installation.",
1085
- "required": false,
1086
- "schema": {
1087
- "type": "string",
1088
- "enum": ["post-app-deploy"]
1089
- }
1090
1049
  }],
1091
1050
  "requestBody": {
1092
1051
  "required": true,
@@ -1140,7 +1099,7 @@ var paths = {
1140
1099
  "/installation/plan": { "post": {
1141
1100
  "operationId": "planLifecycleOperation",
1142
1101
  "summary": "Plan a Lifecycle Operation",
1143
- "description": "Plans the install or upgrade the installed state calls for, or an uninstallation when `operation` is `uninstall`. Stores it as the pending plan and returns it for review, together with its issues as a validation result. Start it with `POST /installation` and its `id` as `planId`.",
1102
+ "description": "Plans the install or upgrade the installed state calls for, or an uninstallation when `operation` is `uninstall`. An app installed with only business configuration has no baseline, so it plans an upgrade when `installedState` and `installedVersion` are set. Stores it as the pending plan and returns it for review, together with its issues as a validation result. Start it with `POST /installation` and its `id` as `planId`.",
1144
1103
  "parameters": [{
1145
1104
  "name": "x-gw-ims-org-id",
1146
1105
  "in": "header",
@@ -2613,6 +2572,14 @@ var components = {
2613
2572
  "description": "Set to `uninstall` to plan an uninstallation. Without it, `POST /installation/plan` plans the install or upgrade the installed state calls for.",
2614
2573
  "const": "uninstall"
2615
2574
  },
2575
+ "installedState": {
2576
+ "description": "Set to `business-config-only` with `installedVersion` when the app is installed with only business configuration, so it has no lifecycle baseline. `POST /installation/plan` then plans an upgrade instead of an install, and `sourceVersion` is `installedVersion`. Ignored when the app has a baseline.",
2577
+ "const": "business-config-only"
2578
+ },
2579
+ "installedVersion": {
2580
+ "description": "The version stored for the installed app. Used with `installedState`. The plan answers `409` with code `already-current` when it equals `metadata.version`.",
2581
+ "type": "string"
2582
+ },
2616
2583
  "planId": {
2617
2584
  "description": "The id of the pending plan to start. Required by `POST /installation`.",
2618
2585
  "type": "string"
@@ -2740,133 +2707,6 @@ var components = {
2740
2707
  "data"
2741
2708
  ]
2742
2709
  },
2743
- "LifecycleAttemptHistory": {
2744
- "description": "The status of the latest lifecycle attempt with the trail that led to it.",
2745
- "allOf": [{ "$ref": "#/components/schemas/LifecycleAttemptStatus" }, {
2746
- "type": "object",
2747
- "properties": {
2748
- "plans": {
2749
- "description": "The plan the attempt executed, followed by the stored plans it replaced, newest first.",
2750
- "type": "array",
2751
- "items": { "$ref": "#/components/schemas/LifecyclePlan" }
2752
- },
2753
- "history": {
2754
- "description": "Earlier attempts, newest first, each with its own plans. Stops at `limit` attempts or at the first attempt that is no longer stored.",
2755
- "type": "array",
2756
- "items": { "allOf": [{ "$ref": "#/components/schemas/LifecycleAttemptStatus" }, {
2757
- "type": "object",
2758
- "properties": { "plans": {
2759
- "description": "The plan the attempt executed, followed by the stored plans it replaced, newest first.",
2760
- "type": "array",
2761
- "items": { "$ref": "#/components/schemas/LifecyclePlan" }
2762
- } },
2763
- "required": ["plans"]
2764
- }] }
2765
- },
2766
- "pendingPlans": {
2767
- "description": "The pending plan followed by the plans it replaced, newest first. Empty when no plan is pending.",
2768
- "type": "array",
2769
- "items": { "$ref": "#/components/schemas/LifecyclePlan" }
2770
- }
2771
- },
2772
- "required": [
2773
- "plans",
2774
- "history",
2775
- "pendingPlans"
2776
- ]
2777
- }]
2778
- },
2779
- "LifecyclePlan": {
2780
- "description": "A lifecycle plan as stored, with the full target configuration.",
2781
- "type": "object",
2782
- "properties": {
2783
- "id": { "type": "string" },
2784
- "previousPlanId": {
2785
- "description": "The pending plan this plan replaced, or `null` when none was pending.",
2786
- "anyOf": [{ "type": "string" }, { "type": "null" }]
2787
- },
2788
- "operation": {
2789
- "type": "string",
2790
- "enum": [
2791
- "install",
2792
- "upgrade",
2793
- "uninstall"
2794
- ]
2795
- },
2796
- "actionVersion": {
2797
- "description": "Version of the action that made the plan.",
2798
- "type": "string"
2799
- },
2800
- "source": {
2801
- "description": "The state the plan starts from, or `null` when nothing is installed.",
2802
- "anyOf": [{
2803
- "type": "object",
2804
- "properties": {
2805
- "snapshotId": { "type": "string" },
2806
- "appVersion": { "type": "string" }
2807
- },
2808
- "required": ["snapshotId", "appVersion"]
2809
- }, { "type": "null" }]
2810
- },
2811
- "target": {
2812
- "description": "The state the plan leads to, or `null` when the app ends up with nothing installed.",
2813
- "anyOf": [{
2814
- "type": "object",
2815
- "properties": {
2816
- "appVersion": { "type": "string" },
2817
- "config": {
2818
- "type": "object",
2819
- "additionalProperties": true
2820
- }
2821
- },
2822
- "required": ["appVersion", "config"]
2823
- }, { "type": "null" }]
2824
- },
2825
- "domains": {
2826
- "type": "array",
2827
- "items": {
2828
- "type": "object",
2829
- "properties": {
2830
- "path": {
2831
- "type": "array",
2832
- "items": { "type": "string" }
2833
- },
2834
- "operations": {
2835
- "type": "array",
2836
- "items": {
2837
- "type": "object",
2838
- "additionalProperties": true
2839
- }
2840
- },
2841
- "changes": {
2842
- "description": "The items the target config adds, updates or removes compared with the installed config, whatever the live state is. Empty for a plan stored by an older version.",
2843
- "type": "array",
2844
- "items": { "$ref": "#/components/schemas/ResourceChange" }
2845
- }
2846
- },
2847
- "required": [
2848
- "path",
2849
- "operations",
2850
- "changes"
2851
- ]
2852
- }
2853
- },
2854
- "issues": {
2855
- "type": "array",
2856
- "items": { "$ref": "#/components/schemas/PlanningIssue" }
2857
- }
2858
- },
2859
- "required": [
2860
- "id",
2861
- "previousPlanId",
2862
- "operation",
2863
- "actionVersion",
2864
- "source",
2865
- "target",
2866
- "domains",
2867
- "issues"
2868
- ]
2869
- },
2870
2710
  "PlanningIssue": {
2871
2711
  "type": "object",
2872
2712
  "properties": {
@@ -12,8 +12,8 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { t as alphaNumericOrHyphenSchema } from "./schemas-DYMNbFdX.mjs";
16
15
  import { a as hasCustomInstallationSteps, f as AdminUiSchema, i as hasCustomInstallation, l as hasExternalEvents, n as hasWebhooks, o as EventingSchema, p as hasAdminUi, r as InstallationSchema, s as hasCommerceEvents, t as WebhooksSchema } from "./webhooks-CfrYeMy_.mjs";
16
+ import { t as alphaNumericOrHyphenSchema } from "./schemas-DYMNbFdX.mjs";
17
17
  import { RecordedSchemaBusinessConfig, SchemaBusinessConfig } from "@adobe/aio-commerce-lib-config";
18
18
  import { CommerceSdkValidationError } from "@adobe/aio-commerce-lib-core/error";
19
19
  import * as v from "valibot";
@@ -138,6 +138,13 @@ function requiresInstallationFromDomains(domains) {
138
138
  "adminUi"
139
139
  ].some((feature) => domains.has(feature));
140
140
  }
141
+ /**
142
+ * Returns true if the given config requires installation, false otherwise.
143
+ * @param config - The commerce app config to check.
144
+ */
145
+ function requiresInstallation(config) {
146
+ return requiresInstallationFromDomains(getConfigDomains(config));
147
+ }
141
148
 
142
149
  // source/config/lib/validate.ts
143
150
  const commerceAppConfigDomainsSchema = v.picklist(Object.keys(CommerceAppConfigSchemas));
@@ -224,4 +231,4 @@ function validateCommerceAppConfigDomain(config, domain) {
224
231
  return validatedConfig.output;
225
232
  }
226
233
 
227
- export { getConfigDomains as a, hasBusinessConfig as c, CommerceAppConfigSchemas as i, hasBusinessConfigSchema as l, validateCommerceAppConfigDomain as n, hasConfigDomain as o, requiresInstallationFromDomains as r, hasMetadata as s, validateCommerceAppConfig as t };
234
+ export { CommerceAppConfigSchemas as a, hasMetadata as c, requiresInstallationFromDomains as i, hasBusinessConfig as l, validateCommerceAppConfigDomain as n, getConfigDomains as o, requiresInstallation as r, hasConfigDomain as s, validateCommerceAppConfig as t, hasBusinessConfigSchema as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/aio-commerce-lib-app",
3
- "version": "2.1.0-beta-20261029164417",
3
+ "version": "2.1.0",
4
4
  "private": false,
5
5
  "description": "App configuration management library for Adobe Commerce applications",
6
6
  "keywords": [
@@ -92,13 +92,13 @@
92
92
  "README.md"
93
93
  ],
94
94
  "dependencies": {
95
- "@adobe/aio-commerce-lib-admin-ui": "1.2.0-beta-20261029164417",
96
- "@adobe/aio-commerce-lib-api": "1.4.1-beta-20261029164417",
97
- "@adobe/aio-commerce-lib-auth": "1.2.0-beta-20261029164417",
98
- "@adobe/aio-commerce-lib-config": "1.8.1-beta-20261029164417",
99
- "@adobe/aio-commerce-lib-core": "1.3.0-beta-20261029164417",
100
- "@adobe/aio-commerce-lib-events": "1.5.0-beta-20261029164417",
101
- "@adobe/aio-commerce-lib-webhooks": "1.2.3-beta-20261029164417",
95
+ "@adobe/aio-commerce-lib-admin-ui": "1.2.0",
96
+ "@adobe/aio-commerce-lib-api": "1.4.1",
97
+ "@adobe/aio-commerce-lib-auth": "1.2.0",
98
+ "@adobe/aio-commerce-lib-config": "1.8.1",
99
+ "@adobe/aio-commerce-lib-core": "1.3.0",
100
+ "@adobe/aio-commerce-lib-events": "1.5.0",
101
+ "@adobe/aio-commerce-lib-webhooks": "1.2.3",
102
102
  "@adobe/aio-lib-core-config": "^5.0.1",
103
103
  "@adobe/aio-lib-core-logging": "^3.0.2",
104
104
  "@adobe/aio-lib-files": "^4.1.2",
@@ -124,7 +124,7 @@
124
124
  },
125
125
  "devDependencies": {
126
126
  "@adobe/aio-lib-files": "^4.1.2",
127
- "@aio-commerce-sdk/common-utils": "0.2.7-beta-20261029164417",
127
+ "@aio-commerce-sdk/common-utils": "0.2.7",
128
128
  "@aio-commerce-sdk/config-tsdown": "1.0.1",
129
129
  "@aio-commerce-sdk/config-typedoc": "1.0.0",
130
130
  "@aio-commerce-sdk/config-typescript": "1.0.0",