@adobe/aio-cli-plugin-api-mesh 5.2.4-alpha.0 → 5.3.0-beta.1

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 (39) hide show
  1. package/oclif.manifest.json +1 -1
  2. package/package.json +13 -6
  3. package/src/commands/api-mesh/__tests__/cache-purge.test.js +1 -2
  4. package/src/commands/api-mesh/__tests__/create.test.js +19 -22
  5. package/src/commands/api-mesh/__tests__/delete-log-forwarding.test.js +106 -0
  6. package/src/commands/api-mesh/__tests__/delete.test.js +1 -2
  7. package/src/commands/api-mesh/__tests__/describe.test.js +1 -3
  8. package/src/commands/api-mesh/__tests__/get.test.js +2 -2
  9. package/src/commands/api-mesh/__tests__/log-get-bulk.test.js +19 -213
  10. package/src/commands/api-mesh/__tests__/run.test.js +191 -65
  11. package/src/commands/api-mesh/__tests__/update.test.js +8 -7
  12. package/src/commands/api-mesh/cache/purge.js +1 -3
  13. package/src/commands/api-mesh/config/delete/log-forwarding.js +80 -0
  14. package/src/commands/api-mesh/create.js +22 -6
  15. package/src/commands/api-mesh/delete.js +1 -3
  16. package/src/commands/api-mesh/describe.js +1 -3
  17. package/src/commands/api-mesh/get.js +1 -3
  18. package/src/commands/api-mesh/log-get-bulk.js +5 -26
  19. package/src/commands/api-mesh/log-get.js +1 -3
  20. package/src/commands/api-mesh/log-list.js +1 -3
  21. package/src/commands/api-mesh/run.js +207 -168
  22. package/src/commands/api-mesh/source/discover.js +2 -9
  23. package/src/commands/api-mesh/source/get.js +1 -8
  24. package/src/commands/api-mesh/source/install.js +1 -2
  25. package/src/commands/api-mesh/status.js +1 -2
  26. package/src/commands/api-mesh/update.js +21 -6
  27. package/src/commands/{PLUGINNAME/__tests__/index.test.js → api-mesh.js} +13 -15
  28. package/src/helpers.js +73 -15
  29. package/src/hooks/initMetadata.js +8 -0
  30. package/src/lib/smsClient.js +115 -1
  31. package/src/meshArtifact.js +231 -0
  32. package/src/project.js +56 -0
  33. package/src/server.js +74 -32
  34. package/src/utils.js +26 -24
  35. package/src/{index.js → worker.js} +9 -7
  36. package/src/wranglerCli.js +54 -0
  37. package/wrangler.toml +13 -0
  38. package/src/commands/PLUGINNAME/index.js +0 -32
  39. package/src/wranglerServer.js +0 -80
