@adobe/aio-commerce-lib-app 2.2.0-beta-20261105172845 → 2.2.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 (60) hide show
  1. package/CHANGELOG.md +21 -4
  2. package/dist/cjs/actions/app-config/index.cjs +4 -4
  3. package/dist/cjs/actions/app-config/index.d.cts +2 -2
  4. package/dist/cjs/actions/association/index.cjs +1 -1
  5. package/dist/cjs/actions/config/index.cjs +1 -1
  6. package/dist/cjs/actions/config/index.d.cts +2 -2
  7. package/dist/cjs/actions/installation/index.cjs +60 -20
  8. package/dist/cjs/actions/installation/index.d.cts +4 -3
  9. package/dist/cjs/actions/scope-tree/index.cjs +1 -1
  10. package/dist/cjs/{app-CiZuhrsm.d.cts → app-B3bAEor-.d.cts} +176 -22
  11. package/dist/cjs/commands/index.cjs +25 -11
  12. package/dist/cjs/config/index.browser.d.cts +2 -1
  13. package/dist/cjs/config/index.node.cjs +3 -3
  14. package/dist/cjs/config/index.node.d.cts +60 -16
  15. package/dist/{es/define-9bwRE_UG.d.mts → cjs/define-eBMdGAq6.d.cts} +1 -1
  16. package/dist/cjs/{index-Bu2X-HUh.d.cts → index-BEeludy0.d.cts} +316 -316
  17. package/dist/cjs/{index-DWEigxhy.d.cts → index-vAue-u_y.d.cts} +1 -4
  18. package/dist/cjs/index.cjs +1 -1
  19. package/dist/cjs/index.d.cts +8 -8
  20. package/dist/cjs/{index.node-Boszndri.cjs → index.node-9bfp79rs.cjs} +1 -1
  21. package/dist/cjs/management/index.cjs +1 -1
  22. package/dist/cjs/management/index.d.cts +6 -1
  23. package/dist/cjs/{management-C_cVbr0s.cjs → management-5Et1mEUp.cjs} +41 -6
  24. package/dist/cjs/{openapi-c06taOv1.cjs → openapi-DghfuM8S.cjs} +135 -1
  25. package/dist/cjs/types-DslZGym8.d.cts +23 -0
  26. package/dist/cjs/{utils-B_Ypb2xF.cjs → utils-CoR_PBHz.cjs} +16 -3
  27. package/dist/cjs/{validate-CunJ4fUD.cjs → validate-BC3rnRLc.cjs} +1 -1
  28. package/dist/cjs/{version-CUu8Ks59.cjs → version-5MonNzl5.cjs} +1 -1
  29. package/dist/{es/webhooks-B7UjO8dd.d.mts → cjs/webhooks-DNLuuv9_.d.cts} +133 -16
  30. package/dist/cjs/{webhooks-C5ONLbQ4.cjs → webhooks-ZPh2gVb3.cjs} +11 -9
  31. package/dist/es/actions/app-config/index.d.mts +2 -2
  32. package/dist/es/actions/app-config/index.mjs +4 -4
  33. package/dist/es/actions/association/index.mjs +1 -1
  34. package/dist/es/actions/config/index.d.mts +1 -1
  35. package/dist/es/actions/config/index.mjs +1 -1
  36. package/dist/es/actions/installation/index.d.mts +4 -3
  37. package/dist/es/actions/installation/index.mjs +61 -21
  38. package/dist/es/actions/scope-tree/index.mjs +1 -1
  39. package/dist/es/{app-CiZuhrsm.d.mts → app-B3bAEor-.d.mts} +176 -22
  40. package/dist/es/commands/index.mjs +25 -11
  41. package/dist/es/config/index.browser.d.mts +2 -1
  42. package/dist/es/config/index.node.d.mts +59 -14
  43. package/dist/es/config/index.node.mjs +3 -3
  44. package/dist/{cjs/define-CZRjG5N_.d.cts → es/define-BdXyLAwb.d.mts} +1 -1
  45. package/dist/es/{index-Cho-eRFD.d.mts → index-DE2KVXfH.d.mts} +2 -2
  46. package/dist/es/{index-CgsSXApi.d.mts → index-DUJtT78x.d.mts} +2 -2
  47. package/dist/es/index.d.mts +8 -8
  48. package/dist/es/index.mjs +1 -1
  49. package/dist/es/{index.node-BVO6sC7z.mjs → index.node-CURztkP5.mjs} +1 -1
  50. package/dist/es/management/index.d.mts +6 -1
  51. package/dist/es/management/index.mjs +1 -1
  52. package/dist/es/{management-BYmbjhGb.mjs → management-BAQ64OyR.mjs} +41 -6
  53. package/dist/es/{openapi-C_TGWLou.mjs → openapi-BvPVTUMt.mjs} +135 -1
  54. package/dist/es/types-DslZGym8.d.mts +23 -0
  55. package/dist/es/{utils-SOtVo2VW.mjs → utils-DB8HaSj0.mjs} +11 -4
  56. package/dist/es/{validate-D-Oh-sxE.mjs → validate-xS9Dc-4m.mjs} +1 -1
  57. package/dist/es/{version-C-Pkqohl.mjs → version-BWgrh_QM.mjs} +1 -1
  58. package/dist/{cjs/webhooks-DX7km8wk.d.cts → es/webhooks-DgaLfP36.d.mts} +133 -16
  59. package/dist/es/{webhooks-CMb_05b6.mjs → webhooks-HBe_DEKA.mjs} +11 -9
  60. package/package.json +13 -13
@@ -12,7 +12,7 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { r as CommerceAppConfigOutputModel, t as AnyCommerceAppConfig } from "./app-CiZuhrsm.mjs";
15
+ import { r as CommerceAppConfigOutputModel, t as AnyCommerceAppConfig } from "./app-B3bAEor-.cjs";
16
16
  import * as v from "valibot";
