@adobe/aio-commerce-lib-app 1.1.0 → 1.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 (40) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/actions/app-config.cjs +1 -1
  3. package/dist/cjs/actions/app-config.d.cts +3 -3
  4. package/dist/cjs/actions/config.cjs +1 -1
  5. package/dist/cjs/actions/config.d.cts +2 -2
  6. package/dist/cjs/actions/installation.cjs +1 -1
  7. package/dist/cjs/actions/installation.d.cts +4 -4
  8. package/dist/cjs/actions/scope-tree.d.cts +3 -3
  9. package/dist/cjs/{app-lymFcs59.d.cts → app-DcQMhW2N.d.cts} +13 -1
  10. package/dist/cjs/commands/index.cjs +3 -3
  11. package/dist/cjs/config/index.cjs +3 -3
  12. package/dist/cjs/config/index.d.cts +39 -3
  13. package/dist/cjs/{config-YEeaEqzi.cjs → config-BppBKCFj.cjs} +1 -1
  14. package/dist/{es/index-D33OCH0D.d.mts → cjs/index-DZxladgt.d.cts} +23 -8
  15. package/dist/cjs/management/index.cjs +1 -1
  16. package/dist/cjs/management/index.d.cts +1 -1
  17. package/dist/cjs/{management-PZtLe4Ji.cjs → management-iLQubQ7K.cjs} +93 -20
  18. package/dist/cjs/{validate-CwwYD8aC.cjs → validate-CeUCT_7k.cjs} +7 -3
  19. package/dist/cjs/{webhooks-CbZpv9y_.cjs → webhooks-CLtDxwMa.cjs} +33 -0
  20. package/dist/es/actions/app-config.d.mts +3 -3
  21. package/dist/es/actions/app-config.mjs +1 -1
  22. package/dist/es/actions/config.d.mts +2 -2
  23. package/dist/es/actions/config.mjs +2 -2
  24. package/dist/es/actions/installation.d.mts +4 -4
  25. package/dist/es/actions/installation.mjs +2 -2
  26. package/dist/es/actions/scope-tree.d.mts +3 -3
  27. package/dist/es/actions/scope-tree.mjs +1 -1
  28. package/dist/es/{app-Ct7Y0NP8.d.mts → app-DJr-mN9d.d.mts} +13 -1
  29. package/dist/es/commands/index.mjs +3 -3
  30. package/dist/es/config/index.d.mts +39 -3
  31. package/dist/es/config/index.mjs +3 -3
  32. package/dist/es/{config-BbrkH0Xt.mjs → config-BohwKkQS.mjs} +1 -1
  33. package/dist/{cjs/index-DRhLtRrX.d.cts → es/index-BmYXe7kp.d.mts} +23 -8
  34. package/dist/es/management/index.d.mts +1 -1
  35. package/dist/es/management/index.mjs +1 -1
  36. package/dist/es/{management-CIoVWirU.mjs → management-DSexEPTW.mjs} +93 -20
  37. package/dist/es/{validate-qRpfubPo.mjs → validate-CqJdGzyZ.mjs} +8 -4
  38. package/dist/es/{webhooks-NgM6k3_r.mjs → webhooks-CYo-pqbR.mjs} +23 -2
  39. package/package.json +4 -3
  40. /package/dist/es/{schemas-BvPxQwgQ.mjs → schemas-CVXHgUhv.mjs} +0 -0
@@ -12,8 +12,8 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { t as alphaNumericOrHyphenSchema } from "./schemas-BvPxQwgQ.mjs";
16
- import { a as hasCustomInstallationSteps, i as hasCustomInstallation, l as hasExternalEvents, n as hasWebhooks, o as EventingSchema, r as InstallationSchema, s as hasCommerceEvents, t as WebhooksSchema } from "./webhooks-NgM6k3_r.mjs";
15
+ import { a as hasCustomInstallationSteps, d as hasAdminUiSdk, i as hasCustomInstallation, l as hasExternalEvents, n as hasWebhooks, o as EventingSchema, r as InstallationSchema, s as hasCommerceEvents, t as WebhooksSchema, u as AdminUiSdkSchema } from "./webhooks-CYo-pqbR.mjs";
16
+ import { t as alphaNumericOrHyphenSchema } from "./schemas-CVXHgUhv.mjs";
17
17
  import { CommerceSdkValidationError } from "@adobe/aio-commerce-lib-core/error";
