@adobe/aio-commerce-lib-app 2.0.0 → 2.0.1-alpha-20260923160203

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 (69) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +4 -0
  3. package/dist/cjs/actions/app-config/index.cjs +3 -3
  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/installation/index.cjs +4 -4
  7. package/dist/cjs/actions/scope-tree/index.cjs +4 -3
  8. package/dist/cjs/cli/index.cjs +393 -0
  9. package/dist/cjs/cli/index.d.cts +31 -0
  10. package/dist/cjs/commands/index.cjs +73 -1717
  11. package/dist/cjs/{common-VSsQEHDv.cjs → common-B3KrOG-h.cjs} +1 -1
  12. package/dist/cjs/config/index.node.cjs +3 -3
  13. package/dist/{es/logging-CXesop3u.mjs → cjs/constants-tQUzmimN.cjs} +6 -18
  14. package/dist/cjs/{index.node-vcOo1rt0.cjs → index.node-DwuJfAiP.cjs} +1 -1
  15. package/dist/cjs/{logging-Br3xfBNe.cjs → logging-QTsrSwPc.cjs} +0 -16
  16. package/dist/cjs/management/index.cjs +1 -1
  17. package/dist/cjs/{management-Bki3hlxL.cjs → management-DplOGozL.cjs} +11 -10
  18. package/dist/cjs/{validate-CwWYtRsS.cjs → validate-DkmBVWFX.cjs} +1 -1
  19. package/dist/cjs/web-src-CCzvhSf0.cjs +1515 -0
  20. package/dist/cjs/{webhooks-Bcq2Qy7q.cjs → webhooks-zXjrg32x.cjs} +57 -57
  21. package/dist/es/actions/app-config/index.mjs +3 -3
  22. package/dist/es/actions/association/index.mjs +1 -1
  23. package/dist/es/actions/config/index.mjs +1 -1
  24. package/dist/es/actions/installation/index.mjs +4 -4
  25. package/dist/es/actions/scope-tree/index.mjs +3 -2
  26. package/dist/es/cli/index.d.mts +31 -0
  27. package/dist/es/cli/index.mjs +381 -0
  28. package/dist/es/commands/index.mjs +29 -1666
  29. package/dist/es/{common-dy6NrZt8.mjs → common-BWUDGasu.mjs} +1 -1
  30. package/dist/es/config/index.node.mjs +3 -3
  31. package/dist/es/constants-CSQsZaDP.mjs +25 -0
  32. package/dist/es/{index.node-CW46zuxW.mjs → index.node-DPiidKGS.mjs} +1 -1
  33. package/dist/es/logging-DbJHXSKh.mjs +32 -0
  34. package/dist/es/management/index.mjs +1 -1
  35. package/dist/es/{management-DgwAhaaJ.mjs → management-YDkb15SJ.mjs} +6 -5
  36. package/dist/es/{validate-NzW1FQwL.mjs → validate-Pd7RIA_3.mjs} +1 -1
  37. package/dist/es/web-src-CM_09qwk.mjs +1345 -0
  38. package/dist/es/{webhooks-CHZ1SXxw.mjs → webhooks-BMBfTqwi.mjs} +58 -58
  39. package/package.json +11 -1
  40. /package/dist/cjs/{commands/templates → templates}/admin-ui/tsconfig.json +0 -0
  41. /package/dist/cjs/{commands/templates → templates}/admin-ui/web-src/.babelrc +0 -0
  42. /package/dist/cjs/{commands/templates → templates}/admin-ui/web-src/index.css +0 -0
  43. /package/dist/cjs/{commands/templates → templates}/admin-ui/web-src/index.html +0 -0
  44. /package/dist/cjs/{commands/templates → templates}/admin-ui/web-src/src/app.jsx +0 -0
  45. /package/dist/cjs/{commands/templates → templates}/admin-ui/web-src/src/components/welcome.jsx +0 -0
  46. /package/dist/cjs/{commands/templates → templates}/admin-ui/web-src/src/pages/main-page.jsx +0 -0
  47. /package/dist/cjs/{commands/templates → templates}/admin-ui/web-src-template.d.ts +0 -0
  48. /package/dist/cjs/{commands/templates → templates}/app-management/app-config.js.template +0 -0
  49. /package/dist/cjs/{commands/templates → templates}/app-management/association.js.template +0 -0
  50. /package/dist/cjs/{commands/templates → templates}/app-management/custom-scripts.js.template +0 -0
  51. /package/dist/cjs/{commands/templates → templates}/app-management/installation.js.template +0 -0
  52. /package/dist/cjs/{commands/templates → templates}/business-configuration/config.js.template +0 -0
  53. /package/dist/cjs/{commands/templates → templates}/business-configuration/scope-tree.js.template +0 -0
  54. /package/dist/cjs/{commands/templates → templates}/typescript/webpack-config.cjs +0 -0
  55. /package/dist/es/{commands/templates → templates}/admin-ui/tsconfig.json +0 -0
  56. /package/dist/es/{commands/templates → templates}/admin-ui/web-src/.babelrc +0 -0
  57. /package/dist/es/{commands/templates → templates}/admin-ui/web-src/index.css +0 -0
  58. /package/dist/es/{commands/templates → templates}/admin-ui/web-src/index.html +0 -0
  59. /package/dist/es/{commands/templates → templates}/admin-ui/web-src/src/app.jsx +0 -0
  60. /package/dist/es/{commands/templates → templates}/admin-ui/web-src/src/components/welcome.jsx +0 -0
  61. /package/dist/es/{commands/templates → templates}/admin-ui/web-src/src/pages/main-page.jsx +0 -0
  62. /package/dist/es/{commands/templates → templates}/admin-ui/web-src-template.d.ts +0 -0
  63. /package/dist/es/{commands/templates → templates}/app-management/app-config.js.template +0 -0
  64. /package/dist/es/{commands/templates → templates}/app-management/association.js.template +0 -0
  65. /package/dist/es/{commands/templates → templates}/app-management/custom-scripts.js.template +0 -0
  66. /package/dist/es/{commands/templates → templates}/app-management/installation.js.template +0 -0
  67. /package/dist/es/{commands/templates → templates}/business-configuration/config.js.template +0 -0
  68. /package/dist/es/{commands/templates → templates}/business-configuration/scope-tree.js.template +0 -0
  69. /package/dist/es/{commands/templates → templates}/typescript/webpack-config.cjs +0 -0