17
17
  declare const NotificationsSchema: v.ObjectSchema<{
18
18
  readonly error: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
@@ -243,6 +243,44 @@ declare const CreditMemoViewButtonSchema: v.VariantSchema<"type", [v.StrictObjec
243
243
  readonly timeout: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
244
244
  readonly type: v.LiteralSchema<"worker", undefined>;
245
245
  }, undefined>], undefined>;
246
+ declare const RmaViewButtonSchema: v.VariantSchema<"type", [v.StrictObjectSchema<{
247
+ readonly title: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
248
+ readonly aclProtected: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
249
+ readonly confirm: v.OptionalSchema<v.ObjectSchema<{
250
+ readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
251
+ readonly title: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
252
+ }, undefined>, undefined>;
253
+ readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
254
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
255
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
256
+ readonly level: v.OptionalSchema<v.PicklistSchema<[-1, 0, 1], undefined>, undefined>;
257
+ readonly notifications: v.OptionalSchema<v.ObjectSchema<{
258
+ readonly error: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
259
+ readonly success: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
260
+ }, undefined>, undefined>;
261
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
262
+ readonly sandboxPermissions: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<["allow-downloads", "allow-modals", "allow-popups"], `Invalid sandbox permission. Accepted values are: ${string}`>, undefined>, v.MinLengthAction<("allow-downloads" | "allow-modals" | "allow-popups")[], 1, "sandboxPermissions must contain at least one permission when it's defined">, v.CheckAction<("allow-downloads" | "allow-modals" | "allow-popups")[], "Duplicate permissions are not allowed in sandboxPermissions">]>, undefined>;
263
+ readonly sortOrder: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
264
+ readonly type: v.LiteralSchema<"view", undefined>;
265
+ }, undefined>, v.StrictObjectSchema<{
266
+ readonly aclProtected: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
267
+ readonly confirm: v.OptionalSchema<v.ObjectSchema<{
268
+ readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
269
+ readonly title: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
270
+ }, undefined>, undefined>;
271
+ readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
272
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
273
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
274
+ readonly level: v.OptionalSchema<v.PicklistSchema<[-1, 0, 1], undefined>, undefined>;
275
+ readonly notifications: v.OptionalSchema<v.ObjectSchema<{
276
+ readonly error: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
277
+ readonly success: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
278
+ }, undefined>, undefined>;
279
+ readonly runtimeAction: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
280
+ readonly sortOrder: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
281
+ readonly timeout: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
282
+ readonly type: v.LiteralSchema<"worker", undefined>;
283
+ }, undefined>], undefined>;
246
284
  declare const MenuSchema: v.ObjectSchema<{
247
285
  /**
248
286
  * When `true`, Commerce auto-generates a per-app ACL resource id from `metadata.id`
@@ -260,7 +298,7 @@ declare const MenuSchema: v.ObjectSchema<{
260
298
  declare const NativeUiReplacedPageSchema: v.StrictObjectSchema<{
261
299
  readonly path: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
262
300
  readonly sandboxPermissions: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<["allow-downloads", "allow-modals", "allow-popups"], `Invalid sandbox permission. Accepted values are: ${string}`>, undefined>, v.MinLengthAction<("allow-downloads" | "allow-modals" | "allow-popups")[], 1, "sandboxPermissions must contain at least one permission when it's defined">, v.CheckAction<("allow-downloads" | "allow-modals" | "allow-popups")[], "Duplicate permissions are not allowed in sandboxPermissions">]>, undefined>;
263
- readonly target: v.PicklistSchema<readonly ["order.create"], `Invalid native UI replaced page target. Accepted values are: ${string}`>;
301
+ readonly target: v.PicklistSchema<readonly ["order.create", "return.create"], `Invalid native UI replaced page target. Accepted values are: ${string}`>;
264
302
  readonly title: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
265
303
  }, undefined>;
266
304
  /** A top-level acl entry: a leaf, or a group carrying leaf children (exactly one level of nesting). */
@@ -280,7 +318,7 @@ declare const AclResourceEntrySchema: v.StrictObjectSchema<{
280
318
  }, undefined>;
281
319
  /**
282
320
  * Schema for the `adminUi` config section.
283
- * Supports grid column extensions, mass actions, order, invoice, and credit memo view buttons, menu, native UI replaced pages, and custom ACL resources on `commerce/backend-ui/2`.
321
+ * Supports grid column extensions, mass actions, order, invoice, credit memo, and return view buttons, menu, native UI replaced pages, and custom ACL resources on `commerce/backend-ui/2`.
284
322
  */
285
323
  declare const AdminUiSchema: v.ObjectSchema<{
286
324
  readonly acl: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StrictObjectSchema<{
@@ -581,6 +619,7 @@ declare const AdminUiSchema: v.ObjectSchema<{
581
619
  readonly timeout: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
582
620
  readonly type: v.LiteralSchema<"worker", undefined>;
583
621
  }, undefined>], undefined>, undefined>, v.CheckAction<({
622
+ title?: string | undefined;
584
623
  aclProtected?: boolean | undefined;
585
624
  confirm?: {
586
625
  message?: string | undefined;
@@ -594,12 +633,11 @@ declare const AdminUiSchema: v.ObjectSchema<{
594
633
  error?: string | undefined;
595
634
  success?: string | undefined;
596
635
  } | undefined;
597
- runtimeAction: string;
636
+ path: string;
637
+ sandboxPermissions?: ("allow-downloads" | "allow-modals" | "allow-popups")[] | undefined;
598
638
  sortOrder?: number | undefined;
599
- timeout?: number | undefined;
600
- type: "worker";
639
+ type: "view";
601
640
  } | {
602
- title?: string | undefined;
603
641
  aclProtected?: boolean | undefined;
604
642
  confirm?: {
605
643
  message?: string | undefined;
@@ -613,10 +651,10 @@ declare const AdminUiSchema: v.ObjectSchema<{
613
651
  error?: string | undefined;
614
652
  success?: string | undefined;
615
653
  } | undefined;
616
- path: string;
617
- sandboxPermissions?: ("allow-downloads" | "allow-modals" | "allow-popups")[] | undefined;
654
+ runtimeAction: string;
618
655
  sortOrder?: number | undefined;
619
- type: "view";
656
+ timeout?: number | undefined;
657
+ type: "worker";
620
658
  })[], "Invoice view button ids must be unique after Commerce id sanitization.">]>, undefined>;
621
659
  }, undefined>, undefined>;
622
660
  readonly menu: v.OptionalSchema<v.ObjectSchema<{
@@ -637,12 +675,12 @@ declare const AdminUiSchema: v.ObjectSchema<{
637
675
  readonly replacedPages: v.SchemaWithPipe<readonly [v.ArraySchema<v.StrictObjectSchema<{
638
676
  readonly path: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
639
677
  readonly sandboxPermissions: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<["allow-downloads", "allow-modals", "allow-popups"], `Invalid sandbox permission. Accepted values are: ${string}`>, undefined>, v.MinLengthAction<("allow-downloads" | "allow-modals" | "allow-popups")[], 1, "sandboxPermissions must contain at least one permission when it's defined">, v.CheckAction<("allow-downloads" | "allow-modals" | "allow-popups")[], "Duplicate permissions are not allowed in sandboxPermissions">]>, undefined>;
640
- readonly target: v.PicklistSchema<readonly ["order.create"], `Invalid native UI replaced page target. Accepted values are: ${string}`>;
678
+ readonly target: v.PicklistSchema<readonly ["order.create", "return.create"], `Invalid native UI replaced page target. Accepted values are: ${string}`>;
641
679
  readonly title: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
642
680
  }, undefined>, undefined>, v.CheckAction<{
643
681
  path: string;
644
682
  sandboxPermissions?: ("allow-downloads" | "allow-modals" | "allow-popups")[] | undefined;
645
- target: "order.create";
683
+ target: "order.create" | "return.create";
646
684
  title: string;
647
685
  }[], "Native UI replaced page targets must be unique.">]>;
648
686
  }, undefined>, undefined>;
@@ -943,6 +981,83 @@ declare const AdminUiSchema: v.ObjectSchema<{
943
981
  title?: string | undefined;
944
982
  })[], "Mass action ids must be unique after Commerce id sanitization.">]>, undefined>;