@@ -1 +1 @@
1
- {"version":"5.2.4-alpha.0","commands":{"PLUGINNAME":{"id":"PLUGINNAME","description":"Your description here","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":["$ aio PLUGINNAME:some_command"],"flags":{"someflag":{"name":"someflag","type":"option","char":"f","description":"this is some flag"}},"args":[]},"api-mesh:create":{"id":"api-mesh:create","description":"Create a mesh with the given config.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file"}]},"api-mesh:delete":{"id":"api-mesh:delete","description":"Delete the config of a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false}},"args":[]},"api-mesh:describe":{"id":"api-mesh:describe","description":"Get details of a mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[]},"api-mesh:get":{"id":"api-mesh:get","description":"Get the config of a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false}},"args":[{"name":"file"}]},"api-mesh:init":{"id":"api-mesh:init","description":"This command will create a workspace where you can organise your API mesh configuration and other files","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":[{"description":"API mesh workspace init","command":"aio api-mesh init commerce-mesh"},{"description":"API mesh workspace init with flags","command":"aio api-mesh init commerce-mesh --path ./mesh_projects/test_mesh --git y --packageManager yarn"}],"flags":{"path":{"name":"path","type":"option","char":"p","default":"."},"packageManager":{"name":"packageManager","type":"option","char":"m","options":["npm","yarn"]},"git":{"name":"git","type":"option","char":"g","options":["y","n"]}},"args":[{"name":"projectName","description":"Project name","required":true}]},"api-mesh:log-get-bulk":{"id":"api-mesh:log-get-bulk","description":"Download all mesh logs for a selected time period.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"startTime":{"name":"startTime","type":"option","description":"Start time for the logs in UTC"},"endTime":{"name":"endTime","type":"option","description":"End time for the logs in UTC"},"filename":{"name":"filename","type":"option","description":"Path to the output file for logs","required":true},"past":{"name":"past","type":"option","description":"Past time window in mins"},"from":{"name":"from","type":"option","description":"The from time in YYYY-MM-DD:HH:MM:SS format based on your system's time zone. It is used to fetch logs from the past and is the starting time for the past time duration."}},"args":[]},"api-mesh:log-get":{"id":"api-mesh:log-get","description":"Get the Log of a given mesh by RayId","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[{"name":"rayId","description":"Fetch a single log by rayID","required":true}]},"api-mesh:log-list":{"id":"api-mesh:log-list","description":"Get recent logs of requests made to the API Mesh.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"filename":{"name":"filename","type":"option","description":"Name of CSV file to export the recent logs to"}},"args":[]},"api-mesh:run":{"id":"api-mesh:run","description":"Run a local development server that builds and compiles a mesh locally","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"Port number for the local dev server"},"debug":{"name":"debug","type":"boolean","description":"Enable debugging mode","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"select":{"name":"select","type":"boolean","description":"Retrieve existing artifacts from the mesh","allowNo":false},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file","description":"Mesh File"}]},"api-mesh:status":{"id":"api-mesh:status","description":"Get a mesh status with a given meshid.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[]},"api-mesh:update":{"id":"api-mesh:update","description":"Update a mesh with the given config.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file"}]},"api-mesh:cache:purge":{"id":"api-mesh:cache:purge","description":"Cache purge for a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"all":{"name":"all","type":"boolean","char":"a","description":"Purge all cache. CLI will purge all cache data.","required":true,"allowNo":false}},"args":[]},"api-mesh:source:discover":{"id":"api-mesh:source:discover","description":"Return the list of avaliable sources","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm install action prompt. CLI will not check ask user to install source.","allowNo":false}},"args":[]},"api-mesh:source:get":{"id":"api-mesh:source:get","description":"Command returns the content of a specific source.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":["$ aio api-mesh:source:get -s=<version>@<source_name>","$ aio api-mesh:source:get -s<source_name>","$ aio api-mesh:source:get -m"],"flags":{"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm print action prompt. CLI will not check ask user to print source.","allowNo":false},"source":{"name":"source","type":"option","char":"s","description":"Source name"},"multiple":{"name":"multiple","type":"boolean","char":"m","description":"Select multiple sources","allowNo":false}},"args":[]},"api-mesh:source:install":{"id":"api-mesh:source:install","description":"Command to install the source to your API mesh.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":["$ aio api-mesh:source:install <version>@<source_name>","$ aio api-mesh:source:install <source_name> -v <variable_name>=<variable_value>","$ aio api-mesh:source:install <source_name> -f <path_to_variables_file>"],"flags":{"source":{"name":"source","type":"option","char":"s","description":"Source name"},"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm override action prompt. CLI will not check ask user to override source.","allowNo":false},"variable":{"name":"variable","type":"option","char":"v","description":"Variables required for the source"},"variable-file":{"name":"variable-file","type":"option","char":"f","description":"Variables file path"},"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[{"name":"source"}]},"api-mesh:config:get:log-forwarding":{"id":"api-mesh:config:get:log-forwarding","description":"Get log forwarding details for a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false}},"args":[]},"api-mesh:config:set:log-forwarding":{"id":"api-mesh:config:set:log-forwarding","description":"Sets the log forwarding destination for API mesh. \n- Select a log forwarding destination - Choose from available options (for example, New Relic).\n- Enter the base URI - Provide the URI for the log forwarding service. Ensure it includes the protocol (for example, if the hosted region of the New Relic account is the U.S, the base URI could be 'https://log-api.newrelic.com/log/v1').\n- Enter the license key - Provide the INGEST-LICENSE API key type.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false}},"args":[]}}}
1
+ {"version":"5.3.0-beta.1","commands":{"api-mesh":{"id":"api-mesh","description":"Create, run, test, and deploy API Mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{},"args":[]},"api-mesh:create":{"id":"api-mesh:create","description":"Create a mesh with the given config.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file"}]},"api-mesh:delete":{"id":"api-mesh:delete","description":"Delete the config of a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false}},"args":[]},"api-mesh:describe":{"id":"api-mesh:describe","description":"Get details of a mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[]},"api-mesh:get":{"id":"api-mesh:get","description":"Get the config of a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false}},"args":[{"name":"file"}]},"api-mesh:init":{"id":"api-mesh:init","description":"This command will create a workspace where you can organise your API mesh configuration and other files","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":[{"description":"API mesh workspace init","command":"aio api-mesh init commerce-mesh"},{"description":"API mesh workspace init with flags","command":"aio api-mesh init commerce-mesh --path ./mesh_projects/test_mesh --git y --packageManager yarn"}],"flags":{"path":{"name":"path","type":"option","char":"p","default":"."},"packageManager":{"name":"packageManager","type":"option","char":"m","options":["npm","yarn"]},"git":{"name":"git","type":"option","char":"g","options":["y","n"]}},"args":[{"name":"projectName","description":"Project name","required":true}]},"api-mesh:log-get-bulk":{"id":"api-mesh:log-get-bulk","description":"Download all mesh logs for a selected time period.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"startTime":{"name":"startTime","type":"option","description":"Start time for the logs in UTC"},"endTime":{"name":"endTime","type":"option","description":"End time for the logs in UTC"},"filename":{"name":"filename","type":"option","description":"Path to the output file for logs","required":true},"past":{"name":"past","type":"option","description":"Past time window in minutes"}},"args":[]},"api-mesh:log-get":{"id":"api-mesh:log-get","description":"Get the Log of a given mesh by RayId","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[{"name":"rayId","description":"Fetch a single log by rayID","required":true}]},"api-mesh:log-list":{"id":"api-mesh:log-list","description":"Get recent logs of requests made to the API Mesh.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"filename":{"name":"filename","type":"option","description":"Name of CSV file to export the recent logs to"}},"args":[]},"api-mesh:run":{"id":"api-mesh:run","description":"Run a local development server that builds and compiles a mesh locally","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"Port number for the local dev server","default":5000},"inspectPort":{"name":"inspectPort","type":"option","char":"i","description":"Port number for the local dev server inspector","default":9229},"debug":{"name":"debug","type":"boolean","description":"Enable debugging mode","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"select":{"name":"select","type":"boolean","description":"Retrieve existing artifacts from the mesh","allowNo":false},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file","description":"Mesh File"}]},"api-mesh:status":{"id":"api-mesh:status","description":"Get a mesh status with a given meshid.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[]},"api-mesh:update":{"id":"api-mesh:update","description":"Update a mesh with the given config.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"env":{"name":"env","type":"option","char":"e","description":"Path to env file","default":".env"},"secrets":{"name":"secrets","type":"option","char":"s","description":"Path to secrets file","default":false}},"args":[{"name":"file"}]},"api-mesh:cache:purge":{"id":"api-mesh:cache:purge","description":"Cache purge for a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"all":{"name":"all","type":"boolean","char":"a","description":"Purge all cache. CLI will purge all cache data.","required":true,"allowNo":false}},"args":[]},"api-mesh:source:discover":{"id":"api-mesh:source:discover","description":"Return the list of avaliable sources","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm install action prompt. CLI will not check ask user to install source.","allowNo":false}},"args":[]},"api-mesh:source:get":{"id":"api-mesh:source:get","description":"Command returns the content of a specific source.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":["$ aio api-mesh:source:get -s=<version>@<source_name>","$ aio api-mesh:source:get -s<source_name>","$ aio api-mesh:source:get -m"],"flags":{"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm print action prompt. CLI will not check ask user to print source.","allowNo":false},"source":{"name":"source","type":"option","char":"s","description":"Source name"},"multiple":{"name":"multiple","type":"boolean","char":"m","description":"Select multiple sources","allowNo":false}},"args":[]},"api-mesh:source:install":{"id":"api-mesh:source:install","description":"Command to install the source to your API mesh.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"examples":["$ aio api-mesh:source:install <version>@<source_name>","$ aio api-mesh:source:install <source_name> -v <variable_name>=<variable_value>","$ aio api-mesh:source:install <source_name> -f <path_to_variables_file>"],"flags":{"source":{"name":"source","type":"option","char":"s","description":"Source name"},"confirm":{"name":"confirm","type":"boolean","char":"c","description":"Auto confirm override action prompt. CLI will not check ask user to override source.","allowNo":false},"variable":{"name":"variable","type":"option","char":"v","description":"Variables required for the source"},"variable-file":{"name":"variable-file","type":"option","char":"f","description":"Variables file path"},"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false}},"args":[{"name":"source"}]},"api-mesh:config:delete:log-forwarding":{"id":"api-mesh:config:delete:log-forwarding","description":"Delete log forwarding details for a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false}},"args":[]},"api-mesh:config:get:log-forwarding":{"id":"api-mesh:config:get:log-forwarding","description":"Get log forwarding details for a given mesh","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false}},"args":[]},"api-mesh:config:set:log-forwarding":{"id":"api-mesh:config:set:log-forwarding","description":"Sets the log forwarding destination for API mesh. \n- Select a log forwarding destination - Choose from available options (for example, New Relic).\n- Enter the base URI - Provide the URI for the log forwarding service. Ensure it includes the protocol (for example, if the hosted region of the New Relic account is the U.S, the base URI could be 'https://log-api.newrelic.com/log/v1').\n- Enter the license key - Provide the INGEST-LICENSE API key type.","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{"ignoreCache":{"name":"ignoreCache","type":"boolean","char":"i","description":"Ignore cache and force manual org -> project -> workspace selection","allowNo":false},"autoConfirmAction":{"name":"autoConfirmAction","type":"boolean","char":"c","description":"Auto confirm action prompt. CLI will not check for user approval before executing the action.","allowNo":false},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false}},"args":[]}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/aio-cli-plugin-api-mesh",
3
- "version": "5.2.4-alpha.0",
3
+ "version": "5.3.0-beta.1",
4
4
  "description": "Adobe I/O CLI plugin to develop and manage API mesh sources",