@@ -18,6 +18,60 @@ import { sanitizeSegment } from "@adobe/aio-commerce-lib-admin-ui/api";
18
18
  import { COMMERCE_MENUS } from "@adobe/aio-commerce-lib-admin-ui/menu";
19
19
  import { CommerceEnvArraySchema } from "@adobe/aio-commerce-lib-core/commerce";
20
20
 
21
+ //#region source/config/schema/installation.ts
22
+ const MAX_DESCRIPTION_LENGTH$1 = 255;
23
+ const MAX_NAME_LENGTH = 255;
24
+ const MAX_MESSAGE_LENGTH = 1e3;
25
+ /**
26
+ * Regex for script paths that can be relative or absolute.
27
+ * Must end with a .js or .ts extension
28
+ * Examples:
29
+ * - "./scripts/setup.js"
30
+ * - "./setup.ts"
31
+ * - "../../scripts/setup.js"
32
+ */
33
+ const SCRIPT_PATH_REGEX = /^(?:\.{0,2}\/)*(?:[\w-]+\/)*[\w-]+\.(?:js|ts)$/;
34
+ /**
35
+ * Schema for custom installation step configuration
36
+ */
37
+ const CustomInstallationStepSchema = v.object({
38
+ description: v.pipe(nonEmptyStringValueSchema("step description"), v.maxLength(MAX_DESCRIPTION_LENGTH$1, `The step description must not be longer than ${MAX_DESCRIPTION_LENGTH$1} characters`)),
39
+ name: v.pipe(nonEmptyStringValueSchema("step name"), v.maxLength(MAX_NAME_LENGTH, `The step name must not be longer than ${MAX_NAME_LENGTH} characters`)),
40
+ script: v.pipe(nonEmptyStringValueSchema("script path"), v.regex(SCRIPT_PATH_REGEX, "Script path must end with .js or .ts (e.g., \"./setup.js\", \"./scripts/setup.ts\", or \"../../scripts/setup.js\")"))
41
+ });
42
+ /**
43
+ * Schema for installation messages configuration
44
+ */
45
+ const MessagesSchema = v.object({
46
+ postInstallation: v.optional(v.pipe(nonEmptyStringValueSchema("postInstallation message"), v.maxLength(MAX_MESSAGE_LENGTH, `The postInstallation message must not be longer than ${MAX_MESSAGE_LENGTH} characters`))),
47
+ preInstallation: v.optional(v.pipe(nonEmptyStringValueSchema("preInstallation message"), v.maxLength(MAX_MESSAGE_LENGTH, `The preInstallation message must not be longer than ${MAX_MESSAGE_LENGTH} characters`)))
48
+ });
49
+ /**
50
+ * Schema for installation configuration
51
+ */
52
+ const InstallationSchema = v.object({
53
+ customInstallationSteps: v.pipe(v.optional(v.array(CustomInstallationStepSchema, "Expected an array of custom installation steps")), v.check((input) => {
54
+ const steps = input || [];
55
+ return new Set(steps.map((step) => step.name)).size === steps.length;
56
+ }, "Duplicate step names detected in custom installation steps. Each step must have a unique name.")),
57
+ messages: v.optional(MessagesSchema)
58
+ });
59
+ /**
60
+ * Check if config has custom installation settings.
61
+ * @param config - The configuration to check.
62
+ */
63
+ function hasCustomInstallation(config) {
64
+ return config.installation !== void 0;
65
+ }
66
+ /**
67
+ * Check if config has custom installation steps.
68
+ * @param config - The configuration to check.
69
+ */
70
+ function hasCustomInstallationSteps(config) {
71
+ return Array.isArray(config?.installation?.customInstallationSteps) && config.installation.customInstallationSteps.length > 0;
72
+ }
73
+
74
+ //#endregion
21
75
  //#region source/config/schema/admin-ui.ts