945
983
  }, undefined>, undefined>;
984
+ readonly rma: v.OptionalSchema<v.ObjectSchema<{
985
+ readonly viewButtons: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.VariantSchema<"type", [v.StrictObjectSchema<{
986
+ readonly title: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
987
+ readonly aclProtected: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
988
+ readonly confirm: v.OptionalSchema<v.ObjectSchema<{
989
+ readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
990
+ readonly title: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
991
+ }, undefined>, undefined>;
992
+ readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
993
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
994
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
995
+ readonly level: v.OptionalSchema<v.PicklistSchema<[-1, 0, 1], undefined>, undefined>;
996
+ readonly notifications: v.OptionalSchema<v.ObjectSchema<{
997
+ readonly error: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
998
+ readonly success: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
999
+ }, undefined>, undefined>;
1000
+ readonly path: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
1001
+ readonly sandboxPermissions: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<["allow-downloads", "allow-modals", "allow-popups"], `Invalid sandbox permission. Accepted values are: ${string}`>, undefined>, v.MinLengthAction<("allow-downloads" | "allow-modals" | "allow-popups")[], 1, "sandboxPermissions must contain at least one permission when it's defined">, v.CheckAction<("allow-downloads" | "allow-modals" | "allow-popups")[], "Duplicate permissions are not allowed in sandboxPermissions">]>, undefined>;
1002
+ readonly sortOrder: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
1003
+ readonly type: v.LiteralSchema<"view", undefined>;
1004
+ }, undefined>, v.StrictObjectSchema<{
1005
+ readonly aclProtected: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1006
+ readonly confirm: v.OptionalSchema<v.ObjectSchema<{
1007
+ readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
1008
+ readonly title: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
1009
+ }, undefined>, undefined>;
1010
+ readonly description: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
1011
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
1012
+ readonly label: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
1013
+ readonly level: v.OptionalSchema<v.PicklistSchema<[-1, 0, 1], undefined>, undefined>;
1014
+ readonly notifications: v.OptionalSchema<v.ObjectSchema<{
1015
+ readonly error: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
1016
+ readonly success: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>, undefined>;
1017
+ }, undefined>, undefined>;
1018
+ readonly runtimeAction: v.SchemaWithPipe<readonly [v.StringSchema<`Expected a string value for '${string}'`>, v.NonEmptyAction<string, `The value of "${string}" must not be empty`>]>;
1019
+ readonly sortOrder: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
1020
+ readonly timeout: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<`Expected a number value for '${string}'`>, v.MinValueAction<number, 0, `The value of ${string} must be a non-negative number`>]>, undefined>;
1021
+ readonly type: v.LiteralSchema<"worker", undefined>;
1022
+ }, undefined>], undefined>, undefined>, v.CheckAction<({
1023
+ title?: string | undefined;
1024
+ aclProtected?: boolean | undefined;
1025
+ confirm?: {
1026
+ message?: string | undefined;
1027
+ title?: string | undefined;
1028
+ } | undefined;
1029
+ description?: string | undefined;
1030
+ id: string;
1031
+ label: string;
1032
+ level?: 0 | 1 | -1 | undefined;
1033
+ notifications?: {
1034
+ error?: string | undefined;
1035
+ success?: string | undefined;
1036
+ } | undefined;
1037
+ path: string;
1038
+ sandboxPermissions?: ("allow-downloads" | "allow-modals" | "allow-popups")[] | undefined;
1039
+ sortOrder?: number | undefined;
1040
+ type: "view";
1041
+ } | {
1042
+ aclProtected?: boolean | undefined;
1043
+ confirm?: {
1044
+ message?: string | undefined;
1045
+ title?: string | undefined;
1046
+ } | undefined;
1047
+ description?: string | undefined;
1048
+ id: string;
1049
+ label: string;
1050
+ level?: 0 | 1 | -1 | undefined;
1051
+ notifications?: {
1052
+ error?: string | undefined;
1053
+ success?: string | undefined;
1054
+ } | undefined;
1055
+ runtimeAction: string;
1056
+ sortOrder?: number | undefined;
1057
+ timeout?: number | undefined;
1058
+ type: "worker";
1059
+ })[], "Return view button ids must be unique after Commerce id sanitization.">]>, undefined>;
1060
+ }, undefined>, undefined>;
946
1061
  readonly shipment: v.OptionalSchema<v.ObjectSchema<{
947
1062
  readonly gridColumns: v.OptionalSchema<v.ObjectSchema<{
948
1063
  readonly columns: v.SchemaWithPipe<readonly [v.ArraySchema<v.StrictObjectSchema<{
@@ -981,7 +1096,7 @@ type AclResourceEntry = v.InferInput<typeof AclResourceEntrySchema>;
981
1096
  * grid columns, a mass action, a view button, a native UI page replacement, or a
982
1097
  * custom ACL resource entry.
983
1098
  */
984
- type AdminUiComponentConfig = v.InferOutput<typeof MenuSchema> | v.InferOutput<typeof GridColumnsSchema> | v.InferOutput<typeof MassActionSchema> | v.InferOutput<typeof OrderViewButtonSchema> | v.InferOutput<typeof NativeUiReplacedPageSchema> | v.InferOutput<typeof InvoiceViewButtonSchema> | v.InferOutput<typeof CreditMemoViewButtonSchema> | AclResourceEntry;
1099
+ type AdminUiComponentConfig = v.InferOutput<typeof MenuSchema> | v.InferOutput<typeof GridColumnsSchema> | v.InferOutput<typeof MassActionSchema> | v.InferOutput<typeof OrderViewButtonSchema> | v.InferOutput<typeof NativeUiReplacedPageSchema> | v.InferOutput<typeof InvoiceViewButtonSchema> | v.InferOutput<typeof CreditMemoViewButtonSchema> | v.InferOutput<typeof RmaViewButtonSchema> | AclResourceEntry;
985
1100
  /**
986
1101
  * Grid columns registration configuration.
987
1102
  */
@@ -1010,6 +1125,8 @@ type OrderViewButton = v.InferInput<typeof OrderViewButtonSchema>;
1010
1125
  type InvoiceViewButton = v.InferInput<typeof InvoiceViewButtonSchema>;
1011
1126
  /** A credit memo view button registration entry (view or worker variant). */
1012
1127
  type CreditMemoViewButton = v.InferInput<typeof CreditMemoViewButtonSchema>;
1128
+ /** A return (RMA) view button registration entry (view or worker variant). */
1129
+ type RmaViewButton = v.InferInput<typeof RmaViewButtonSchema>;
1013
1130
  /**
1014
1131
  * Inlined notification strings on an `adminUi` registration entry.
1015
1132
  */
@@ -1623,7 +1740,7 @@ declare const WebhooksSchema: v.OptionalSchema<v.SchemaWithPipe<readonly [v.Arra
1623
1740
  value: string;
1624
1741
  }[] | undefined;
1625
1742
  hook_name: string;
1626
- method: "POST" | "PUT" | "DELETE" | "GET";
1743
+ method: "GET" | "POST" | "PUT" | "DELETE";
1627
1744
  priority?: number | undefined;
1628
1745
  required?: boolean | undefined;
1629
1746
  rules?: {
@@ -1656,7 +1773,7 @@ declare const WebhooksSchema: v.OptionalSchema<v.SchemaWithPipe<readonly [v.Arra
1656
1773
  value: string;
1657
1774
  }[] | undefined;
1658
1775
  hook_name: string;
1659
- method: "POST" | "PUT" | "DELETE" | "GET";
1776
+ method: "GET" | "POST" | "PUT" | "DELETE";
1660
1777
  priority?: number | undefined;
1661
1778
  required?: boolean | undefined;
1662
1779
  rules?: {
@@ -1696,4 +1813,4 @@ type WebhooksConfig<T extends AnyCommerceAppConfig = CommerceAppConfigOutputMode
1696
1813
  * @param config - The configuration to check.
1697
1814
  */
1698
1815
  declare function hasWebhooks<T extends AnyCommerceAppConfig>(config: T): config is T & WebhooksConfig<T>;
1699
- export { AdminUiConfig as A, OrderViewButton as B, ExternalEventSource as C, hasEventing as D, hasCommerceEvents as E, InvoiceViewButton as F, WorkerMassAction as H, MassAction as I, Menu as L, CreditMemoViewButton as M, GridColumn as N, hasExternalEvents as O, GridColumns as P, NativeUiReplacedPage as R, ExternalEvent as S, ExternalEventsConfig as T, hasAdminUi as U, ViewMassAction as V, hasBackendUiV2Components as W, CommerceEventsConfig as _, WebhookRule as a, EventingSchema as b, WebhooksSchema as c, hasCustomInstallation as d, hasCustomInstallationSteps as f, CommerceEventSourceSchema as g, CommerceEventSource as h, WebhookHeader as i, AdminUiConfiguration as j, AdminUiComponentConfig as k, hasWebhooks as l, CommerceEvent as m, WebhookEntry as n, WebhooksConfig as o, AppEvent as p, WebhookField as r, WebhooksConfiguration as s, WebhookDefinition as t, CustomInstallationStep as u, EventProvider as v, ExternalEventSourceSchema as w, EventsConfig as x, EventingConfiguration as y, Notifications as z };
1816
+ export { AdminUiConfig as A, OrderViewButton as B, ExternalEventSource as C, hasEventing as D, hasCommerceEvents as E, InvoiceViewButton as F, hasBackendUiV2Components as G, ViewMassAction as H, MassAction as I, Menu as L, CreditMemoViewButton as M, GridColumn as N, hasExternalEvents as O, GridColumns as P, NativeUiReplacedPage as R, ExternalEvent as S, ExternalEventsConfig as T, WorkerMassAction as U, RmaViewButton as V, hasAdminUi as W, CommerceEventsConfig as _, WebhookRule as a, EventingSchema as b, WebhooksSchema as c, hasCustomInstallation as d, hasCustomInstallationSteps as f, CommerceEventSourceSchema as g, CommerceEventSource as h, WebhookHeader as i, AdminUiConfiguration as j, AdminUiComponentConfig as k, hasWebhooks as l, CommerceEvent as m, WebhookEntry as n, WebhooksConfig as o, AppEvent as p, WebhookField as r, WebhooksConfiguration as s, WebhookDefinition as t, CustomInstallationStep as u, EventProvider as v, ExternalEventSourceSchema as w, EventsConfig as x, EventingConfiguration as y, Notifications as z };
@@ -134,14 +134,13 @@ const ViewButtonWorkerSchema = valibot.strictObject({
134
134
  type: valibot.literal("worker")
135
135
  });
136
136
  const OrderViewButtonSchema = valibot.variant("type", [ViewButtonViewSchema, ViewButtonWorkerSchema]);
137
- const InvoiceViewButtonSchema = valibot.variant("type", [valibot.strictObject({
138
- ...ViewButtonViewSchema.entries,
139
- title: valibot.optional(require_schemas.nonEmptyStringValueSchema("view button page title"))
140
- }), ViewButtonWorkerSchema]);
141
- const CreditMemoViewButtonSchema = valibot.variant("type", [valibot.strictObject({
137
+ const TitledViewButtonSchema = valibot.variant("type", [valibot.strictObject({
142
138
  ...ViewButtonViewSchema.entries,
143
139
  title: valibot.optional(require_schemas.nonEmptyStringValueSchema("view button page title"))
144
140
  }), ViewButtonWorkerSchema]);
141
+ const InvoiceViewButtonSchema = TitledViewButtonSchema;
142
+ const CreditMemoViewButtonSchema = TitledViewButtonSchema;
143
+ const RmaViewButtonSchema = TitledViewButtonSchema;
145
144
  const MassActionsSchema = valibot.pipe(valibot.array(MassActionSchema), valibot.check((items) => hasUniqueSanitizedIds(items), "Mass action ids must be unique after Commerce id sanitization."));
146
145
  const AdminUiOrderSchema = valibot.object({
147
146
  gridColumns: valibot.optional(GridColumnsSchema),
@@ -160,6 +159,7 @@ const AdminUiCreditMemoSchema = valibot.object({
160
159
  gridColumns: valibot.optional(GridColumnsSchema),
161
160
  viewButtons: valibot.optional(valibot.pipe(valibot.array(CreditMemoViewButtonSchema), valibot.check((items) => hasUniqueSanitizedIds(items), "Credit memo view button ids must be unique after Commerce id sanitization.")))
162
161
  });
162
+ const AdminUiRmaSchema = valibot.object({ viewButtons: valibot.optional(valibot.pipe(valibot.array(RmaViewButtonSchema), valibot.check((items) => hasUniqueSanitizedIds(items), "Return view button ids must be unique after Commerce id sanitization."))) });
163
163
  const AdminUiGridOnlyEntitySchema = valibot.object({ gridColumns: valibot.optional(GridColumnsSchema) });
164
164
  const MenuIdSchema = valibot.pipe(require_schemas.nonEmptyStringValueSchema("menu ID"), valibot.regex(/^[A-Za-z0-9_/:]+$/u, "Menu ID may contain only letters, digits, \"/\", \":\", and \"_\""));
165
165
  const MenuSchema = valibot.object({
@@ -176,7 +176,7 @@ const MenuSchema = valibot.object({
176
176
  parentMenu: valibot.optional(valibot.picklist(_adobe_aio_commerce_lib_admin_ui_menu.COMMERCE_MENUS, "parentMenu must be a known Commerce Admin menu ID")),
177
177
  sandboxPermissions: valibot.optional(SandboxPermissionsSchema)
178
178
  });
179
- const NATIVE_UI_REPLACED_PAGE_TARGETS = ["order.create"];
179
+ const NATIVE_UI_REPLACED_PAGE_TARGETS = ["order.create", "return.create"];
180
180
  const NativeUiReplacedPageSchema = valibot.strictObject({
181
181
  path: require_schemas.nonEmptyStringValueSchema("replaced page path"),
182
182
  sandboxPermissions: valibot.optional(SandboxPermissionsSchema),
@@ -220,7 +220,7 @@ const AdminUiAclSchema = valibot.pipe(valibot.array(AclResourceEntrySchema), val
220
220
  }, "Custom ACL resource ids must stay unique after Commerce derivation: a top-level resource id must not equal a group's \"<group>_<child>\" combination."));
221
221
  /**
222
222
  * Schema for the `adminUi` config section.
223
- * Supports grid column extensions, mass actions, order, invoice, and credit memo view buttons, menu, native UI replaced pages, and custom ACL resources on `commerce/backend-ui/2`.
223
+ * Supports grid column extensions, mass actions, order, invoice, credit memo, and return view buttons, menu, native UI replaced pages, and custom ACL resources on `commerce/backend-ui/2`.
224
224
  */
225
225
  const AdminUiSchema = valibot.object({
226
226
  acl: valibot.optional(AdminUiAclSchema),
@@ -232,6 +232,7 @@ const AdminUiSchema = valibot.object({
232
232
  newsletter: valibot.optional(AdminUiGridOnlyEntitySchema),
233
233
  order: valibot.optional(AdminUiOrderSchema),
234
234
  product: valibot.optional(AdminUiGridAndMassActionEntitySchema),
235
+ rma: valibot.optional(AdminUiRmaSchema),
235
236
  shipment: valibot.optional(AdminUiGridOnlyEntitySchema)
236
237
  });
237
238
  /**
@@ -257,7 +258,8 @@ const ADMIN_UI_MASS_ACTION_ENTITIES = [
257
258
  const ADMIN_UI_VIEW_BUTTON_ENTITIES = [
258
259
  "order",
259
260
  "invoice",
260
- "creditMemo"
261
+ "creditMemo",
262
+ "rma"
261
263
  ];
262
264
  /**
263
265
  * Check whether the config declares an Admin UI component that requires the
@@ -270,7 +272,7 @@ const ADMIN_UI_VIEW_BUTTON_ENTITIES = [
270
272
  function hasBackendUiV2Components(config) {
271
273
  const { adminUi } = config;
272
274
  if (!adminUi) return false;
273
- return Boolean(adminUi.menu || adminUi.order?.gridColumns || adminUi.order?.massActions?.length || adminUi.order?.viewButtons?.length || adminUi.product?.gridColumns || adminUi.product?.massActions?.length || adminUi.customer?.gridColumns || adminUi.customer?.massActions?.length || adminUi.invoice?.gridColumns || adminUi.invoice?.viewButtons?.length || adminUi.creditMemo?.gridColumns || adminUi.creditMemo?.viewButtons?.length || adminUi.shipment?.gridColumns || adminUi.nativeUi?.replacedPages?.length || adminUi.newsletter?.gridColumns);
275
+ return Boolean(adminUi.menu || adminUi.order?.gridColumns || adminUi.order?.massActions?.length || adminUi.order?.viewButtons?.length || adminUi.product?.gridColumns || adminUi.product?.massActions?.length || adminUi.customer?.gridColumns || adminUi.customer?.massActions?.length || adminUi.invoice?.gridColumns || adminUi.invoice?.viewButtons?.length || adminUi.creditMemo?.gridColumns || adminUi.creditMemo?.viewButtons?.length || adminUi.rma?.viewButtons?.length || adminUi.shipment?.gridColumns || adminUi.nativeUi?.replacedPages?.length || adminUi.newsletter?.gridColumns);
274
276
  }
275
277
  /**
276
278
  * Check whether the config declares at least one Admin UI component (menu, grid
@@ -12,8 +12,8 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import "../../index-CgsSXApi.mjs";
16
- import { n as CommerceAppConfig } from "../../app-CiZuhrsm.mjs";
15
+ import "../../index-DUJtT78x.mjs";
16
+ import { n as CommerceAppConfig } from "../../app-B3bAEor-.mjs";
17
17
  import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
18
18
  /** The arguments required to create the runtime action for the app-config action. */
19
19
  type RuntimeActionFactoryArgs = {
@@ -12,9 +12,9 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { n as HttpActionRouter, r as logger, t as SDK_LIB_VERSIONS_HEADERS } from "../../version-C-Pkqohl.mjs";
15
+ import { n as HttpActionRouter, r as logger, t as SDK_LIB_VERSIONS_HEADERS } from "../../version-BWgrh_QM.mjs";
16
16
  import { n as filterAppConfigByEnv } from "../../environment-DUhU0_9z.mjs";
17
- import { i as requiresInstallationFromDomains, o as getConfigDomains, t as validateCommerceAppConfig, u as hasBusinessConfigSchema } from "../../validate-D-Oh-sxE.mjs";
17
+ import { i as requiresInstallationFromDomains, o as getConfigDomains, t as validateCommerceAppConfig, u as hasBusinessConfigSchema } from "../../validate-xS9Dc-4m.mjs";
18
18
  import { resolveBusinessConfigSchema } from "@adobe/aio-commerce-lib-config";
19
19
  import { CommerceEnvSchema } from "@adobe/aio-commerce-lib-core/commerce";
20
20
  import * as v from "valibot";
@@ -26,7 +26,7 @@ import { createHash } from "crypto";
26
26
  * Loads the committed OpenAPI spec via dynamic import so it
27
27
  * lands in its own chunk and is not parsed on every cold start.
28
28
  */
29
- const importOpenApi = () => import("../../openapi-C_TGWLou.mjs");
29
+ const importOpenApi = () => import("../../openapi-BvPVTUMt.mjs");
30
30
  /** Matches component schema `$ref` strings, capturing the schema name. */
31
31
  const SCHEMA_REF_PATTERN = /"#\/components\/schemas\/(?<schema>\w+)"/gu;
32
32
  /**
@@ -77,7 +77,7 @@ function pruneUnusedTags(spec) {
77
77
  * @param domains - The active config domains.
78
78
  */
79
79
  function getOpenApiCacheKey(domains) {
80
- const input = `2.2.0-beta-20261105172845:${[...domains].sort().join(",")}:4.2.0`;
80
+ const input = `2.2.0:${[...domains].sort().join(",")}:4.2.0`;
81
81
  return createHash("sha256").update(input).digest("hex").slice(0, 8);
82
82
  }
83
83
  /** Returns the server URL to be set in the OpenAPI spec, based on the current namespace. */
@@ -12,7 +12,7 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { n as HttpActionRouter, r as logger, t as SDK_LIB_VERSIONS_HEADERS } from "../../version-C-Pkqohl.mjs";
15
+ import { n as HttpActionRouter, r as logger, t as SDK_LIB_VERSIONS_HEADERS } from "../../version-BWgrh_QM.mjs";
16
16
  import { r as setAssociationData, t as clearAssociationData } from "../../repository-BVBp61y9.mjs";
17
17
  import { resolveImsAuthParams } from "@adobe/aio-commerce-lib-auth";
18
18
  import { CommerceEnvSchema } from "@adobe/aio-commerce-lib-core/commerce";
@@ -12,7 +12,7 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import "../../index-CgsSXApi.mjs";
15
+ import "../../index-DUJtT78x.mjs";
16
16
  import { BusinessConfigSchema } from "@adobe/aio-commerce-lib-config";
17
17
  import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
18
18
  /** The arguments required to create the runtime action for the config action. */
@@ -12,7 +12,7 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { n as HttpActionRouter, r as logger, t as SDK_LIB_VERSIONS_HEADERS } from "../../version-C-Pkqohl.mjs";
15
+ import { n as HttpActionRouter, r as logger, t as SDK_LIB_VERSIONS_HEADERS } from "../../version-BWgrh_QM.mjs";
16
16
  import { r as filterSchemaByEnv } from "../../environment-DUhU0_9z.mjs";
17
17
  import { r as nonEmptyStringValueSchema } from "../../schemas-DYMNbFdX.mjs";
18
18
  import { byScopeId, getConfiguration, initialize, setConfiguration } from "@adobe/aio-commerce-lib-config";
@@ -12,9 +12,10 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import "../../index-CgsSXApi.mjs";
16
- import { G as LifecycleContext } from "../../index-Cho-eRFD.mjs";
17
- import { n as CommerceAppConfig, r as CommerceAppConfigOutputModel } from "../../app-CiZuhrsm.mjs";
15
+ import "../../index-DUJtT78x.mjs";
16
+ import { G as LifecycleContext } from "../../index-DE2KVXfH.mjs";
17
+ import { n as CommerceAppConfig, r as CommerceAppConfigOutputModel } from "../../app-B3bAEor-.mjs";
18
+ import "../../types-DslZGym8.mjs";
18
19
  import { RuntimeActionParams } from "@adobe/aio-commerce-lib-core/params";
19
20
  /** Loads generated custom installation script modules. */
20
21
  type CustomScriptsLoader = (config: CommerceAppConfigOutputModel, logger: LifecycleContext["logger"]) => Record<string, unknown>;
@@ -12,15 +12,16 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { n as HttpActionRouter, r as logger, t as SDK_LIB_VERSIONS_HEADERS } from "../../version-C-Pkqohl.mjs";
15
+ import { n as HttpActionRouter, r as logger, t as SDK_LIB_VERSIONS_HEADERS } from "../../version-BWgrh_QM.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-BYmbjhGb.mjs";
18
- import { n as getAssociationData } from "../../repository-BVBp61y9.mjs";
19
- import { a as hasCustomInstallationSteps } from "../../webhooks-CMb_05b6.mjs";
20
- import { r as requiresInstallation, t as validateCommerceAppConfig } from "../../validate-D-Oh-sxE.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-BAQ64OyR.mjs";
18
+ import { n as getAssociationData, r as setAssociationData } from "../../repository-BVBp61y9.mjs";
19
+ import { a as hasCustomInstallationSteps } from "../../webhooks-HBe_DEKA.mjs";
20
+ import { r as requiresInstallation, t as validateCommerceAppConfig } from "../../validate-xS9Dc-4m.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";
24
+ import { CommerceEnvSchema } from "@adobe/aio-commerce-lib-core/commerce";
24
25
  import * as v from "valibot";
25
26
  import stringify from "safe-stable-stringify";
26
27
  import { accepted, badRequest, conflict, internalServerError, noContent, notFound, ok } from "@adobe/aio-commerce-lib-core/responses";
@@ -379,6 +380,8 @@ const AppDataSchema = v.object({
379
380
  */
380
381
  const LifecycleRequestContextSchema = v.object({
381
382
  appData: AppDataSchema,
383
+ commerceBaseUrl: v.nullish(v.pipe(v.string(), v.url("The 'commerceBaseUrl' field must be a valid absolute URL (e.g., 'https://my-store.example.com')"))),
384
+ commerceEnv: v.nullish(CommerceEnvSchema),
382
385
  installedState: v.optional(v.literal("business-config-only")),
383
386
  installedVersion: v.optional(v.string()),
384
387
  ioEventsEnv: v.string(),
@@ -1023,20 +1026,36 @@ const DEFAULT_ACTION_NAME = "app-management/installation";
1023
1026
  const CUSTOM_INSTALLATION_STEPS_PATH = ["installation", "customInstallationSteps"];
1024
1027
  /**
1025
1028
  * Merges the runtime params with the request body and the Commerce instance the app is
1026
- * associated with. Returns `null` when the app is not associated.
1029
+ * associated with. Returns `null` when the app has no Commerce instance to use.
1030
+ *
1031
+ * An uninstall without an association record uses the Commerce instance of the request body and
1032
+ * returns it as `commerceFromBody`. Any other operation needs the record.
1027
1033
  */
1028
- async function resolveWorkflowParams(body, rawParams) {
1034
+ async function resolveWorkflowParams(body, rawParams, operation) {
1029
1035
  const association = await getAssociationData();
1030
- if (!association) return null;
1036
+ const commerceFromBody = !association && operation === "uninstall" ? getBodyCommerce(body) : null;
1037
+ const commerce = association?.commerce ?? commerceFromBody;
1038
+ if (!commerce) return null;
1031
1039
  return {
1032
- ...rawParams,
1033
- AIO_COMMERCE_API_BASE_URL: association.commerce.baseUrl,
1034
- AIO_COMMERCE_API_FLAVOR: association.commerce.env,
1035
- AIO_COMMERCE_AUTH_IMS_ENVIRONMENT: body.ioEventsEnv,
1036
- AIO_EVENTS_API_BASE_URL: body.ioEventsUrl,
1037
- appData: body.appData
1040
+ commerceFromBody,
1041
+ params: {
1042
+ ...rawParams,
1043
+ AIO_COMMERCE_API_BASE_URL: commerce.baseUrl,
1044
+ AIO_COMMERCE_API_FLAVOR: commerce.env,
1045
+ AIO_COMMERCE_AUTH_IMS_ENVIRONMENT: body.ioEventsEnv,
1046
+ AIO_EVENTS_API_BASE_URL: body.ioEventsUrl,
1047
+ appData: body.appData
1048
+ }
1038
1049
  };
1039
1050
  }
1051
+ /** The Commerce instance the request body names, or `null` when it lacks the URL or the env. */
1052
+ function getBodyCommerce(body) {
1053
+ const { commerceBaseUrl, commerceEnv } = body;
1054
+ return commerceBaseUrl && commerceEnv ? {
1055
+ baseUrl: commerceBaseUrl,
1056
+ env: commerceEnv
1057
+ } : null;
1058
+ }
1040
1059
  /** The response for a request on an app that is not associated with a Commerce instance. */
1041
1060
  function notAssociatedConflict() {
1042
1061
  return conflict({ body: {
@@ -1853,16 +1872,18 @@ async function persistDispatchFailure(stateStore, attempt, error, logger) {
1853
1872
 
1854
1873
  // source/actions/installation/plan.ts
1855
1874
  /**
1856
- * Checks what every planning request needs (the action version, the app config and an
1857
- * association) and creates the lifecycle runtime.
1875
+ * Checks what every planning request needs (the action version, the app config and a Commerce
1876
+ * instance) and creates the lifecycle runtime. `operation` is the operation the request is for,
1877
+ * when it is known before the state is read.
1858
1878
  */
1859
- async function prepareRequest({ body, logger, rawParams }) {
1879
+ async function prepareRequest({ body, logger, rawParams }, operation) {
1860
1880
  const actionVersion = process.env.__OW_ACTION_VERSION;
1861
1881
  if (!actionVersion) return rejected(internalServerError("The OpenWhisk action version is required to plan a lifecycle operation"));
1862
1882
  const rawAppConfig = rawParams.appConfig;
1863
1883
  if (!rawAppConfig) return rejected(internalServerError("The app config is missing. Does the action receive it as a parameter?"));
1864
- const params = await resolveWorkflowParams(body, rawParams);
1865
- if (!params) return rejected(notAssociatedConflict());
1884
+ const resolved = await resolveWorkflowParams(body, rawParams, operation);
1885
+ if (!resolved) return rejected(notAssociatedConflict());
1886
+ const { commerceFromBody, params } = resolved;
1866
1887
  logger.debug(`Lifecycle request for app "${body.appData.projectName}" (workspace: "${body.appData.workspaceName}", commerce: "${params.AIO_COMMERCE_API_BASE_URL}")`);
1867
1888
  const appConfig = validateCommerceAppConfig(rawAppConfig);
1868
1889
  const runtime = await createLifecycleRuntime(params, appConfig, logger);
@@ -1886,6 +1907,7 @@ async function prepareRequest({ body, logger, rawParams }) {
1886
1907
  appConfig,
1887
1908
  baseline,
1888
1909
  businessConfigOnlyVersion: body.installedState === "business-config-only" && body.installedVersion ? body.installedVersion : null,
1910
+ commerceFromBody,
1889
1911
  isBaselineMissing,
1890
1912
  latestAttempt: state?.latestAttempt ?? null,
1891
1913
  params,
@@ -1898,7 +1920,7 @@ async function prepareRequest({ body, logger, rawParams }) {
1898
1920
  * the plan's issues as a validation result, and the plan, whose `id` starts it.
1899
1921
  */
1900
1922
  async function planRequestedOperation(args) {
1901
- const prepared = await prepareRequest(args);
1923
+ const prepared = await prepareRequest(args, args.body.operation);
1902
1924
  if (prepared.kind === "rejected") return prepared.response;
1903
1925
  const { request } = prepared;
1904
1926
  const resolved = await resolveOperation(request, args.body.operation);
@@ -2062,8 +2084,8 @@ const StatusQuerySchema = v.object({
2062
2084
  async function startPlannedRequest(args) {
2063
2085
  const { planId } = args.body;
2064
2086
  if (!planId) return badRequest("A lifecycle operation starts from a plan. Call POST /plan and pass the planId it returns.");
2065
- const prepared = await prepareRequest(args);
2066
2087
  const { logger } = args;
2088
+ const prepared = await prepareRequest(args, await getPendingPlanOperation(planId));
2067
2089
  if (prepared.kind === "rejected") return prepared.response;
2068
2090
  const { request } = prepared;
2069
2091
  const { stateStore } = request.runtime;
@@ -2099,6 +2121,7 @@ async function startPlannedRequest(args) {
2099
2121
  runtime: request.runtime
2100
2122
  });
2101
2123
  if (planned.kind === "rejected") return planned.response;
2124
+ await backfillAssociation(request.commerceFromBody, logger);
2102
2125
  return startPlannedOperation({
2103
2126
  actionVersion: request.actionVersion,
2104
2127
  logger,
@@ -2108,6 +2131,23 @@ async function startPlannedRequest(args) {
2108
2131
  });
2109
2132
  }
2110
2133
  /**
2134
+ * Stores the Commerce instance of the request as the association record, unless a record exists.
2135
+ * Does nothing when the request did not supply the instance.
2136
+ */
2137
+ async function backfillAssociation(commerce, logger) {
2138
+ if (!commerce) return;
2139
+ if (await getAssociationData()) return;
2140
+ await setAssociationData({ commerce });
2141
+ logger.info(`Stored the Commerce instance "${commerce.baseUrl}" of the request as the association record.`);
2142
+ }
2143
+ /**
2144
+ * Reads the operation of the pending plan, or `undefined` when `planId` is not the pending plan.
2145
+ */
2146
+ async function getPendingPlanOperation(planId) {
2147
+ const pendingPlan = (await (await createOrchestrationStateStore()).get(CURRENT_STATE_KEY))?.pendingPlan;
2148
+ return pendingPlan?.id === planId ? pendingPlan.operation : void 0;
2149
+ }
2150
+ /**
2111
2151
  * Stores the baseline of an app installed with only business configuration: the target config
2112
2152
  * without what needs installation, at the installed version, with no installed data.
2113
2153
  */
@@ -12,7 +12,7 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { n as HttpActionRouter, r as logger, t as SDK_LIB_VERSIONS_HEADERS } from "../../version-C-Pkqohl.mjs";
15
+ import { n as HttpActionRouter, r as logger, t as SDK_LIB_VERSIONS_HEADERS } from "../../version-BWgrh_QM.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
18
  import { r as nonEmptyStringValueSchema } from "../../schemas-DYMNbFdX.mjs";