5
5
  "keywords": [
6
6
  "oclif-plugin"
@@ -21,6 +21,7 @@
21
21
  },
22
22
  "files": [
23
23
  "/oclif.manifest.json",
24
+ "wrangler.toml",
24
25
  "/src"
25
26
  ],
26
27
  "scripts": {
@@ -37,15 +38,15 @@
37
38
  "version": "oclif-dev readme && git add README.md"
38
39
  },
39
40
  "dependencies": {
40
- "@adobe-apimesh/mesh-builder": "2.1.4",
41
+ "@adobe-apimesh/mesh-builder": "2.1.6",
41
42
  "@adobe/aio-cli-lib-console": "^5.0.0",
42
43
  "@adobe/aio-lib-core-config": "^5.0.0",
43
44
  "@adobe/aio-lib-core-logging": "^3.0.0",
44
45
  "@adobe/aio-lib-env": "^3.0.0",
45
46
  "@adobe/aio-lib-ims": "^7.0.1",
46
- "@adobe/plugin-hooks": "0.3.3",
47
+ "@adobe/plugin-hooks": "0.3.4",
47
48
  "@adobe/plugin-on-fetch": "0.1.1",
48
- "@adobe/plugin-source-headers": "^0.0.1",
49
+ "@adobe/plugin-source-headers": "^0.0.2",
49
50
  "@envelop/disable-introspection": "^6.0.0",
50
51
  "@graphql-mesh/cli": "0.82.30",
51
52
  "@graphql-mesh/graphql": "0.34.13",
@@ -90,7 +91,6 @@
90
91
  "jsmin": "1.0.1",
91
92
  "json-interpolate": "^1.0.3",
92
93
  "lru-cache": "^7.14.1",
93
- "ms": "^2.1.3",
94
94
  "node-clipboardy": "^1.0.3",
95
95
  "node-fetch": "2.6.1",
96
96
  "pino": "^9.5.0",
@@ -99,11 +99,12 @@
99
99
  "source-registry-storage-adapter": "github:devx-services/source-registry-storage-adapter#main",
100
100
  "util": "^0.12.5",
101
101
  "uuid": "^8.3.2",
102
- "wrangler": "3.80.4",
102
+ "wrangler": "4.3.0",
103
103
  "yaml": "^2.4.2"
104
104
  },
