{"id":19437794,"url":"https://github.com/architect/plugin-lambda-invoker","last_synced_at":"2025-10-12T15:22:22.508Z","repository":{"id":42702782,"uuid":"472168508","full_name":"architect/plugin-lambda-invoker","owner":"architect","description":"Interactively invoke Lambdas in Architect Sandbox with arbitrary events","archived":false,"fork":false,"pushed_at":"2025-06-26T12:45:38.000Z","size":54,"stargazers_count":6,"open_issues_count":3,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-18T07:50:00.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/architect.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":".github/contributing.md","funding":null,"license":null,"code_of_conduct":".github/code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-21T03:04:31.000Z","updated_at":"2025-06-26T13:04:33.000Z","dependencies_parsed_at":"2024-10-12T00:05:58.963Z","dependency_job_id":"3acc83c2-65d6-449d-b5ac-7339ba91b5c7","html_url":"https://github.com/architect/plugin-lambda-invoker","commit_stats":{"total_commits":44,"total_committers":3,"mean_commits":"14.666666666666666","dds":0.09090909090909094,"last_synced_commit":"8b5b3b7027204ec21c8e72c21e1582d2ec108d69"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/architect/plugin-lambda-invoker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-lambda-invoker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-lambda-invoker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-lambda-invoker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-lambda-invoker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/architect","download_url":"https://codeload.github.com/architect/plugin-lambda-invoker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fplugin-lambda-invoker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011853,"owners_count":26085004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T15:15:55.088Z","updated_at":"2025-10-12T15:22:22.480Z","avatar_url":"https://github.com/architect.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[\u003cimg src=\"https://assets.arc.codes/architect-logo-500b@2x.png\" width=500\u003e](https://www.npmjs.com/package/@architect/plugin-lambda-invoker)\n\n## [`@architect/plugin-lambda-invoker`](https://www.npmjs.com/package/@architect/plugin-lambda-invoker)\n\n\u003e Interactively invoke Lambdas in Architect Sandbox with arbitrary events\n\n[![GitHub CI status](https://github.com/architect/plugin-lambda-invoker/workflows/Node%20CI/badge.svg)](https://github.com/architect/plugin-lambda-invoker/actions?query=workflow%3A%22Node+CI%22)\n\n\n## Install\n\nInto your existing Architect project:\n\n```sh\nnpm i @architect/plugin-lambda-invoker --save-dev\n```\n\nAdd the following to your Architect project manifest (usually `app.arc`):\n\n```arc\n@plugins\narchitect/plugin-lambda-invoker\n```\n\n\n## Usage\n\n### CLI\n\nWhile Sandbox is running, type `i` in your terminal to bring up the Lambda invocation menu. Then select the Lambda you'd like to invoke.\n\nBy default, this plugin will populate your menu with all `@events`, `@queues`, `@scheduled`, and `@tables-streams`; you can limit this menu (or expand it with additional pragmas) by adding the following setting to a `pref[erence]s.arc` file:\n\n```arc\n@sandbox\ninvoker http scheduled # This would populate @http + @scheduled Lambdas, and ignore all others\n```\n\n\u003e Tip: you can navigate the invocation menu by typing numbers (zero-indexed)!\n\n\n### Programmatic\n\nThe plugin also passes through the [Sandbox invoker](https://arc.codes/docs/en/guides/plugins/sandbox#invoke-function) for programmatic use (such as in a test environment). This method is only available after Sandbox has finished initializing.\n\n```js\nlet sandbox = require('@architect/sandbox')\nlet invokerPlugin = require('@architect/plugin-lambda-invoker')\n\nawait sandbox.start()\nawait invokerPlugin.invoke({\n  pragma: 'scheduled',\n  name: 'my-scheduled-event',\n  payload: { ok: true },\n})\nawait sandbox.end()\n```\n\n\n### Invocation mocks\n\nBy default, Lambdas are invoked with an empty payload (`{}`); if you'd like to invoke your Lambdas with arbitrary payloads, create a file containing invocation mocks.\n\nInvocation mock files live in your root with one of these filenames: `sandbox-invoke-mocks.json` or `sandbox-invoke-mocks.js`. These files should be structured like so:\n\nAssuming this project manifest:\n\n```arc\n@events\nbackground-task\n\n@queues\nanalytics\n\n@scheduled\nbackup-database\n\n@tables-streams\ntableName\n```\n\nIf you wanted to add one or more mocks to each of the three Lambdas above, create the following `sandbox-invoke-mocks.js` (or equivalent JSON) file with the format of `[pragmaName][lambdaName][mockName]`:\n\n```js\nmodule.exports = {\n  events: {\n    'background-task': {\n      'my-first-mock': { /* payload */ },\n      'another-mock': { /* payload */ },\n    }\n  },\n  queues: {\n    analytics: {\n      'one-more-mock': { /* payload */ },\n      'just-a-mock': { /* payload */ },\n    }\n  },\n  scheduled: {\n    'backup-database': {\n      'a-mock-for-this': { /* payload */ },\n      'the-last-mock': { /* payload */ },\n    }\n  },\n  'tables-streams':{\n    tableName:{\n      INSERT:{ /* payload */ },\n      MODIFY:{ /* payload */ },\n      REMOVE:{ /* payload */ },\n    }\n  }\n}\n```\n\n\u003e Tip: when using `sandbox-invoke-mocks.js`, you can dynamically (synchronously) generate mocks on startup\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchitect%2Fplugin-lambda-invoker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchitect%2Fplugin-lambda-invoker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchitect%2Fplugin-lambda-invoker/lists"}