22
76
  /**
23
77
  * Whether the given items have distinct ids once Commerce sanitizes them into resource ids.
@@ -227,7 +281,7 @@ function hasAdminUi(config) {
227
281
 
228
282
  //#endregion
229
283
  //#region source/config/schema/eventing.ts
230
- const MAX_DESCRIPTION_LENGTH$1 = 255;
284
+ const MAX_DESCRIPTION_LENGTH = 255;
231
285
  const MAX_LABEL_LENGTH = 100;
232
286
  const MAX_KEY_LENGTH = 50;
233
287
  const MAX_EVENT_NAME_LENGTH = 180;
@@ -296,13 +350,13 @@ function commerceEventFieldSchema() {
296
350
  }
297
351
  /** Schema for event provider configuration */
298
352
  const ProviderSchema = v.object({
299
- description: v.pipe(nonEmptyStringValueSchema("provider description"), ioEventsTextSchema("Provider description"), v.maxLength(MAX_DESCRIPTION_LENGTH$1, `The provider description must not be longer than ${MAX_DESCRIPTION_LENGTH$1} characters`)),
353
+ description: v.pipe(nonEmptyStringValueSchema("provider description"), ioEventsTextSchema("Provider description"), v.maxLength(MAX_DESCRIPTION_LENGTH, `The provider description must not be longer than ${MAX_DESCRIPTION_LENGTH} characters`)),
300
354
  key: v.optional(v.pipe(alphaNumericOrHyphenSchema("provider key"), v.maxLength(MAX_KEY_LENGTH, `The provider key must not be longer than ${MAX_KEY_LENGTH} characters`))),
301
355
  label: v.pipe(nonEmptyStringValueSchema("provider label"), ioEventsTextSchema("Provider label"), v.maxLength(MAX_LABEL_LENGTH, `The provider label must not be longer than ${MAX_LABEL_LENGTH} characters`))
302
356
  });
303
357
  /** Schema for base shared properties between event types. */
