@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.
Files changed (102) hide show
  1. package/CHANGELOG.md +44 -1
  2. package/bin/cli.mjs +22 -1
  3. package/dist/cjs/actions/app-config/index.cjs +8 -8
  4. package/dist/cjs/actions/app-config/index.d.cts +2 -2
  5. package/dist/cjs/actions/association/index.cjs +4 -4
  6. package/dist/cjs/actions/config/index.cjs +19 -8
  7. package/dist/cjs/actions/config/index.d.cts +1 -1
  8. package/dist/cjs/actions/installation/index.cjs +39 -15
  9. package/dist/cjs/actions/installation/index.d.cts +3 -3
  10. package/dist/cjs/actions/scope-tree/index.cjs +6 -6
  11. package/dist/cjs/{app-B3bAEor-.d.cts → app-Cb6-5mKk.d.cts} +637 -45
  12. package/dist/cjs/config/index.browser.d.cts +1 -1
  13. package/dist/cjs/config/index.node.cjs +11 -7
  14. package/dist/cjs/config/index.node.d.cts +150 -14
  15. package/dist/cjs/{define-eBMdGAq6.d.cts → define-Dk0uzfO9.d.cts} +1 -1
  16. package/dist/cjs/{commands → deprecated/commands}/index.cjs +1828 -864
  17. package/dist/cjs/{environment-CW6M76gS.cjs → environment-CaV1hi2-.cjs} +1 -1
  18. package/dist/cjs/{index-BEeludy0.d.cts → index-Cmxlkzpm.d.cts} +2 -2
  19. package/dist/cjs/index.cjs +3 -3
  20. package/dist/cjs/index.d.cts +1 -1
  21. package/dist/cjs/index.node-QXhLROom.cjs +117 -0
  22. package/dist/cjs/{logging-Emi7P923.cjs → logging-r-r2bUWO.cjs} +1 -1
  23. package/dist/cjs/management/index.cjs +1 -1
  24. package/dist/cjs/management/index.d.cts +1 -1
  25. package/dist/cjs/{management-5Et1mEUp.cjs → management-BX9sUQw-.cjs} +123 -108
  26. package/dist/cjs/{openapi-DghfuM8S.cjs → openapi-BaKoO7GY.cjs} +177 -26
  27. package/dist/cjs/{index.node-9bfp79rs.cjs → parser-XcHKOYKN.cjs} +46 -16
  28. package/dist/cjs/project/index.cjs +637 -0
  29. package/dist/cjs/project/index.d.cts +212 -0
  30. package/dist/cjs/{rolldown-runtime-CoOt0iuZ.cjs → rolldown-runtime-BKfnhsn2.cjs} +4 -4
  31. package/dist/cjs/{schemas-B6ITl1bG.cjs → schemas-B-jCi6Oz.cjs} +1 -1
  32. package/dist/cjs/{utils-CoR_PBHz.cjs → utils-CuzJBLgo.cjs} +2 -2
  33. package/dist/cjs/{utils-DSS0XlXq.cjs → utils-bwFwJcPW.cjs} +1 -1
  34. package/dist/cjs/{validate-BC3rnRLc.cjs → validate-BumkVjJy.cjs} +22 -6
  35. package/dist/cjs/{version-5MonNzl5.cjs → version-Bczstmvz.cjs} +3 -3
  36. package/dist/{es/webhooks-DgaLfP36.d.mts → cjs/webhooks-BBuoVWq_.d.cts} +382 -43
  37. package/dist/cjs/{webhooks-ZPh2gVb3.cjs → webhooks-VZTBeI8L.cjs} +84 -23
  38. package/dist/es/actions/app-config/index.d.mts +2 -2
  39. package/dist/es/actions/app-config/index.mjs +6 -6
  40. package/dist/es/actions/association/index.mjs +3 -3
  41. package/dist/es/actions/config/index.d.mts +2 -2
  42. package/dist/es/actions/config/index.mjs +19 -8
  43. package/dist/es/actions/installation/index.d.mts +4 -4
  44. package/dist/es/actions/installation/index.mjs +38 -14
  45. package/dist/es/actions/scope-tree/index.mjs +5 -5
  46. package/dist/es/{app-B3bAEor-.d.mts → app-Cb6-5mKk.d.mts} +637 -45
  47. package/dist/es/config/index.browser.d.mts +1 -1
  48. package/dist/es/config/index.node.d.mts +151 -15
  49. package/dist/es/config/index.node.mjs +5 -4
  50. package/dist/es/{define-BdXyLAwb.d.mts → define-D7EjSr-Z.d.mts} +1 -1
  51. package/dist/es/{commands → deprecated/commands}/index.mjs +1773 -807
  52. package/dist/es/{environment-DUhU0_9z.mjs → environment-B1JJFHZw.mjs} +1 -1
  53. package/dist/es/{index-DE2KVXfH.d.mts → index-BkqV8WU_.d.mts} +4 -4
  54. package/dist/es/{index-DUJtT78x.d.mts → index-U7CXicoW.d.mts} +1 -1
  55. package/dist/es/index.d.mts +2 -2
  56. package/dist/es/index.mjs +3 -3
  57. package/dist/es/index.node-DipCrOq_.mjs +112 -0
  58. package/dist/es/management/index.d.mts +1 -1
  59. package/dist/es/management/index.mjs +1 -1
  60. package/dist/es/{management-BAQ64OyR.mjs → management-DSu69_ub.mjs} +128 -113
  61. package/dist/es/{openapi-BvPVTUMt.mjs → openapi-ChihLuvm.mjs} +177 -26
  62. package/dist/es/{index.node-CURztkP5.mjs → parser-DdhiGXVf.mjs} +33 -15
  63. package/dist/es/project/index.d.mts +212 -0
  64. package/dist/es/project/index.mjs +636 -0
  65. package/dist/es/{utils-DB8HaSj0.mjs → utils-Bg_LIAGV.mjs} +2 -2
  66. package/dist/es/{validate-xS9Dc-4m.mjs → validate-CYWj7Nzp.mjs} +10 -6
  67. package/dist/es/{version-BWgrh_QM.mjs → version-CVSRkbJP.mjs} +1 -1
  68. package/dist/es/{webhooks-HBe_DEKA.mjs → webhooks-Ba-OdU8e.mjs} +76 -21
  69. package/dist/{cjs/webhooks-DNLuuv9_.d.cts → es/webhooks-Deujdgcm.d.mts} +382 -43
  70. package/package.json +29 -24
  71. /package/dist/cjs/{commands → deprecated/commands}/index.d.cts +0 -0
  72. /package/dist/cjs/{commands → deprecated/commands}/templates/typescript/webpack-config.cjs +0 -0
  73. /package/dist/cjs/{commands → project}/templates/admin-ui/tsconfig.json +0 -0
  74. /package/dist/cjs/{commands → project}/templates/admin-ui/web-src/.babelrc +0 -0
  75. /package/dist/cjs/{commands → project}/templates/admin-ui/web-src/index.css +0 -0
  76. /package/dist/cjs/{commands → project}/templates/admin-ui/web-src/index.html +0 -0
  77. /package/dist/cjs/{commands → project}/templates/admin-ui/web-src/src/app.jsx +0 -0
  78. /package/dist/cjs/{commands → project}/templates/admin-ui/web-src/src/components/welcome.jsx +0 -0
  79. /package/dist/cjs/{commands → project}/templates/admin-ui/web-src/src/pages/main-page.jsx +0 -0
  80. /package/dist/cjs/{commands → project}/templates/admin-ui/web-src-template.d.ts +0 -0
  81. /package/dist/cjs/{commands → project}/templates/app-management/app-config.js.template +0 -0
  82. /package/dist/cjs/{commands → project}/templates/app-management/association.js.template +0 -0
  83. /package/dist/cjs/{commands → project}/templates/app-management/custom-scripts.js.template +0 -0
  84. /package/dist/cjs/{commands → project}/templates/app-management/installation.js.template +0 -0
  85. /package/dist/cjs/{commands → project}/templates/business-configuration/config.js.template +0 -0
  86. /package/dist/cjs/{commands → project}/templates/business-configuration/scope-tree.js.template +0 -0
  87. /package/dist/es/{commands → deprecated/commands}/index.d.mts +0 -0
  88. /package/dist/es/{commands → deprecated/commands}/templates/typescript/webpack-config.cjs +0 -0
  89. /package/dist/es/{commands → project}/templates/admin-ui/tsconfig.json +0 -0
  90. /package/dist/es/{commands → project}/templates/admin-ui/web-src/.babelrc +0 -0
  91. /package/dist/es/{commands → project}/templates/admin-ui/web-src/index.css +0 -0
  92. /package/dist/es/{commands → project}/templates/admin-ui/web-src/index.html +0 -0
  93. /package/dist/es/{commands → project}/templates/admin-ui/web-src/src/app.jsx +0 -0
  94. /package/dist/es/{commands → project}/templates/admin-ui/web-src/src/components/welcome.jsx +0 -0
  95. /package/dist/es/{commands → project}/templates/admin-ui/web-src/src/pages/main-page.jsx +0 -0
  96. /package/dist/es/{commands → project}/templates/admin-ui/web-src-template.d.ts +0 -0
  97. /package/dist/es/{commands → project}/templates/app-management/app-config.js.template +0 -0
  98. /package/dist/es/{commands → project}/templates/app-management/association.js.template +0 -0
  99. /package/dist/es/{commands → project}/templates/app-management/custom-scripts.js.template +0 -0
  100. /package/dist/es/{commands → project}/templates/app-management/installation.js.template +0 -0
  101. /package/dist/es/{commands → project}/templates/business-configuration/config.js.template +0 -0
  102. /package/dist/es/{commands → project}/templates/business-configuration/scope-tree.js.template +0 -0
