{"_id":"@adityapurwa/orbitalframe","_rev":"2-8f370870f6d03976eb6fd7125fefe06b","name":"@adityapurwa/orbitalframe","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@adityapurwa/orbitalframe","version":"0.0.1","description":"Workflow framework to simplify your life","main":"dist/index.js","types":"types/","scripts":{"test":"echo \"Error: no test specified\" && exit 1","ex-time-bot":"ts-node example/time-bot.ts","build":"tsc"},"keywords":["workflow","zapier","ifttt"],"author":{"name":"Aditya Purwa"},"license":"MIT","dependencies":{"express":"^4.17.1","node-wit":"^6.0.0"},"devDependencies":{"@types/express":"^4.17.8","@types/node-wit":"^4.2.2","ts-node":"^9.0.0","typescript":"^4.0.3"},"gitHead":"f0288e31a8ac38d0d2b268f4185a18688b6480f8","_id":"@adityapurwa/orbitalframe@0.0.1","_nodeVersion":"14.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-67KpAKdzZaHAghaYln1S5SJFVSm9+taAWJMxS8Nq1IshXU1YWpm2rCapS9L5iCBcSc71fHsnaGm9S4szngPhog==","shasum":"4969dec9c38992ffe785a9d50391b3e35bf377f1","tarball":"https://registry.npmjs.org/@adityapurwa/orbitalframe/-/orbitalframe-0.0.1.tgz","fileCount":26,"unpackedSize":31900,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfeZFpCRA9TVsSAnZWagAA5qkQAJM8UIHCcnNRt5lkz90s\nk2WyfVmStZ6XmJIDVKzQkxULihCWphfvR7RkiNAN5NsC18jmJMg4W/nZaF9k\nGyHtm+QStSspJWZmMIYN3rpsRlSPcPM3sL16PyrGMSY4CvgNj/bwS5yMtOum\nqdGgITSXYKoyy0BqNUg8M4CTRsyoI9SjvScyBs9DnYdYyYpXChJqWFGvwF58\neg1ahYoR99b4MO3NACY0VKdD2+ewoSE1FHSnuj4NOOnB1o7WgAPOZwqE3/Xu\nG9RUxxU7Q2v0HtGO3obpzneFvFKRD6Cmy2aFyTdSJRSzXEAFqYLaneGU+k7R\noclgNYNStYB03xcvo5gWb+GXpBg5DianJBh31UDhO0jJLeyChwEFdeJMLjhx\nsBAixJb5UcfFYss9Gpfzs+8RdygUzCtT5Opasf+GqVCIHt5YDZu8nzUbwEWK\neVBJO7+9/RN/187q91SNDUcfRq1dXYxbxA7qf9/7kTnk+nfXpjnGWPtcFBi2\nrCNOKa4A8k2xucQ58mF9rsdlzjRBeAsbS9YDt8MLPRfTBsgx++XacvsN/Zru\ntFhpqW6hO1yFL3vPWHONq/MAN5YhKtThk5V05xur1qWbbPQv6CZd6G/ogb3b\nC3bwKJOAKeHp7Pyaz/gbPtox/NhSDT4GLoZxHBd7E1JNvHfyMpMItwNW8I/O\np6tV\r\n=Rtzf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEUk7bzG3d2Yuo1ifQAHk76B0mzteDawYCe1L0WRja/wIgYz/rapEwAfLxPpauyqAQFfGT5LCinpFG2BetjjyubCs="}]},"maintainers":[{"name":"adityapurwa","email":"adityapurwa@windowslive.com"}],"_npmUser":{"name":"adityapurwa","email":"adityapurwa@windowslive.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/orbitalframe_0.0.1_1601802600864_0.8300839631808552"},"_hasShrinkwrap":false},"0.0.2":{"name":"@adityapurwa/orbitalframe","version":"0.0.2","description":"Workflow framework to simplify your life","main":"dist/index.js","types":"types/","scripts":{"test":"echo \"Error: no test specified\" && exit 1","ex-time-bot":"ts-node example/time-bot.ts","ex-ping":"ts-node example/ping.ts","build":"tsc"},"keywords":["workflow","zapier","ifttt"],"author":{"name":"Aditya Purwa"},"license":"MIT","dependencies":{"express":"^4.17.1","node-wit":"^6.0.0"},"devDependencies":{"@types/express":"^4.17.8","@types/node-wit":"^4.2.2","ts-node":"^9.0.0","typescript":"^4.0.3"},"gitHead":"0fe8815e7f2209d36f075998d2136ee09bf3986f","_id":"@adityapurwa/orbitalframe@0.0.2","_nodeVersion":"14.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-chnuEdZO4HFwqRvOZ0/L3H6YyXaWwFfJ7tdDnH9nTZrdVZFgWBkmcY5tANbhU8aapt1gXf1XQbJwKal7CN7vew==","shasum":"afc4219ea0af8b9de647b321e0b40feacd3c596e","tarball":"https://registry.npmjs.org/@adityapurwa/orbitalframe/-/orbitalframe-0.0.2.tgz","fileCount":30,"unpackedSize":47269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfetUdCRA9TVsSAnZWagAAoxIP/3qQuCFdjrIWv4Jfj6yG\nMlveUrPvdguPgu5kr+AtKTL1SdLd/1tHiTiNCpTR5/Pv5qojjzBUQjYUkjVM\ntydZcW2cjdkXtFKSs2cgrCFILR2s1PfQOzjgqnYJ1GJQ0KfZWn7d/deFzPgi\nb9DEhOl7aIqyXr9mwkkA63dGpEl0rYIcMC84Uejn+LEoo2zWLNNPN79XS8g/\n76UKoSk+Zr7o0gSxzVNUsSikxLkOuU2QB8qOJ2gqlKWIQ/q27/dZ2FUt1jAu\nPN86r5/DP1nC6Rk83rSAXYK0gtWsjzrXy6NEvne1qnPRZmTBl6Zc+lUlIkjq\nvYaRJdAjL6eFcO3N8WzWPD1luqWdtzvc0Bu4/UHGlHy2jyytQEpCi3no8ur/\nn9/1QvmQ0id20Bs6n07qi+SP16/yYheJkC85BiZjlUv1yFbazDlk3U1W8gCX\npaQcRx31PR0ZaRZaJlJx3r5C0L3rNPljTfHdEz7A/o0Qgq2ZXoHuZfBFu5jx\nwXOENUgY6Qp1p+wtmPbMUvxWPRPAtLhZdgvG1ydrMce6a/2AzAIfuD7/Vdon\ndCuqcTLccvvRclfwpBD5Q17wwSfaQlJZBqzWruxBtCPHaBfbBqcO8CLpDlM0\n8ZTYbXOJru9xSgk6909KH1TPvBQRvxl35UwgIXgdr2QIetAIxIEycZYlbIVT\nDIMU\r\n=rLx1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfqnRzwuwhLeKRUcFSY94bfpYc1o2IhdkH1Ag49bbY5AiBulUogVATwSnOVFYoY0RSbERg5GwQfnaJx4gGeB3M56Q=="}]},"maintainers":[{"name":"adityapurwa","email":"adityapurwa@windowslive.com"}],"_npmUser":{"name":"adityapurwa","email":"adityapurwa@windowslive.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/orbitalframe_0.0.2_1601885469254_0.7089914234768853"},"_hasShrinkwrap":false}},"time":{"created":"2020-10-04T09:10:00.828Z","0.0.1":"2020-10-04T09:10:01.048Z","modified":"2022-04-04T11:30:57.128Z","0.0.2":"2020-10-05T08:11:09.435Z"},"maintainers":[{"name":"adityapurwa","email":"adityapurwa@windowslive.com"}],"description":"Workflow framework to simplify your life","keywords":["workflow","zapier","ifttt"],"author":{"name":"Aditya Purwa"},"license":"MIT","readme":"# Orbital Frame\n\n> Workflow framework to automate and simplify your life\n\n\n\n**v0.0.1 - Ardjet / Pre-Release** - NOT SUITABLE FOR PRODUCTION\n\n## Introduction\n\nOrbital Frame is a workflow framework designed to work similar\nto Zapier or IFTTT. It works with the concept of event, pipe, and context.\n\nA simple workflow for a time bot:\n\n```ts\n\nconst frame = new OrbitalFrame();\nconst expPlugin = new ExpressPlugin();\nframe.with(expPlugin)\n\n// Whenever a slack outgoing webhook is received\nframe.on(new SlackEvent())\n    // Pipe is a middleware, it processes the event and\n    // decides whether it want to continue or not    \n    .pipe(\n        // A prebuilt pipe can be used by mapping the input to\n        // it own expected format and pipe it out\n        new WitAiPipe({\n            client\n        }).map(context => {\n            return {\n                message: SlackEvent.data(context).data.text\n            }\n        }).pipe()\n    )\n    .pipe((context, event, next) => {\n        const witData = WitAiPipe.data(context)\n        const eventData = SlackEvent.data(context);        \n        if (witData.intents[0].name === 'ask_time' && witData.intents[0].confidence > 0.7) {\n            eventData.res.status(200).send({\n                text: `Its ${new Date().toTimeString()} now`\n            }).end()\n        }       \n    })\n\nframe.start();\n```\n\n## Concepts\n\n### Event\n\nEvent is the entry point of a workflow, when an event occurs, it will\nrun any registered flow.\n\nEven must inherits from OrbitalEvent, implements the get symbol, setup,\nand also expose the constructor that accept options.\n\n> Best practice, it is not required but highly recommended to implement\n> a static method to read a context using its symbol. E.g SlackEvent.data(context)\n> will returns the data stored by SlackEvent in the context.\n\n### Pipe\n\nPipe is a middleware function that accepts context, events, next pipe,\nand the frame. Most of the time you'd likely be interested with the first three\nonly.\n\nPipe must implements the `pipe()` method that returns the actual pipe\nthat's going to be run. A pipe accepts a mapper function, which is used\nto map current context into a form that could be understood by the pipe.\n\n### Context\n\nContext is the storage of the flow, any event, pipes, and plugins; can store\ndata into the context.\n\nTo prevent collision, context must be indexed with symbol only. That is why\nevent, pipes, and plugins should always expose the symbol it used to store\nthe data so it can be fetched later.\n","readmeFilename":"readme.md"}