105
105
  "devDependencies": {
106
106
  "@babel/eslint-parser": "^7.15.8",
107
+ "@cloudflare/workers-types": "^4.20250320.0",
107
108
  "@oclif/dev-cli": "1.26.10",
108
109
  "@oclif/plugin-help": "2.2.3",
109
110
  "@trivago/prettier-plugin-sort-imports": "^3.1.1",
@@ -136,12 +137,18 @@
136
137
  "access": "public"
137
138
  },
138
139
  "oclif": {
140
+ "topics": {
141
+ "api-mesh": { "description": "Create, run, test, and deploy API Mesh"}
142
+ },
139
143
  "commands": "./src/commands",
140
144
  "bin": "aio",
141
145
  "devPlugins": [
142
146
  "@oclif/plugin-help"
143
147
  ],
144
148
  "hooks": {
149
+ "init": [
150
+ "./src/hooks/initMetadata.js"
151
+ ],
145
152
  "prerun": [
146
153
  "./src/hooks/versionCompare.js"
147
154
  ]
@@ -29,7 +29,7 @@ const selectedOrg = { id: '1234', code: 'CODE1234@AdobeOrg', name: 'ORG01', type
29
29
  const selectedProject = { id: '5678', title: 'Project01' };
30
30
  const selectedWorkspace = { id: '123456789', title: 'Workspace01' };
31
31
  const CachePurgeCommand = require('../cache/purge');
32
- const { initSdk, initRequestId, promptConfirm } = require('../../../helpers');
32
+ const { initSdk, promptConfirm } = require('../../../helpers');
33
33
  const {
34
34
  getMeshId,
35
35
  deleteMesh,
@@ -229,7 +229,6 @@ describe('cache purge command tests', () => {
229
229
  cachePurge.mockResolvedValueOnce({ success: true });
230
230
  const runResult = await CachePurgeCommand.run();
231
231
 
232
- expect(initRequestId).toHaveBeenCalled();
233
232
  expect(runResult).toMatchInlineSnapshot(`
234
233
  {
235
234
  "success": true,
@@ -32,13 +32,7 @@ jest.mock('../../../lib/smsClient');
32
32
  const CreateCommand = require('../create');
33
33
  const sampleCreateMeshConfig = require('../../__fixtures__/sample_mesh.json');
34
34
  const meshConfigWithComposerFiles = require('../../__fixtures__/sample_mesh_with_composer_files.json');
35
- const {
36
- initSdk,
37
- initRequestId,
38
- promptConfirm,
39
- interpolateMesh,
40
- importFiles,
41
- } = require('../../../helpers');
35
+ const { initSdk, promptConfirm, interpolateMesh, importFiles } = require('../../../helpers');
42
36
  const {
43
37
  getMesh,
44
38
  createMesh,
@@ -67,7 +61,7 @@ jest.mock('../../../helpers', () => ({
67
61
  initRequestId: jest.fn().mockResolvedValue({}),
68
62
  promptConfirm: jest.fn().mockResolvedValue(true),
69
63
  interpolateMesh: jest.fn().mockResolvedValue({}),
70
- importFiles: jest.fn().mockResolvedValue(),
64
+ importFiles: jest.fn().mockResolvedValue({}),
71
65
  }));
72
66
  jest.mock('../../../lib/smsClient');
73
67
  jest.mock('chalk', () => ({
@@ -340,7 +334,6 @@ describe('create command tests', () => {
340
334
  test('should create if a valid mesh config file is provided', async () => {
341
335
  const runResult = await CreateCommand.run();
342
336
 
343
- expect(initRequestId).toHaveBeenCalled();
344
337
  expect(createMesh.mock.calls[0]).toMatchInlineSnapshot(`
345
338
  [
346
339
  "CODE1234@AdobeOrg",
@@ -422,7 +415,6 @@ describe('create command tests', () => {
422
415
 
423
416
  const runResult = await CreateCommand.run();
424
417
 
425
- expect(initRequestId).toHaveBeenCalled();
426
418
  expect(createMesh.mock.calls[0]).toMatchInlineSnapshot(`
427
419
  [
428
420
  "CODE1234@AdobeOrg",
@@ -557,7 +549,6 @@ describe('create command tests', () => {
557
549
 
558
550
  await CreateCommand.run();
559
551
 
560
- expect(initRequestId).toHaveBeenCalled();
561
552
  expect(promptConfirm).not.toHaveBeenCalled();
562
553
  expect(initSdk).toHaveBeenCalledWith({
563
554
  ignoreCache: true,
@@ -594,7 +585,6 @@ describe('create command tests', () => {
594
585
 
595
586
  await CreateCommand.run();
596
587
 
597
- expect(initRequestId).toHaveBeenCalled();
598
588
  expect(promptConfirm).toHaveBeenCalled();
599
589
  expect(initSdk).toHaveBeenCalledWith({
600
590
  ignoreCache: true,
@@ -895,12 +885,13 @@ describe('create command tests', () => {
895
885
  });
896
886
 
897
887
  importFiles.mockResolvedValueOnce({
898
- meshConfig,
888
+ data: {
889
+ meshConfig,
890
+ },
899
891
  });
900
892
 
901
893
  const output = await CreateCommand.run();
902
894
 
903
- expect(initRequestId).toHaveBeenCalled();
904
895
  expect(createMesh.mock.calls[0]).toMatchInlineSnapshot(`
905
896
  [
906
897
  "CODE1234@AdobeOrg",
@@ -1140,7 +1131,11 @@ describe('create command tests', () => {
1140
1131
 
1141
1132
  promptConfirm.mockResolvedValueOnce(false).mockResolvedValueOnce(true);
1142
1133
 
1143
- importFiles.mockResolvedValueOnce(meshConfig);
1134
+ importFiles.mockResolvedValueOnce({
1135
+ data: {
1136
+ meshConfig,
1137
+ },
1138
+ });
1144
1139
 
1145
1140
  createMesh.mockResolvedValueOnce({
1146
1141
  mesh: {
@@ -1158,7 +1153,6 @@ describe('create command tests', () => {
1158
1153
 
1159
1154
  const output = await CreateCommand.run();
1160
1155
 
1161
- expect(initRequestId).toHaveBeenCalled();
1162
1156
  expect(createMesh.mock.calls[0]).toMatchInlineSnapshot(`
1163
1157
  [
1164
1158
  "1234",
@@ -1272,7 +1266,9 @@ describe('create command tests', () => {
1272
1266
  });
1273
1267
 
1274
1268
  importFiles.mockResolvedValueOnce({
1275
- meshConfig,
1269
+ data: {
1270
+ meshConfig,
1271
+ },
1276
1272
  });
1277
1273
 
1278
1274
  createMesh.mockResolvedValueOnce({
@@ -1284,7 +1280,6 @@ describe('create command tests', () => {
1284
1280
 
1285
1281
  const output = await CreateCommand.run();
1286
1282
 
1287
- expect(initRequestId).toHaveBeenCalled();
1288
1283
  expect(createMesh.mock.calls[0]).toMatchInlineSnapshot(`
1289
1284
  [
1290
1285
  "1234",
@@ -1400,7 +1395,9 @@ describe('create command tests', () => {
1400
1395
  promptConfirm.mockResolvedValueOnce(true);
1401
1396
 
1402
1397
  importFiles.mockResolvedValueOnce({
1403
- meshConfig,
1398
+ data: {
1399
+ meshConfig,
1400
+ },
1404
1401
  });
1405
1402
 
1406
1403
  createMesh.mockResolvedValueOnce({
@@ -1412,7 +1409,6 @@ describe('create command tests', () => {
1412
1409
 
1413
1410
  const output = await CreateCommand.run();
1414
1411
 
1415
- expect(initRequestId).toHaveBeenCalled();
1416
1412
  expect(createMesh.mock.calls[0]).toMatchInlineSnapshot(`
1417
1413
  [
1418
1414
  "CODE1234@AdobeOrg",
@@ -1535,12 +1531,13 @@ describe('create command tests', () => {
1535
1531
  });
1536
1532
 
1537
1533
  importFiles.mockResolvedValueOnce({
1538
- meshConfig,
1534
+ data: {
1535
+ meshConfig,
1536
+ },
1539
1537
  });
1540
1538
 
1541
1539
  const output = await CreateCommand.run();
1542
1540
 
1543
- expect(initRequestId).toHaveBeenCalled();
1544
1541
  expect(createMesh.mock.calls[0]).toMatchInlineSnapshot(`
1545
1542
  [
1546
1543
  "CODE1234@AdobeOrg",
@@ -0,0 +1,106 @@
1
+ /*
2
+ Copyright 2021 Adobe. All rights reserved.
3
+ This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License. You may obtain a copy
5
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software distributed under
8
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ OF ANY KIND, either express or implied. See the License for the specific language
10
+ governing permissions and limitations under the License.
11
+ */
12
+
13
+ const DeleteLogForwardingCommand = require('../config/delete/log-forwarding');
14
+ const { initSdk, promptConfirm } = require('../../../helpers');
15
+ const { getMeshId, deleteLogForwarding } = require('../../../lib/smsClient');
16
+
17
+ jest.mock('../../../helpers', () => ({
18
+ initSdk: jest.fn().mockResolvedValue({}),
19
+ initRequestId: jest.fn().mockResolvedValue({}),
20
+ promptConfirm: jest.fn().mockResolvedValue(true),
21
+ }));
22
+ jest.mock('../../../lib/smsClient');
23
+
24
+ let logSpy, errorLogSpy, parseSpy;
25
+
26
+ describe('delete log forwarding command tests', () => {
27
+ beforeEach(() => {
28
+ initSdk.mockResolvedValue({
29
+ imsOrgCode: 'mockOrgCode',
30
+ projectId: 'mockProjectId',
31
+ workspaceId: 'mockWorkspaceId',
32
+ workspaceName: 'mockWorkspaceName',
33
+ });
34
+
35
+ getMeshId.mockResolvedValue('mockMeshId');
36
+ deleteLogForwarding.mockResolvedValue();
37
+
38
+ global.requestId = 'dummy_request_id';
39
+
40
+ logSpy = jest.spyOn(DeleteLogForwardingCommand.prototype, 'log');
41
+ errorLogSpy = jest.spyOn(DeleteLogForwardingCommand.prototype, 'error');
42
+ parseSpy = jest.spyOn(DeleteLogForwardingCommand.prototype, 'parse');
43
+ });
44
+
45
+ afterEach(() => {
46
+ jest.clearAllMocks();
47
+ });
48
+
49
+ test('should fail if mesh ID is not found', async () => {
50
+ getMeshId.mockResolvedValueOnce(null);
51
+
52
+ await expect(DeleteLogForwardingCommand.run()).rejects.toThrow(
53
+ 'Unable to delete log forwarding details. No mesh found for Org(mockOrgCode) -> Project(mockProjectId) -> Workspace(mockWorkspaceId). Check the details and try again.',
54
+ );
55
+
56
+ expect(logSpy).not.toHaveBeenCalled();
57
+ expect(errorLogSpy).toHaveBeenCalledWith(
58
+ 'Unable to delete log forwarding details. No mesh found for Org(mockOrgCode) -> Project(mockProjectId) -> Workspace(mockWorkspaceId). Check the details and try again.',
59
+ );
60
+ });
61
+
62
+ test('should skip confirmation if autoConfirmAction is set', async () => {
63
+ parseSpy.mockResolvedValueOnce({
64
+ flags: {
65
+ ignoreCache: false,
66
+ autoConfirmAction: true,
67
+ },
68
+ });
69
+
70
+ await DeleteLogForwardingCommand.run();
71
+
72
+ expect(promptConfirm).not.toHaveBeenCalled();
73
+ expect(deleteLogForwarding).toHaveBeenCalledWith(
74
+ 'mockOrgCode',
75
+ 'mockProjectId',
76
+ 'mockWorkspaceId',
77
+ 'mockMeshId',
78
+ );
79
+ expect(logSpy).toHaveBeenCalledWith('Successfully deleted log forwarding details');
80
+ });
81
+
82
+ test('should fail if deleteLogForwarding throws an error', async () => {
83
+ deleteLogForwarding.mockRejectedValueOnce(new Error('Deletion failed'));
84
+
85
+ await expect(DeleteLogForwardingCommand.run()).rejects.toThrow(
86
+ 'Unable to delete log forwarding details. Try again. RequestId: dummy_request_id',
87
+ );
88
+
89
+ expect(logSpy).not.toHaveBeenCalledWith('Successfully deleted log forwarding details');
90
+ expect(errorLogSpy).toHaveBeenCalledWith(
91
+ 'Unable to delete log forwarding details. Try again. RequestId: dummy_request_id',
92
+ );
93
+ });
94
+
95
+ test('should delete log forwarding details successfully', async () => {
96
+ await DeleteLogForwardingCommand.run();
97
+
98
+ expect(deleteLogForwarding).toHaveBeenCalledWith(
99
+ 'mockOrgCode',
100
+ 'mockProjectId',
101
+ 'mockWorkspaceId',
102
+ 'mockMeshId',
103
+ );
104
+ expect(logSpy).toHaveBeenCalledWith('Successfully deleted log forwarding details');
105
+ });
106
+ });
@@ -34,7 +34,7 @@ const selectedProject = { id: '5678', title: 'Project01' };
34
34
  const selectedWorkspace = { id: '123456789', title: 'Workspace01' };
35
35
 
36
36
  const DeleteCommand = require('../delete');
37
- const { initSdk, initRequestId, promptConfirm } = require('../../../helpers');
37
+ const { initSdk, promptConfirm } = require('../../../helpers');
38
38
  const {
39
39
  getMeshId,
40
40
  deleteMesh,
@@ -203,7 +203,6 @@ describe('delete command tests', () => {
203
203
  test('should delete mesh if correct args are provided', async () => {
204
204
  const runResult = await DeleteCommand.run();
205
205
 
206
- expect(initRequestId).toHaveBeenCalled();
207
206
  expect(runResult).toMatchInlineSnapshot(`
208
207
  {
209
208
  "status": "success",
@@ -33,7 +33,7 @@ jest.mock('chalk', () => ({
33
33
  }));
34
34
 
35
35
  const DescribeCommand = require('../describe');
36
- const { initSdk, initRequestId } = require('../../../helpers');
36
+ const { initSdk } = require('../../../helpers');
37
37
  const { describeMesh, getMesh, getTenantFeatures } = require('../../../lib/smsClient');
38
38
  const sampleCreateMeshConfig = require('../../__fixtures__/sample_mesh.json');
39
39
 
@@ -202,7 +202,6 @@ describe('describe command tests', () => {
202
202
  test('should return Non TI url if request is Non Ti', async () => {
203
203
  const runResult = await DescribeCommand.run();
204
204
 
205
- expect(initRequestId).toHaveBeenCalled();
206
205
  expect(describeMesh).toHaveBeenCalledWith(
207
206
  selectedOrg.code,
208
207
  selectedProject.id,
@@ -258,7 +257,6 @@ describe('describe command tests', () => {
258
257
  getMesh.mockResolvedValue(fetchedMeshConfig);
259
258
  const runResult = await DescribeCommand.run();
260
259
 
261
- expect(initRequestId).toHaveBeenCalled();
262
260
  expect(describeMesh).toHaveBeenCalledWith(
263
261
  selectedOrg.code,
264
262
  selectedProject.id,
@@ -31,7 +31,7 @@ const selectedProject = { id: '5678', title: 'Project01' };
31
31
  const selectedWorkspace = { id: '123456789', title: 'Workspace01' };
32
32
 
33
33
  const { writeFile } = require('fs/promises');
34
- const { initSdk, initRequestId } = require('../../../helpers');
34
+ const { initSdk } = require('../../../helpers');
35
35
  const GetCommand = require('../get');
36
36
  const mockGetMeshConfig = require('../../__fixtures__/sample_mesh.json');
37
37
  const { getMeshId, getMesh } = require('../../../lib/smsClient');
@@ -192,7 +192,7 @@ describe('get command tests', () => {
192
192
  ignoreCache: true,
193
193
  verbose: true,
194
194
  });
195
- expect(initRequestId).toHaveBeenCalled();
195
+
196
196
  expect(runResult).toMatchInlineSnapshot(`
197
197
  {
198
198
  "imsOrgId": "1234",