@@ -17,7 +17,7 @@ var openapi = "3.1.0";
17
17
  var info = {
18
18
  "title": "App Management API",
19
19
  "description": "REST API for managing Adobe Commerce App Builder apps: resolving app configuration, managing configuration values, running the installation, upgrade, and uninstallation lifecycle, and managing the scope tree.",
20
- "version": "4.2.0",
20
+ "version": "4.3.0",
21
21
  "contact": {},
22
22
  "license": {
23
23
  "identifier": "Apache-2.0",
@@ -130,7 +130,8 @@ var paths = {
130
130
  "default": {
131
131
  "type": "string",
132
132
  "minLength": 1
133
- }
133
+ },
134
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
134
135
  },
135
136
  "required": [
136
137
  "name",
@@ -175,7 +176,8 @@ var paths = {
175
176
  "type": "string",
176
177
  "minLength": 1
177
178
  }
178
- }
179
+ },
180
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
179
181
  },
180
182
  "required": [
181
183
  "name",
@@ -203,7 +205,8 @@ var paths = {
203
205
  "minItems": 1
204
206
  },
205
207
  "type": { "const": "text" },
206
- "default": { "type": "string" }
208
+ "default": { "type": "string" },
209
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
207
210
  },
208
211
  "required": [
209
212
  "name",
@@ -229,7 +232,8 @@ var paths = {
229
232
  "minItems": 1
230
233
  },
231
234
  "type": { "const": "password" },
232
- "default": { "const": "" }
235
+ "default": { "const": "" },
236
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
233
237
  },