18
18
  import * as v from "valibot";
19
19
  import { SchemaBusinessConfig } from "@adobe/aio-commerce-lib-config";
@@ -36,6 +36,7 @@ function hasBusinessConfigSchema(config) {
36
36
 
37
37
  //#endregion
38
38
  //#region source/config/schema/metadata.ts
39
+ const MAX_ID_LENGTH = 100;
39
40
  const MAX_DESCRIPTION_LENGTH = 255;
40
41
  const MAX_DISPLAY_NAME_LENGTH = 50;
41
42
  const NUMERIC_IDENTIFIER = "(0|[1-9]\\d*)";
@@ -45,7 +46,7 @@ function nonEmptyString(fieldName) {
45
46
  }
46
47
  /** The schema for the metadata of the application. */
47
48
  const MetadataSchema = v.object({
48
- id: alphaNumericOrHyphenSchema("application id (metadata.id)"),
49
+ id: v.pipe(alphaNumericOrHyphenSchema("application id (metadata.id)"), v.maxLength(MAX_ID_LENGTH, `The application id must not be longer than ${MAX_ID_LENGTH} characters`)),
49
50
  displayName: v.pipe(nonEmptyString("application display name"), v.maxLength(MAX_DISPLAY_NAME_LENGTH, `The application display name must not be longer than ${MAX_DISPLAY_NAME_LENGTH} characters`)),
50
51
  description: v.pipe(nonEmptyString("metadata description"), v.maxLength(MAX_DESCRIPTION_LENGTH, `The metadata description must not be longer than ${MAX_DESCRIPTION_LENGTH} characters`)),
51
52
  version: v.pipe(nonEmptyString("version"), v.regex(SEMVER_REGEX, "The version must follow semantic versioning (semver) format: Major.Minor.Patch (e.g., '1.0.0', '2.3.1')"))
@@ -66,6 +67,7 @@ const CommerceAppConfigSchema = v.looseObject({
66
67
  metadata: MetadataSchema,
67
68
  businessConfig: v.optional(SchemaBusinessConfig),
68
69
  eventing: v.optional(EventingSchema),
70
+ adminUiSdk: v.optional(AdminUiSdkSchema),
69
71
  installation: v.optional(InstallationSchema),
70
72
  webhooks: v.optional(WebhooksSchema)
71
73
  });
@@ -82,7 +84,8 @@ const CommerceAppConfigSchemas = {
82
84
  "businessConfig.schema": v.unwrap(SchemaBusinessConfig.entries.schema),
83
85
  "eventing.commerce": v.unwrap(EventingSchema.entries.commerce),
84
86
  "eventing.external": v.unwrap(EventingSchema.entries.external),
85
- "installation.customInstallationSteps": v.unwrap(InstallationSchema.entries.customInstallationSteps)
87
+ "installation.customInstallationSteps": v.unwrap(InstallationSchema.entries.customInstallationSteps),
88
+ adminUiSdk: AdminUiSdkSchema
86
89
  };
87
90
  /**
88
91
  * Get the config domains that are present in the config.
@@ -97,6 +100,7 @@ function getConfigDomains(config) {
97
100
  eventing: withCommerceEvents || withExternalEvents,
98
101
  installation: hasCustomInstallation(config),
99
102
  webhooks: hasWebhooks(config),
103
+ adminUiSdk: hasAdminUiSdk(config),
100
104
  "businessConfig.schema": hasBusinessConfigSchema(config),
101
105
  "eventing.commerce": withCommerceEvents,
102
106
  "eventing.external": withExternalEvents,
@@ -12,9 +12,30 @@
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
14
 
15
- import { a as stringValueSchema, i as positiveNumberValueSchema, n as booleanValueSchema, r as nonEmptyStringValueSchema, t as alphaNumericOrHyphenSchema } from "./schemas-BvPxQwgQ.mjs";
15
+ import { a as stringValueSchema, i as positiveNumberValueSchema, n as booleanValueSchema, r as nonEmptyStringValueSchema, t as alphaNumericOrHyphenSchema } from "./schemas-CVXHgUhv.mjs";
16
16
  import * as v from "valibot";
17
17
 
18
+ //#region source/config/schema/admin-ui-sdk.ts
19
+ /**
20
+ * Schema for the Admin UI SDK registration parameters (for the `adminUiSdk.registration` config section).
21
+ * @see https://developer.adobe.com/commerce/extensibility/admin-ui-sdk/extension-points/ for more details.
22
+ */
23
+ const AdminUiSdkRegistrationSchema = v.object({ menuItems: v.array(v.object({
24
+ id: v.string(),
25
+ title: v.optional(v.string()),
26
+ parent: v.optional(v.string()),
27
+ sortOrder: v.optional(v.number()),
28
+ sandbox: v.optional(v.string()),
29
+ isSection: v.optional(v.boolean())
30
+ })) });
31
+ /** Schema for Admin UI SDK configuration. */
32
+ const AdminUiSdkSchema = v.object({ registration: AdminUiSdkRegistrationSchema });
33
+ /** Check if config has Admin UI SDK registration configuration. */
34
+ function hasAdminUiSdk(config) {
35
+ return config.adminUiSdk !== void 0 && config.adminUiSdk.registration !== void 0;
36
+ }
37
+
38
+ //#endregion
18
39
  //#region source/config/schema/eventing.ts
19
40
  const MAX_DESCRIPTION_LENGTH$1 = 255;
20
41
  const MAX_LABEL_LENGTH = 100;
@@ -290,4 +311,4 @@ function hasWebhooks(config) {
290
311
  }
291
312
 
292
313
  //#endregion
293
- export { hasCustomInstallationSteps as a, hasEventing as c, hasCustomInstallation as i, hasExternalEvents as l, hasWebhooks as n, EventingSchema as o, InstallationSchema as r, hasCommerceEvents as s, WebhooksSchema as t };
314
+ export { hasCustomInstallationSteps as a, hasEventing as c, hasAdminUiSdk as d, hasCustomInstallation as i, hasExternalEvents as l, hasWebhooks as n, EventingSchema as o, InstallationSchema as r, hasCommerceEvents as s, WebhooksSchema as t, AdminUiSdkSchema as u };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@adobe/aio-commerce-lib-app",
3
3
  "type": "module",
4
4
  "author": "Adobe Inc.",
5
- "version": "1.1.0",
5
+ "version": "1.2.0",
6
6
  "private": false,
7
7
  "engines": {
8
8
  "node": ">=20 <=24"
@@ -96,18 +96,19 @@
96
96
  "yaml": "^2.8.1",
97
97
  "@adobe/aio-commerce-lib-api": "1.0.1",
98
98
  "@adobe/aio-commerce-lib-auth": "1.0.1",
99
- "@adobe/aio-commerce-lib-config": "1.0.3",
99
+ "@adobe/aio-commerce-lib-config": "1.1.0",
100
100
  "@adobe/aio-commerce-lib-core": "1.0.0",
101
101
  "@adobe/aio-commerce-lib-events": "1.0.1",
102
102
  "@adobe/aio-commerce-lib-webhooks": "0.1.0"
103
103
  },
104
104
  "devDependencies": {
105
+ "msw": "^2.11.1",
105
106
  "typescript": "^5.9.3",
106
107
  "@aio-commerce-sdk/common-utils": "0.2.3",
107
- "@aio-commerce-sdk/config-tsdown": "1.0.1",
108
108
  "@aio-commerce-sdk/config-typedoc": "1.0.0",
109
109
  "@aio-commerce-sdk/config-typescript": "1.0.0",
110
110
  "@aio-commerce-sdk/config-vitest": "1.0.0",
111
+ "@aio-commerce-sdk/config-tsdown": "1.0.1",
111
112
  "@aio-commerce-sdk/scripting-utils": "0.3.0",
112
113
  "@aio-commerce-sdk/scripts": "0.1.0"
113
114
  },