304
358
  const BaseEventSchema = v.object({
305
- description: v.pipe(nonEmptyStringValueSchema("event description"), ioEventsTextSchema("Event description"), v.maxLength(MAX_DESCRIPTION_LENGTH$1, `The event description must not be longer than ${MAX_DESCRIPTION_LENGTH$1} characters`)),
359
+ description: v.pipe(nonEmptyStringValueSchema("event description"), ioEventsTextSchema("Event description"), v.maxLength(MAX_DESCRIPTION_LENGTH, `The event description must not be longer than ${MAX_DESCRIPTION_LENGTH} characters`)),
306
360
  env: v.optional(CommerceEnvArraySchema),
307
361
  label: v.pipe(nonEmptyStringValueSchema("event label"), ioEventsTextSchema("Event label"), v.maxLength(MAX_LABEL_LENGTH, `The event label must not be longer than ${MAX_LABEL_LENGTH} characters`)),
308
362
  runtimeActions: v.array(v.pipe(nonEmptyStringValueSchema("runtime action"), v.regex(/^[a-z0-9-]+\/[a-z0-9-]+$/i, "Runtime action must be in the format \"<package>/<action>\" (e.g., \"my-package/my-action\")")), "Expected an array of runtime actions in the format <package>/<action>")
@@ -380,60 +434,6 @@ function hasEventing(config) {
380
434
  return config.eventing !== void 0;
381
435
  }
382
436
 
383
- //#endregion
384
- //#region source/config/schema/installation.ts
385
- const MAX_DESCRIPTION_LENGTH = 255;
386
- const MAX_NAME_LENGTH = 255;
387
- const MAX_MESSAGE_LENGTH = 1e3;
388
- /**
389
- * Regex for script paths that can be relative or absolute.
390
- * Must end with a .js or .ts extension
391
- * Examples:
392
- * - "./scripts/setup.js"
393
- * - "./setup.ts"
394
- * - "../../scripts/setup.js"
395
- */
396
- const SCRIPT_PATH_REGEX = /^(?:\.{0,2}\/)*(?:[\w-]+\/)*[\w-]+\.(?:js|ts)$/;
397
- /**
398
- * Schema for custom installation step configuration
399
- */
400
- const CustomInstallationStepSchema = v.object({
401
- description: v.pipe(nonEmptyStringValueSchema("step description"), v.maxLength(MAX_DESCRIPTION_LENGTH, `The step description must not be longer than ${MAX_DESCRIPTION_LENGTH} characters`)),
402
- name: v.pipe(nonEmptyStringValueSchema("step name"), v.maxLength(MAX_NAME_LENGTH, `The step name must not be longer than ${MAX_NAME_LENGTH} characters`)),
403
- script: v.pipe(nonEmptyStringValueSchema("script path"), v.regex(SCRIPT_PATH_REGEX, "Script path must end with .js or .ts (e.g., \"./setup.js\", \"./scripts/setup.ts\", or \"../../scripts/setup.js\")"))
404
- });
405
- /**
406
- * Schema for installation messages configuration
407
- */
408
- const MessagesSchema = v.object({
409
- postInstallation: v.optional(v.pipe(nonEmptyStringValueSchema("postInstallation message"), v.maxLength(MAX_MESSAGE_LENGTH, `The postInstallation message must not be longer than ${MAX_MESSAGE_LENGTH} characters`))),
410
- preInstallation: v.optional(v.pipe(nonEmptyStringValueSchema("preInstallation message"), v.maxLength(MAX_MESSAGE_LENGTH, `The preInstallation message must not be longer than ${MAX_MESSAGE_LENGTH} characters`)))
411
- });
412
- /**
413
- * Schema for installation configuration
414
- */
415
- const InstallationSchema = v.object({
416
- customInstallationSteps: v.pipe(v.optional(v.array(CustomInstallationStepSchema, "Expected an array of custom installation steps")), v.check((input) => {
417
- const steps = input || [];
418
- return new Set(steps.map((step) => step.name)).size === steps.length;
419
- }, "Duplicate step names detected in custom installation steps. Each step must have a unique name.")),
420
- messages: v.optional(MessagesSchema)
421
- });
422
- /**
423
- * Check if config has custom installation settings.
424
- * @param config - The configuration to check.
425
- */
426
- function hasCustomInstallation(config) {
427
- return config.installation !== void 0;
428
- }
429
- /**
430
- * Check if config has custom installation steps.
431
- * @param config - The configuration to check.
432
- */
433
- function hasCustomInstallationSteps(config) {
434
- return Array.isArray(config?.installation?.customInstallationSteps) && config.installation.customInstallationSteps.length > 0;
435
- }
436
-
437
437
  //#endregion
438
438
  //#region source/config/schema/webhooks.ts
439
439
  /** Schema for webhook field configuration (name and optional source). */
@@ -527,4 +527,4 @@ function hasWebhooks(config) {
527
527
  }
528
528
 
529
529
  //#endregion
530
- export { hasCustomInstallationSteps as a, hasEventing as c, hasAdminUi as d, hasBackendUiV2Components as f, hasCustomInstallation as i, hasExternalEvents as l, hasWebhooks as n, EventingSchema as o, InstallationSchema as r, hasCommerceEvents as s, WebhooksSchema as t, AdminUiSchema as u };
530
+ export { hasEventing as a, hasAdminUi as c, hasCustomInstallation as d, hasCustomInstallationSteps as f, hasCommerceEvents as i, hasBackendUiV2Components as l, hasWebhooks as n, hasExternalEvents as o, EventingSchema as r, AdminUiSchema as s, WebhooksSchema as t, InstallationSchema as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/aio-commerce-lib-app",
3
- "version": "2.0.0",
3
+ "version": "2.0.1-alpha-20260923160203",
4
4
  "private": false,
5
5
  "description": "App configuration management library for Adobe Commerce applications",
6
6
  "keywords": [
@@ -55,6 +55,16 @@
55
55
  "default": "./dist/cjs/actions/*/index.cjs"
56
56
  }
57
57
  },
58
+ "./cli": {
59
+ "import": {
60
+ "types": "./dist/es/cli/index.d.mts",
61
+ "default": "./dist/es/cli/index.mjs"
62
+ },
63
+ "require": {
64
+ "types": "./dist/cjs/cli/index.d.cts",
65
+ "default": "./dist/cjs/cli/index.cjs"
66
+ }
67
+ },
58
68
  "./config": {
59
69
  "browser": {
60
70
  "types": "./dist/es/config/index.browser.d.mts",