234
238
  "required": [
235
239
  "name",
@@ -258,7 +262,8 @@ var paths = {
258
262
  "default": { "anyOf": [{ "const": "" }, {
259
263
  "type": "string",
260
264
  "format": "email"
261
- }] }
265
+ }] },
266
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
262
267
  },
263
268
  "required": [
264
269
  "name",
@@ -287,7 +292,8 @@ var paths = {
287
292
  "default": { "anyOf": [{ "const": "" }, {
288
293
  "type": "string",
289
294
  "format": "uri"
290
- }] }
295
+ }] },
296
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
291
297
  },
292
298
  "required": [
293
299
  "name",
@@ -316,7 +322,8 @@ var paths = {
316
322
  "default": { "anyOf": [{ "const": "" }, {
317
323
  "type": "string",
318
324
  "pattern": "^\\+?[0-9\\s\\-()]+$"
319
- }] }
325
+ }] },
326
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
320
327
  },
321
328
  "required": [
322
329
  "name",
@@ -342,7 +349,8 @@ var paths = {
342
349
  "minItems": 1
343
350
  },
344
351
  "type": { "const": "boolean" },
345
- "default": { "type": "boolean" }
352
+ "default": { "type": "boolean" },
353
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
346
354
  },
347
355
  "required": [
348
356
  "name",
@@ -386,7 +394,7 @@ var paths = {
386
394
  "items": {
387
395
  "type": "string",
388
396
  "minLength": 1,
389
- "pattern": "^[a-zA-Z0-9-]+\\/[a-zA-Z0-9-]+$"
397
+ "pattern": "^\\w(?:[\\w@ .-]*[\\w@.-])?\\/\\w(?:[\\w@ .-]*[\\w@.-])?$"
390
398
  }
391
399
  },
392
400
  "name": {
@@ -453,7 +461,7 @@ var paths = {
453
461
  "items": {
454
462
  "type": "string",
455
463
  "minLength": 1,
456
- "pattern": "^[a-zA-Z0-9-]+\\/[a-zA-Z0-9-]+$"
464
+ "pattern": "^\\w(?:[\\w@ .-]*[\\w@.-])?\\/\\w(?:[\\w@ .-]*[\\w@.-])?$"
457
465
  }
458
466
  },
459
467
  "name": {
@@ -598,7 +606,7 @@ var paths = {
598
606
  ],
599
607
  "responses": {
600
608
  "200": {
601
- "description": "The configuration schema and the stored configuration values for the requested scope. Password fields are masked in the response.",
609
+ "description": "The configuration schema and the stored configuration values for the requested scope. Non-empty password values are masked in the response; empty password values are returned as empty strings.",
602
610
  "headers": { "x-ac-sdk-lib-versions": { "$ref": "#/components/headers/SdkLibVersions" } },
603
611
  "content": { "application/json": { "schema": {
604
612
  "description": "Current configuration values for the given scope",
@@ -640,7 +648,8 @@ var paths = {
640
648
  "default": {
641
649
  "type": "string",
642
650
  "minLength": 1
643
- }
651
+ },
652
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
644
653
  },
645
654
  "required": [
646
655
  "name",
@@ -685,7 +694,8 @@ var paths = {
685
694
  "type": "string",
686
695
  "minLength": 1
687
696
  }
688
- }
697
+ },
698
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
689
699
  },
690
700
  "required": [
691
701
  "name",
@@ -713,7 +723,8 @@ var paths = {
713
723
  "minItems": 1
714
724
  },
715
725
  "type": { "const": "text" },
716
- "default": { "type": "string" }
726
+ "default": { "type": "string" },
727
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
717
728
  },
718
729
  "required": [
719
730
  "name",
@@ -739,7 +750,8 @@ var paths = {
739
750
  "minItems": 1
740
751
  },
741
752
  "type": { "const": "password" },
742
- "default": { "const": "" }
753
+ "default": { "const": "" },
754
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
743
755
  },
744
756
  "required": [
745
757
  "name",
@@ -768,7 +780,8 @@ var paths = {
768
780
  "default": { "anyOf": [{ "const": "" }, {
769
781
  "type": "string",
770
782
  "format": "email"
771
- }] }
783
+ }] },
784
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
772
785
  },
773
786
  "required": [
774
787
  "name",
@@ -797,7 +810,8 @@ var paths = {
797
810
  "default": { "anyOf": [{ "const": "" }, {
798
811
  "type": "string",
799
812
  "format": "uri"
800
- }] }
813
+ }] },
814
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
801
815
  },
802
816
  "required": [
803
817
  "name",
@@ -826,7 +840,8 @@ var paths = {
826
840
  "default": { "anyOf": [{ "const": "" }, {
827
841
  "type": "string",
828
842
  "pattern": "^\\+?[0-9\\s\\-()]+$"
829
- }] }
843
+ }] },
844
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
830
845
  },
