{"id":41585821,"url":"https://github.com/maskeynihal/pursue","last_synced_at":"2026-01-24T09:05:37.508Z","repository":{"id":116802605,"uuid":"535753513","full_name":"maskeynihal/pursue","owner":"maskeynihal","description":"Job handling using AWS SQS","archived":false,"fork":false,"pushed_at":"2026-01-20T17:49:22.000Z","size":276,"stargazers_count":6,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-21T02:42:32.209Z","etag":null,"topics":["aws","hacktoberfest","handler","queue","sqs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/maskeynihal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-12T16:24:24.000Z","updated_at":"2026-01-20T17:49:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"5488e3be-b436-444a-b6ba-15a8a5bfb426","html_url":"https://github.com/maskeynihal/pursue","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/maskeynihal/pursue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maskeynihal%2Fpursue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maskeynihal%2Fpursue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maskeynihal%2Fpursue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maskeynihal%2Fpursue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maskeynihal","download_url":"https://codeload.github.com/maskeynihal/pursue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maskeynihal%2Fpursue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28722032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T08:27:05.734Z","status":"ssl_error","status_checked_at":"2026-01-24T08:27:01.197Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aws","hacktoberfest","handler","queue","sqs"],"created_at":"2026-01-24T09:05:36.792Z","updated_at":"2026-01-24T09:05:37.503Z","avatar_url":"https://github.com/maskeynihal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pursue\nFor events and triggers using AWS SQS.\n\n## Environment Setup\n1. `QUEUE_URL`: The url link to the queue. (SQS url)\n2. `QUEUE_CALLBACK_URL`: The url that is called by queue.\n3. `AWS_SQS_REGION`: Region of AWS queue\n4. `AWS_SQS_API_VERSION`: SQS API version\n\n## How to use\n\n1. Create a object with key as name of handler and value as function that should run when the handler is called. \n   ```js\n    const handlers = {\n        sendEmailToBuyer: (args) =\u003e console.log(`Thank you for buying the product: ${args.productName} with us.`),\n        sendEmailToSeller: (args) =\u003e console.log(`Congratulations! Your product ${args.productName} is purchased.`)\n    }\n   ```\n2. Pass the `handler` object as argument while creating **class** [Handler](src/providers/Handler.ts)\n   ```js\n   import { Handler } from '@maskeynihal/pursue';\n   \n   // const handlers = {} define the handler function as given in step 1.\n\n   const handlerClass = new Handler(handlers)\n   ```\n3. Create a event and handler mapper object. \n   ```js\n   // const handlerClass = new Handler(handlers)\n\n   const eventHandlerMapper = {\n    productSold: [\n        handlerClass.keys.sendEmailToBuyer,\n        handlerClass.keys.sendEmailToSeller\n    ]\n   }\n   ```\n4. Pass the `eventHandlerMapper` object as argument while creating **class** [EventHandlerMapper](src/providers/EventHandlerMapper.ts)\n   ```js\n   import { EventHandlerMapper } from '@maskeynihal/pursue';\n\n   // const eventHandlerMapper = {}\n\n   const eventHandlerMapperClass = new EventHandlerMapper(eventHandlerMapper)\n   ```\n5. Create a new **class** [Job](src/providers/Jobs.ts) and pass the two classes [Handler](src/providers/Handler.ts) and [EventHandlerMapper](src/providers/EventHandlerMapper.ts) as argument\n    ```js\n    import { Job } from '@maskeynihal/pursue';\n\n    // handlerClass\n    // eventHandlerMapperClass\n\n    const job = new Job(handlerClass, eventHandlerMapperClass);\n    ```\n\n6. Create a route file to handle the callback from the queue\n    ```js\n    // import the instance of job\n    // import job from './job';\n\n    // using express\n    router.get('/api/queue/callback', (req, res) =\u003e {\n        job.dispatch(req.body.scope, req.body.data);\n\n        res.json({\n            message: \"Dispatched!\"\n        })\n    });\n    ```\n\n### Triggering Event\n\u003e The instance of the **class** [Job](src/providers/Jobs.ts) should be exported from a file so that it's always pointing to same class (singleton). \n\nAll the event key can be found from the instance of **class** `Job`. Event can be triggered calling the `trigger` function from instance of the class.\n\n```js\n// Get the required key\nimport job from './job';\n\nconst eventKey = job.events.productSold;\n\njob.trigger(eventKey, {\n    productName: \"Macbook 16 inch\"\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaskeynihal%2Fpursue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaskeynihal%2Fpursue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaskeynihal%2Fpursue/lists"}