@adobe/aio-cli-plugin-api-mesh 5.5.0 → 5.6.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.
@@ -1 +1 @@
1
- {"version":"5.5.0","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 specified mesh. Use the --active flag to retrieve the last successfully deployed mesh 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},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false},"active":{"name":"active","type":"boolean","char":"a","description":"Retrieve the last successfully deployed mesh config","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:config":{"id":"api-mesh:config","description":"The 'config' command includes the following options:\n- set: Set log forwarding details for a given mesh.\n- get: Retrieve log forwarding details for a given mesh.\n- delete: Delete log forwarding details for a given mesh.","usage":"api-mesh:config [COMMAND]","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{},"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","usage":"api-mesh:config:delete:log-forwarding","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: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.","usage":"api-mesh:config:set:log-forwarding","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":[]},"api-mesh:config:get:log-forwarding:errors":{"id":"api-mesh:config:get:log-forwarding:errors","description":"Get log forwarding errors for the mesh.","usage":"api-mesh:config:get:log-forwarding:errors","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:config:get:log-forwarding":{"id":"api-mesh:config:get:log-forwarding","description":"Get log forwarding details and error logs for a specified mesh.\n\n-The 'log-forwarding' command includes the following options:\n\n- api-mesh:config:get:log-forwarding : Retrieve log forwarding details for a given mesh.\n- api-mesh:config:get:log-forwarding:errors : Download log forwarding error logs for a selected time period.","usage":"api-mesh:config:get:log-forwarding","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":[]}}}
1
+ {"version":"5.6.0","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 specified mesh. Use the --active flag to retrieve the last successfully deployed mesh 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},"json":{"name":"json","type":"boolean","description":"Output JSON","allowNo":false},"active":{"name":"active","type":"boolean","char":"a","description":"Retrieve the last successfully deployed mesh config","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:config":{"id":"api-mesh:config","description":"The 'config' command includes the following options:\n- set: Set log forwarding details for a given mesh.\n- get: Retrieve log forwarding details for a given mesh.\n- delete: Delete log forwarding details for a given mesh.","usage":"api-mesh:config [COMMAND]","pluginName":"@adobe/aio-cli-plugin-api-mesh","pluginType":"core","aliases":[],"flags":{},"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","usage":"api-mesh:config:delete:log-forwarding","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: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.","usage":"api-mesh:config:set:log-forwarding","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":[]},"api-mesh:config:get:log-forwarding:errors":{"id":"api-mesh:config:get:log-forwarding:errors","description":"Get log forwarding errors for the mesh.","usage":"api-mesh:config:get:log-forwarding:errors","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:config:get:log-forwarding":{"id":"api-mesh:config:get:log-forwarding","description":"Get log forwarding details and error logs for a specified mesh.\n\n-The 'log-forwarding' command includes the following options:\n\n- api-mesh:config:get:log-forwarding : Retrieve log forwarding details for a given mesh.\n- api-mesh:config:get:log-forwarding:errors : Download log forwarding error logs for a selected time period.","usage":"api-mesh:config:get:log-forwarding","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":[]}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/aio-cli-plugin-api-mesh",
3
- "version": "5.5.0",
3
+ "version": "5.6.0",
4
4
  "description": "Adobe I/O CLI plugin to develop and manage API mesh sources",
5
5
  "keywords": [
6
6
  "oclif-plugin"
@@ -38,13 +38,13 @@
38
38
  "version": "oclif-dev readme && git add README.md"
39
39
  },
40
40
  "dependencies": {
41
- "@adobe-apimesh/mesh-builder": "2.2.0",
41
+ "@adobe-apimesh/mesh-builder": "2.3.1",
42
42
  "@adobe/aio-cli-lib-console": "^5.0.0",
43
43
  "@adobe/aio-lib-core-config": "^5.0.0",
44
44
  "@adobe/aio-lib-core-logging": "^3.0.0",
45
45
  "@adobe/aio-lib-env": "^3.0.0",
46
46
  "@adobe/aio-lib-ims": "^7.0.1",
47
- "@adobe/plugin-hooks": "0.3.4",
47
+ "@adobe/plugin-hooks": "0.4.0",
48
48
  "@adobe/plugin-on-fetch": "0.1.1",
49
49
  "@adobe/plugin-source-headers": "^0.0.2",
50
50
  "@envelop/disable-introspection": "^6.0.0",
@@ -70,8 +70,8 @@ function resolveComposerAsTypeScriptModule(data) {
70
70
  * ```
71
71
  */
72
72
  function resolveComposerAsJavaScriptModule(data) {
73
- return data.replace(
74
- /"composer":\s*"((?!https:\/\/)[^#]+)#([^"]+)"/,
73
+ return data.replaceAll(
74
+ /"composer":\s*"((?!https:\/\/)[^#]+)#([^"]+)"/g,
75
75
  `"module": __importStar(require("$1")), "fn": "$2"`,
76
76
  );
77
77
  }
package/src/server.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import { getMesh } from '@graphql-mesh/runtime';
2
2
 
3
+ import { KvStateApiImpl } from './state';
4
+
3
5
  const { getCorsOptions } = require('./cors');
4
6
  const { createYoga } = require('graphql-yoga');
5
7
  const { GraphQLError } = require('graphql/error');
@@ -46,13 +48,14 @@ async function getBuiltMesh(meshArtifacts, meshConfig) {
46
48
  }
47
49
 
48
50
  const buildServer = async (loggerInstance, env, meshArtifacts, meshConfig) => {
49
- const { Secret: secret } = env;
51
+ const { SECRETS } = env;
50
52
  const tenantMesh = await getBuiltMesh(meshArtifacts, meshConfig);
51
- const meshSecrets = loadMeshSecrets(loggerInstance, secret);
53
+ const meshSecrets = loadMeshSecrets(loggerInstance, SECRETS);
52
54
  return await buildYogaServer(env, tenantMesh, meshConfig, meshSecrets);
53
55
  };
54
56
 
55
57
  async function buildYogaServer(env, tenantMesh, meshConfig, meshSecrets) {
58
+ const stateApi = new KvStateApiImpl(env, meshConfig);
56
59
  const secretsProxy = new Proxy(meshSecrets, getSecretsHandler);
57
60
  return createYoga({
58
61
  plugins: tenantMesh.plugins,
@@ -61,6 +64,7 @@ async function buildYogaServer(env, tenantMesh, meshConfig, meshSecrets) {
61
64
  context: initialContext => ({
62
65
  ...initialContext,
63
66
  secrets: secretsProxy,
67
+ state: stateApi,
64
68
  }),
65
69
  maskedErrors: {
66
70
  maskError: maskError,
package/src/state.js ADDED
@@ -0,0 +1,155 @@
1
+ import { GraphQLError } from 'graphql/error';
2
+
3
+ /**
4
+ * Whether string is empty.
5
+ * @param value {string | null | undefined} String value.
6
+ */
7
+ const isEmptyString = value => {
8
+ return value === '' || value === null || value === undefined;
9
+ };
10
+
11
+ /**
12
+ * Get byte length of a string.
13
+ * @param value {string} String value.
14
+ */
15
+ const getByteLength = value => {
16
+ return new TextEncoder().encode(value).length;
17
+ };
18
+
19
+ /**
20
+ * Abstract class for state API implementations.
21
+ */
22
+ class StateApiAbstract {
23
+ #env;
24
+
25
+ constructor(env) {
26
+ this.#env = env;
27
+ }
28
+
29
+ getEnv() {
30
+ return this.#env;
31
+ }
32
+
33
+ /**
34
+ * Validate a key.
35
+ * @param key {string} Key to validate.
36
+ */
37
+ validateKey(key) {
38
+ if (isEmptyString(key)) {
39
+ throw new Error(`Invalid key: ${key}`);
40
+ }
41
+ const keyBytes = getByteLength(key);
42
+ const env = this.getEnv();
43
+ if (keyBytes > env.MAX_STATE_KEY_SIZE_BYTES) {
44
+ throw new Error(
45
+ `Key ${key} exceeds maximum key size of ${env.MAX_STATE_KEY_SIZE_BYTES}. Received ${keyBytes} B.`,
46
+ );
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Validate a value
52
+ * @param key {string} Key.
53
+ * @param value {string} Value to validate.
54
+ */
55
+ validateValue(key, value) {
56
+ if (isEmptyString(value)) {
57
+ throw new Error(`Invalid value for key: ${key}`);
58
+ }
59
+ const valueBytes = getByteLength(value);
60
+ const env = this.getEnv();
61
+ if (valueBytes > env.MAX_STATE_VALUE_SIZE_BYTES) {
62
+ throw new Error(
63
+ `Key ${key} value exceeds maximum key size of ${env.MAX_STATE_VALUE_SIZE_BYTES}. Received ${valueBytes} B.`,
64
+ );
65
+ }
66
+ }
67
+
68
+ /**
69
+ * Get the TTL in milliseconds based on the provided config or environment defaults.
70
+ * @param config {{ ttl?: number } | undefined} Configuration object that may contain a TTL value.
71
+ */
72
+ getTtl(config) {
73
+ const env = this.getEnv();
74
+ // Default to maximum ttl if not provided
75
+ let useTtl = config?.ttl || env.MAX_STATE_TTL_SECONDS;
76
+ // Set TTL to max when over maximum TTL
77
+ if (useTtl > env.MAX_STATE_TTL_SECONDS) {
78
+ useTtl = env.MAX_STATE_TTL_SECONDS;
79
+ }
80
+ // Set TTL to min seconds when under minimum TTL
81
+ if (useTtl < env.MIN_STATE_TTL_SECONDS) {
82
+ useTtl = env.MIN_STATE_TTL_SECONDS;
83
+ }
84
+ return useTtl;
85
+ }
86
+ }
87
+
88
+ /**
89
+ * State API implementation using Cloudflare's KV as the backing store. KV is a distributed key-value store that allows
90
+ * for storing and retrieving key-value pairs across different worker instances with eventual consistency.
91
+ */
92
+ class KvStateApiImpl extends StateApiAbstract {
93
+ meshConfig;
94
+
95
+ constructor(env, meshConfig) {
96
+ super(env);
97
+ this.meshConfig = meshConfig;
98
+ }
99
+
100
+ /**
101
+ * Ensure that the KV namespace is configured in the environment.
102
+ * @throws {GraphQLError} when the KV namespace is not configured.
103
+ */
104
+ ensureKvConfigured() {
105
+ if (!this.getEnv().MESH_KV_NAMESPACE || !this.meshConfig?.state?.enabled) {
106
+ throw new GraphQLError(
107
+ 'Context state is not configured for this mesh. Please check your mesh configuration and try again.',
108
+ {
109
+ extensions: {
110
+ code: 'ERROR_CONTEXT_STATE_NOT_CONFIGURED',
111
+ },
112
+ },
113
+ );
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Get a value by key.
119
+ * @param key {key} Key to retrieve.
120
+ * @return {Promise<string | null>}
121
+ */
122
+ async get(key) {
123
+ this.ensureKvConfigured();
124
+ this.validateKey(key);
125
+ return this.getEnv().MESH_KV_NAMESPACE.get(key);
126
+ }
127
+
128
+ /**
129
+ * Put a key-value pair with optional TTL.
130
+ * @param key {string} Key to store.
131
+ * @param value {string} Value to store.
132
+ * @param config {{ ttl?: number } | undefined} Optional configuration object that may contain a TTL value in seconds.
133
+ * @return {Promise<void>}
134
+ */
135
+ async put(key, value, config) {
136
+ this.ensureKvConfigured();
137
+ this.validateKey(key);
138
+ this.validateValue(key, value);
139
+ const ttl = this.getTtl(config);
140
+ return this.getEnv().MESH_KV_NAMESPACE.put(key, value, { expirationTtl: ttl });
141
+ }
142
+
143
+ /**
144
+ * Delete a key-value pair.
145
+ * @param key {string} Key to delete.
146
+ * @return {Promise<void>}
147
+ */
148
+ async delete(key) {
149
+ this.ensureKvConfigured();
150
+ this.validateKey(key);
151
+ return this.getEnv().MESH_KV_NAMESPACE.delete(key);
152
+ }
153
+ }
154
+
155
+ module.exports = { KvStateApiImpl };
@@ -1,5 +1,13 @@
1
+ # Dependencies
1
2
  node_modules
3
+
4
+ # Temporary files
5
+ .wrangler
6
+ .mesh
7
+ tenantFiles
8
+ tempfiles
2
9
  mesh-artifact
3
10
  meshes
4
- tempfiles
5
- *.txt
11
+
12
+ # Template files from @adobe/aio-cli-plugin-api-mesh
13
+ wrangler.toml
@@ -26,7 +26,7 @@
26
26
  "@graphql-mesh/soap": "0.14.25",
27
27
  "@graphql-mesh/http": "^0.96.9",
28
28
  "graphql": "^16.6.0",
29
- "@adobe/plugin-hooks": "0.3.3",
29
+ "@adobe/plugin-hooks": "0.4.0",
30
30
  "@adobe/plugin-on-fetch": "0.1.1",
31
31
  "eslint-plugin-no-loops": "^0.3.0",
32
32
  "eslint-plugin-node": "^11.1.0",
@@ -1,7 +1,6 @@
1
1
  # Tenant worker core definition. For platform workers metadata configs are used to set bindings.
2
2
  name = "tenant-worker-core"
3
3
  compatibility_date = "2024-06-03"
4
- node_compat = false
5
4
 
6
5
  find_additional_modules = true
7
6
  base_dir = ".mesh"
@@ -9,6 +8,13 @@ rules = [
9
8
  { type = "CommonJS", globs = ["tenantFiles/**/*.js"] }
10
9
  ]
11
10
 
11
+ kv_namespaces = [
12
+ { binding = "MESH_KV_NAMESPACE", id = "local-kv" }
13
+ ]
12
14
 
13
- [[migrations]]
14
- tag = "v1"
15
+ [vars]
16
+ # State configuration
17
+ MAX_STATE_KEY_SIZE_BYTES="512" # 512 bytes
18
+ MAX_STATE_VALUE_SIZE_BYTES="1048576" # 1 MiB
19
+ MIN_STATE_TTL_SECONDS="60" # 1 minute
20
+ MAX_STATE_TTL_SECONDS="604800" # 7 days
package/src/utils.js CHANGED
@@ -227,6 +227,38 @@ function getFilesInMeshConfig(data, meshConfigName) {
227
227
  filesList.push(filename);
228
228
  }
229
229
  }
230
+
231
+ if (plugin.hooks.afterAll) {
232
+ const composer = plugin.hooks.afterAll.composer;
233
+ if (composer && !fileURLRegex.test(composer)) {
234
+ const [filename] = composer.split('#');
235
+ filesList.push(filename);
236
+ }
237
+ }
238
+
239
+ if (plugin.hooks.beforeSource) {
240
+ Object.values(plugin.hooks.beforeSource).forEach(beforeSourceHooks => {
241
+ beforeSourceHooks?.forEach(hook => {
242
+ const composer = hook.composer;
243
+ if (composer && !fileURLRegex.test(composer)) {
244
+ const [filename] = composer.split('#');
245
+ filesList.push(filename);
246
+ }
247
+ });
248
+ });
249
+ }
250
+
251
+ if (plugin.hooks.afterSource) {
252
+ Object.values(plugin.hooks.afterSource).forEach(afterSourceHooks => {
253
+ afterSourceHooks?.forEach(hook => {
254
+ const composer = hook.composer;
255
+ if (composer && !fileURLRegex.test(composer)) {
256
+ const [filename] = composer.split('#');
257
+ filesList.push(filename);
258
+ }
259
+ });
260
+ });
261
+ }
230
262
  }
231
263
  });
232
264
 
@@ -2,6 +2,7 @@ const { spawn } = require('child_process');
2
2
  const { readSecretsFile } = require('./serverUtils');
3
3
  const packageData = require('../package.json');
4
4
  const { join } = require('node:path');
5
+ const fs = require('node:fs');
5
6
 
6
7
  /**
7
8
  * Starts the wrangler dev server
@@ -13,7 +14,10 @@ const { join } = require('node:path');
13
14
  const start = (command, port, debug, inspectPort) => {
14
15
  const wranglerPackageNumber = packageData.dependencies.wrangler;
15
16
  const wranglerVersion = `wrangler@${wranglerPackageNumber.replace(/^[\^~]/, '')}`;
16
- const wranglerToml = join(__dirname, '..', 'wrangler.toml');
17
+ // Project wrangler.toml must be used to avoid issues w/ Wrangler. Ensure it is up to date.
18
+ const wranglerTomlTemplate = join(__dirname, '..', 'wrangler.toml');
19
+ const wranglerToml = join(process.cwd(), 'wrangler.toml');
20
+ fs.cpSync(wranglerTomlTemplate, wranglerToml);
17
21
  const meshDir = '.mesh';
18
22
  const secrets = readSecretsFile(meshDir);
19
23
  const entrypoint = join(__dirname, 'worker.js');
@@ -29,7 +33,7 @@ const start = (command, port, debug, inspectPort) => {
29
33
  '--show-interactive-dev-session',
30
34
  'false',
31
35
  '--var',
32
- `Secret:${JSON.stringify(secrets)}`,
36
+ `SECRETS:${JSON.stringify(secrets)}`,
33
37
  '--port',
34
38
  port,
35
39
  '--inspector-port',
package/wrangler.toml CHANGED
@@ -8,6 +8,13 @@ rules = [
8
8
  { type = "CommonJS", globs = ["tenantFiles/**/*.js"] }
9
9
  ]
10
10
 
11
+ kv_namespaces = [
12
+ { binding = "MESH_KV_NAMESPACE", id = "local-kv" }
13
+ ]
11
14
 
12
- [[migrations]]
13
- tag = "v1"
15
+ [vars]
16
+ # State configuration
17
+ MAX_STATE_KEY_SIZE_BYTES="512" # 512 bytes
18
+ MAX_STATE_VALUE_SIZE_BYTES="1048576" # 1 MiB
19
+ MIN_STATE_TTL_SECONDS="60" # 1 minute
20
+ MAX_STATE_TTL_SECONDS="604800" # 7 days