831
846
  "required": [
832
847
  "name",
@@ -852,7 +867,8 @@ var paths = {
852
867
  "minItems": 1
853
868
  },
854
869
  "type": { "const": "boolean" },
855
- "default": { "type": "boolean" }
870
+ "default": { "type": "boolean" },
871
+ "requiredFor": { "$ref": "#/components/schemas/RequiredFor" }
856
872
  },
857
873
  "required": [
858
874
  "name",
@@ -901,7 +917,7 @@ var paths = {
901
917
  "patch": {
902
918
  "operationId": "patchConfiguration",
903
919
  "summary": "Patch Configuration Values",
904
- "description": "Partially updates configuration values for a scope. Unsets those values that are sent with a null value.",
920
+ "description": "Partially updates configuration values for a scope. A null value unsets the scope override and restores inheritance. Updated fields marked with requiredFor: [save] must have a non-empty effective value after the update.",
905
921
  "parameters": [{
906
922
  "name": "x-gw-ims-org-id",
907
923
  "in": "header",
@@ -945,7 +961,7 @@ var paths = {
945
961
  },
946
962
  "responses": {
947
963
  "200": {
948
- "description": "The configuration values were successfully updated. Returns the updated configuration with password fields masked.",
964
+ "description": "The configuration values were successfully updated. Returns the updated configuration with non-empty password values masked.",
949
965
  "headers": {
950
966
  "Cache-Control": {
951
967
  "description": "Prevents clients from caching configuration mutation responses.",
@@ -977,7 +993,7 @@ var paths = {
977
993
  } } }
978
994
  },
979
995
  "400": {
980
- "description": "The request is invalid or could not be parsed.",
996
+ "description": "The request is invalid, could not be parsed, or updates a required field without a non-empty effective value.",
981
997
  "headers": { "x-ac-sdk-lib-versions": { "$ref": "#/components/headers/SdkLibVersions" } },
982
998
  "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationErrorResponse" } } }
983
999
  },
@@ -1080,7 +1096,7 @@ var paths = {
1080
1096
  "post": {
1081
1097
  "operationId": "startLifecyclePlan",
1082
1098
  "summary": "Start a Planned Lifecycle Operation",
1083
- "description": "Starts the pending plan named by `planId`, whatever its operation (install, upgrade or uninstall). Get the plan from `POST /installation/plan`. The plan is made again from the current state before it starts, and the attempt records how it differs from the reviewed plan in `review`.",
1099
+ "description": "Starts the pending plan named by `planId`, whatever its operation (install, upgrade or uninstall). Get the plan from `POST /installation/plan`. The plan is made again from the current state before it starts, and the attempt records how it differs from the reviewed plan in `review`. Install and upgrade starts require non-empty effective global values for fields marked for the corresponding operation.",
1084
1100
  "parameters": [{
1085
1101
  "name": "x-gw-ims-org-id",
1086
1102
  "in": "header",
@@ -1122,7 +1138,7 @@ var paths = {
1122
1138
  "headers": { "x-ac-sdk-lib-versions": { "$ref": "#/components/headers/SdkLibVersions" } }
1123
1139
  },
1124
1140
  "409": {
1125
- "description": "The plan cannot start. `code` tells why: `in-progress` (another attempt is running; `attempt` carries its status), `stale-plan` (the `planId` is not the pending plan, or the installed state now calls for another operation; plan again), `not-associated`, `unreadable-state`, `baseline-missing` (the stored state names a baseline snapshot that no longer exists), `installed-without-config`, or `already-current`. Without a `code`, planning is blocked by the `issues`, or the application ID changed.",
1141
+ "description": "The plan cannot start. `code` tells why: `in-progress` (another attempt is running; `attempt` carries its status), `stale-plan` (the `planId` is not the pending plan, or the installed state now calls for another operation; plan again), `not-associated`, `unreadable-state`, `baseline-missing` (the stored state names a baseline snapshot that no longer exists), `installed-without-config`, or `already-current`. Without a `code`, planning is blocked by the `issues`, or the application ID changed. `missing-required-configuration` lists missing global configuration field names in `fields`; provide those values and retry the start.",
1126
1142
  "headers": { "x-ac-sdk-lib-versions": { "$ref": "#/components/headers/SdkLibVersions" } },
1127
1143
  "content": { "application/json": { "schema": {
1128
1144
  "type": "object",
@@ -1133,6 +1149,11 @@ var paths = {
1133
1149
  "issues": {
1134
1150
  "type": "array",
1135
1151
  "items": { "$ref": "#/components/schemas/PlanningIssue" }
1152
+ },
1153
+ "fields": {
1154
+ "description": "Names of missing required global configuration fields.",
1155
+ "type": "array",
1156
+ "items": { "type": "string" }
1136
1157
  }
1137
1158
  },
1138
1159
  "required": ["message"]
@@ -1956,7 +1977,8 @@ var components = {
1956
1977
  },
1957
1978
  "runtimeAction": {
1958
1979
  "type": "string",
1959
- "minLength": 1
1980
+ "minLength": 1,
1981
+ "pattern": "^\\w(?:[\\w@ .-]*[\\w@.-])?\\/\\w(?:[\\w@ .-]*[\\w@.-])?$"
1960
1982
  },
1961
1983
  "requireAdobeAuth": { "type": "boolean" },
1962
1984
  "webhook": { "allOf": [{ "$ref": "#/components/schemas/WebhookDefinition" }, { "not": {
@@ -2160,6 +2182,7 @@ var components = {
2160
2182
  "system"
2161
2183
  ]
2162
2184
  },
2185
+ "allow": { "$ref": "#/components/schemas/AdminUiAllowPermissions" },
2163
2186
  "sandboxPermissions": { "$ref": "#/components/schemas/AdminUiSandboxPermissions" }
2164
2187
  },
2165
2188
  "required": [
@@ -2198,6 +2221,7 @@ var components = {
2198
2221
  "type": "number",
2199
2222
  "minimum": 1
2200
2223
  },
2224
+ "allow": { "$ref": "#/components/schemas/AdminUiAllowPermissions" },
2201
2225
  "sandboxPermissions": { "$ref": "#/components/schemas/AdminUiSandboxPermissions" }
2202
2226
  },
2203
2227
  "required": [
@@ -2301,6 +2325,7 @@ var components = {
2301
2325
  "creditMemo": {
2302
2326
  "type": "object",
2303
2327
  "properties": {
2328
+ "customAttributeGridColumns": { "$ref": "#/components/schemas/AdminUiCustomAttributeGridColumns" },
2304
2329
  "gridColumns": { "$ref": "#/components/schemas/AdminUiGridColumns" },
2305
2330
  "viewButtons": {
2306
2331
  "type": "array",
@@ -2327,6 +2352,99 @@ var components = {
2327
2352
  "additionalProperties": false,
2328
2353
  "required": []
2329
2354
  },
2355
+ "AdminUiCustomAttributeGridColumns": {
2356
+ "description": "Credit Memo columns read locally by a compatible Commerce provider, without Runtime bindings.",
2357
+ "type": "object",
2358
+ "properties": {
2359
+ "label": {
2360
+ "description": "Optional display label used in App Management lifecycle summaries.",
2361
+ "type": "string",
2362
+ "minLength": 1
2363
+ },
2364
+ "description": {
2365
+ "description": "Optional description used in App Management lifecycle summaries.",
2366
+ "type": "string",
2367
+ "minLength": 1
2368
+ },
2369
+ "columns": {
2370
+ "description": "IDs must be unique after Commerce sanitization, including across sibling Runtime columns.",
2371
+ "type": "array",
2372
+ "items": { "$ref": "#/components/schemas/AdminUiCustomAttributeGridColumn" },
2373
+ "minItems": 1
2374
+ }
2375
+ },
2376
+ "additionalProperties": false,
2377
+ "required": ["columns"]
2378
+ },
2379
+ "AdminUiCustomAttributeGridColumn": {
2380
+ "type": "object",
2381
+ "properties": {
2382
+ "id": {
2383
+ "type": "string",
2384
+ "minLength": 1,
2385
+ "pattern": "\\S"
2386
+ },
2387
+ "label": {
2388
+ "type": "string",
2389
+ "minLength": 1,
2390
+ "pattern": "\\S"
2391
+ },
2392
+ "align": {
2393
+ "type": "string",
2394
+ "enum": [
2395
+ "left",
2396
+ "right",
2397
+ "center"
2398
+ ]
2399
+ },
2400
+ "attribute_code": {
2401
+ "type": "string",
2402
+ "maxLength": 255,
2403
+ "minLength": 1,
2404
+ "pattern": "^[A-Za-z0-9_]+$(?![\\s\\S])"
2405
+ },
2406
+ "aclProtected": { "type": "boolean" },
2407
+ "filter": { "$ref": "#/components/schemas/AdminUiCustomAttributeFilter" }
2408
+ },
2409
+ "additionalProperties": false,
2410
+ "required": [
2411
+ "id",
2412
+ "label",
2413
+ "align",
2414
+ "attribute_code"
2415
+ ]
2416
+ },
2417
+ "AdminUiCustomAttributeFilter": { "oneOf": [{
2418
+ "type": "object",
2419
+ "additionalProperties": false,
2420
+ "properties": { "type": {
2421
+ "type": "string",
2422
+ "const": "boolean"
2423
+ } },
2424
+ "required": ["type"]
2425
+ }, {
2426
+ "type": "object",
2427
+ "additionalProperties": false,
2428
+ "properties": {
2429
+ "type": {
2430
+ "type": "string",
2431
+ "const": "text"
2432
+ },
2433
+ "conditions": {
2434
+ "type": "array",
2435
+ "items": {
2436
+ "type": "string",
2437
+ "enum": [
2438
+ "eq",
2439
+ "neq",
2440
+ "contains"
2441
+ ]
2442
+ },
2443
+ "minItems": 1
2444
+ }
2445
+ },
2446
+ "required": ["type", "conditions"]
2447
+ }] },
2330
2448
  "AdminUiGridColumns": {
2331
2449
  "type": "object",
2332
2450
  "properties": {
@@ -2453,6 +2571,7 @@ var components = {
2453
2571
  "minimum": 0
2454
2572
  },
2455
2573
  "confirm": { "$ref": "#/components/schemas/AdminUiConfirm" },
2574
+ "allow": { "$ref": "#/components/schemas/AdminUiAllowPermissions" },
2456
2575
  "sandboxPermissions": { "$ref": "#/components/schemas/AdminUiSandboxPermissions" },
2457
2576
  "notifications": { "$ref": "#/components/schemas/AdminUiNotifications" }
2458
2577
  },
@@ -2566,6 +2685,7 @@ var components = {
2566
2685
  "minimum": 0
2567
2686
  },
2568
2687
  "confirm": { "$ref": "#/components/schemas/AdminUiConfirm" },
2688
+ "allow": { "$ref": "#/components/schemas/AdminUiAllowPermissions" },
2569
2689
  "sandboxPermissions": { "$ref": "#/components/schemas/AdminUiSandboxPermissions" },
2570
2690
  "notifications": { "$ref": "#/components/schemas/AdminUiNotifications" }
2571
2691
  },
@@ -2679,6 +2799,7 @@ var components = {
2679
2799
  "minimum": 0
2680
2800
  },
2681
2801
  "confirm": { "$ref": "#/components/schemas/AdminUiConfirm" },
2802
+ "allow": { "$ref": "#/components/schemas/AdminUiAllowPermissions" },
2682
2803
  "sandboxPermissions": { "$ref": "#/components/schemas/AdminUiSandboxPermissions" },
2683
2804
  "notifications": { "$ref": "#/components/schemas/AdminUiNotifications" }
2684
2805
  },
@@ -2767,6 +2888,15 @@ var components = {
2767
2888
  }
2768
2889
  }
2769
2890
  },
2891
+ "AdminUiAllowPermissions": {
2892
+ "type": "array",
2893
+ "items": {
2894
+ "type": "string",
2895
+ "enum": ["autoplay", "microphone"]
2896
+ },
2897
+ "minItems": 1,
2898
+ "uniqueItems": true
2899
+ },
2770
2900
  "AdminUiSandboxPermissions": {
2771
2901
  "type": "array",
2772
2902
  "items": {
@@ -2983,6 +3113,7 @@ var components = {
2983
3113
  "minimum": 1
2984
3114
  },
2985
3115
  "confirm": { "$ref": "#/components/schemas/AdminUiConfirm" },
3116
+ "allow": { "$ref": "#/components/schemas/AdminUiAllowPermissions" },
2986
3117
  "sandboxPermissions": { "$ref": "#/components/schemas/AdminUiSandboxPermissions" },
2987
3118
  "notifications": { "$ref": "#/components/schemas/AdminUiNotifications" }
2988
3119
  },
@@ -3296,6 +3427,13 @@ var components = {
3296
3427
  "description": "The app version the plan ends at, or `null` when the app ends up with nothing installed.",
3297
3428
  "anyOf": [{ "type": "string" }, { "type": "null" }]
3298
3429
  },
3430
+ "upgradeMode": {
3431
+ "description": "The `metadata.upgradeMode` of the target config for an upgrade, or `null` for any other operation.",
3432
+ "anyOf": [{
3433
+ "type": "string",
3434
+ "enum": ["auto", "manual"]
3435
+ }, { "type": "null" }]
3436
+ },
3299
3437
  "domains": {
3300
3438
  "description": "The domains with operations to run or config changes. A domain with neither is left out.",
3301
3439
  "type": "array",
@@ -3364,9 +3502,22 @@ var components = {
3364
3502
  "operation",
3365
3503
  "sourceVersion",
3366
3504
  "targetVersion",
3505
+ "upgradeMode",
3367
3506
  "domains",
3368
3507
  "issues"
3369
3508
  ]
3509
+ },
3510
+ "RequiredFor": {
3511
+ "description": "Operations that require a non-empty effective value when saving or starting.",
3512
+ "type": "array",
3513
+ "items": {
3514
+ "type": "string",
3515
+ "enum": [
3516
+ "save",
3517
+ "installation",
3518
+ "upgrade"
3519
+ ]
3520
+ }
3370
3521
  }
3371
3522
  },
3372
3523
  "headers": { "SdkLibVersions": {
@@ -12,16 +12,16 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { t as validateCommerceAppConfig } from "./validate-xS9Dc-4m.mjs";
15
+ import { basename, dirname, join, parse } from "path";
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";
19
- import { basename, dirname, join, parse } from "path";
20
19
  import NpmPackageJson from "@npmcli/package-json";
21
20
  import { getPackageInfo } from "local-pkg";
22
21
  import { resolveCommand } from "package-manager-detector";
23
22
  import { detect, getUserAgent } from "package-manager-detector/detect";
24
23
  import { satisfies, validRange } from "semver";
24
+ import { t as validateCommerceAppConfig } from "./validate-CYWj7Nzp.mjs";
25
25
 
26
26
  // ../../packages-private/scripting-utils/source/project.ts
27
27
  /**
@@ -40,7 +40,8 @@ async function findUp(name, options = {}) {
40
40
  const { root } = parse(cwd);
41
41
  const stopAt = options.stopAt || root;
42
42
  let currentDir = cwd;
43
- for (;;) {
43
+ let reachedTop = false;
44
+ while (!reachedTop) {
44
45
  for (const fileName of names) {
45
46
  const filePath = join(currentDir, fileName);
46
47
  try {
@@ -48,7 +49,7 @@ async function findUp(name, options = {}) {
48
49
  return filePath;
49
50
  } catch {}
50
51
  }
51
- if (currentDir === stopAt || currentDir === root) return;
52
+ reachedTop = currentDir === stopAt || currentDir === root;
52
53
  currentDir = dirname(currentDir);
53
54
  }
54
55
  }
@@ -176,15 +177,26 @@ const DEV_DEPENDENCY_INSTALL_FLAGS = {
176
177
  pnpm: "--save-dev",
177
178
  yarn: "--dev"
178
179
  };
180
+ /** What joins the commands of an `&&` command chain, such as a hook or a package script. */
181
+ const COMMAND_SEPARATOR = " && ";
179
182
  /**
180
- * Append a command to an existing `&&` command chain without duplicating it.
181
- * @param existingCommand Existing command chain.
182
- * @param command Command to append.
183
+ * Splits an `&&` command chain into its commands.
184
+ *
185
+ * @param chain - The command chain. An empty or missing chain has no commands.
186
+ */
187
+ function splitCommands(chain) {
188
+ const trimmed = chain?.trim();
189
+ return trimmed ? trimmed.split(COMMAND_SEPARATOR) : [];
190
+ }
191
+ /**
192
+ * Appends a command to an `&&` command chain unless the chain has it.
193
+ *
194
+ * @param existingCommand - The command chain.
195
+ * @param command - The command to append.
183
196
  */
184
197
  function appendCommand(existingCommand, command) {
185
- const existing = existingCommand?.trim();
186
- if (!existing) return command;
187
- return existing.split(" && ").includes(command) ? existing : `${existing} && ${command}`;
198
+ const commands = splitCommands(existingCommand);
199
+ return (commands.includes(command) ? commands : [...commands, command]).join(COMMAND_SEPARATOR);
188
200
  }
189
201
  /**
190
202
  * Type guard asserting that a value is a supported `PackageManager`.
@@ -194,11 +206,16 @@ function isValidPackageManager(value) {
194
206
  return value !== void 0 && VALID_PACKAGE_MANAGERS.includes(value);
195
207
  }
196
208
  /**
197
- * Detect the package manager for a project.
198
- * @param projectRoot - Resolved project root containing package-manager metadata.
209
+ * Detects the package manager of a project.
210
+ *
211
+ * @param projectRoot - The project root.
212
+ * @param options.stopDir - The last folder to look for a lock file in, from `projectRoot` up.
199
213
  */
200
- async function detectPackageManager(projectRoot) {
201
- const result = await detect({ cwd: projectRoot });
214
+ async function detectPackageManager(projectRoot, options = {}) {
215
+ const result = await detect({
216
+ cwd: projectRoot,
217
+ stopDir: options.stopDir
218
+ });
202
219
  if (isValidPackageManager(result?.name)) return result.name;
203
220
  const fromUserAgent = getUserAgent() ?? void 0;
204
221
  if (isValidPackageManager(fromUserAgent)) return fromUserAgent;
@@ -272,6 +289,7 @@ const javaScriptConfigPaths = Object.freeze([
272
289
  "app.commerce.config.cjs",
273
290
  "app.commerce.config.mjs"
274
291
  ]);
292
+ /** The names of a TypeScript app config file. */
275
293
  const typeScriptConfigPaths = Object.freeze([
276
294
  "app.commerce.config.ts",
277
295
  "app.commerce.config.mts",
@@ -362,4 +380,4 @@ async function parseCommerceAppConfig(cwd = process.cwd()) {
362
380
  return validateCommerceAppConfig(config);
363
381
  }
364
382
 
365
- export { makeOutputDirFor as _, resolveCommerceAppConfig as a, getExecCommand as c, getPackageExecutionCommand as d, getProjectInstallCommand as f, loadPackageJson as g, isESM as h, readCommerceAppConfig as i, getInstallCommand as l, getRunScriptCommand as m, isTypeScriptConfig as n, appendCommand as o, getProjectRootDirectory as p, parseCommerceAppConfig as r, detectPackageManager as s, hasNamedCommerceAppConfigExports as t, getPackageDependencyInstallPlan as u, mergePackageJsonDependencies as v, readPackageJson as y };
383
+ export { isESM as _, resolveCommerceAppConfig as a, mergePackageJsonDependencies as b, appendCommand as c, getInstallCommand as d, getPackageDependencyInstallPlan as f, getRunScriptCommand as g, getProjectRootDirectory as h, readCommerceAppConfig as i, detectPackageManager as l, getProjectInstallCommand as m, isTypeScriptConfig as n, typeScriptConfigPaths as o, getPackageExecutionCommand as p, parseCommerceAppConfig as r, COMMAND_SEPARATOR as s, hasNamedCommerceAppConfigExports as t, getExecCommand as u, loadPackageJson as v, readPackageJson as x, makeOutputDirFor as y };