{"_id":"@andrewcturing/faunadb","name":"@andrewcturing/faunadb","dist-tags":{"latest":"0.3.4"},"versions":{"0.3.4":{"name":"@andrewcturing/faunadb","version":"0.3.4","description":"Pipedream Faunadb Components","main":"faunadb.app.mjs","keywords":["pipedream","faunadb"],"homepage":"https://pipedream.com/apps/faunadb","author":{"name":"Pipedream","email":"support@pipedream.com","url":"https://pipedream.com/"},"license":"MIT","dependencies":{"@pipedream/platform":"^0.10.0","faunadb":"^4.5.4","lodash":"^4.17.21"},"gitHead":"e12480b94cc03bed4808ebc6b13e7fdb3a1ba535","publishConfig":{"access":"public"},"_id":"@andrewcturing/faunadb@0.3.4","_integrity":"sha512-GKkPsHnXNxzdsyJUPtwlMce/x3Q6PjkT3a9GwPlRU81aadiejTdWS8A3DME46sGlgHXguECBfGg/QGGvI5a1kQ==","_resolved":"/private/var/folders/ln/bmzl_cmx3yd_vyqtcy0dqhh00000gn/T/9a048f3d7490fa06871753f3a5efc3fa/andrewcturing-faunadb-0.3.4.tgz","_from":"file:andrewcturing-faunadb-0.3.4.tgz","_nodeVersion":"17.8.0","_npmVersion":"8.19.1","dist":{"integrity":"sha512-GKkPsHnXNxzdsyJUPtwlMce/x3Q6PjkT3a9GwPlRU81aadiejTdWS8A3DME46sGlgHXguECBfGg/QGGvI5a1kQ==","shasum":"58af038ba6530be496ebe45bc62088e1dac2af5a","tarball":"https://registry.npmjs.org/@andrewcturing/faunadb/-/faunadb-0.3.4.tgz","fileCount":8,"unpackedSize":12346,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNyKOY/uWzFUCOSxldWq89kfN/BcX34TDw4hMQ69xncQIgOC//DmaTCTYuiy70tDo2GVWBBh0czKZBErGAuA3g8lE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEkb5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpvyQ/+PsWji3GlQgxIvOjrFAOAXYA6eebQLXNlbSOVfuFDOHmCLdXQ\r\nzc42sLeFQXlIid/u/D13z0uVgbhOhbEYihE3mDrQoTrtgzZib/9fOlTggI8e\r\n9i2dKK5lxe+HIW0C4fIs9ViZp2maiwsZD7OWEcEZh0a/10w7DEGg5C6c6drE\r\nsVcV/p1kSR3uBhe6KTOfR2U5DX19CMTk4oY/VpTPRhgWf9NfqR+v1jBf0QD7\r\nZSxWR1O9mW8ESYHuseHqtaJmnDkO84TIcyAiCz4vMVHpHJp/UB67djfEAB53\r\ntFoYNCLub/Cu9RRzuxjoGybqU3qLAv5qhAo+AiAJkEGp/M5fs+xB0MtRQ+uu\r\nfTqzRdnx1scZ7vqiP7sF0WHCdJ1ts3DRL3d8o11an11cZfX3y+is8JaKxa1l\r\nu6Gl14KjFPXgO9Tc6OaXFAFNZTtrari6vbqmX1ONScuTkAhz5qKmL6om94TO\r\nuUVKYgIo+pcDa0OR7ZyTf7PQTov0RMc4z9vsNV8julm4mXoH6o+gNbEooT0u\r\nUej2v73aDeWm+XBEZglw7tJcK0cNEeEmZFNkX8VM7lSff48UnNMvd7zujs3J\r\nA/xml9DgWaYAN4D4vH2Bqo2ZPQiMjNg3P+LIgs8f3kQfT3Bq+S5vHm9boMCk\r\n/ts+nGECFB4yD/eC8SP+pmt/Qgz1ZTNmKMM=\r\n=LK1a\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"andrewcturing","email":"andrew.c@turing.com"},"directories":{},"maintainers":[{"name":"andrewcturing","email":"andrew.c@turing.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/faunadb_0.3.4_1662142200874_0.4650442989596335"},"_hasShrinkwrap":false}},"time":{"created":"2022-09-02T18:10:00.822Z","0.3.4":"2022-09-02T18:10:01.080Z","modified":"2022-09-02T18:10:01.258Z"},"maintainers":[{"name":"andrewcturing","email":"andrew.c@turing.com"}],"description":"Pipedream Faunadb Components","homepage":"https://pipedream.com/apps/faunadb","keywords":["pipedream","faunadb"],"author":{"name":"Pipedream","email":"support@pipedream.com","url":"https://pipedream.com/"},"license":"MIT","readme":"# FaunaDB Event Sources\n\nFaunaDB Event Sources collect data from FaunaDB (for example, changes to a collection) and emits them as individual events. These events can trigger [Pipedream workflows](https://docs.pipedream.com/workflows/), and are accessible as a [real-time, private SSE stream](https://docs.pipedream.com/api/sse/), and via [REST API](https://docs.pipedream.com/api/rest/).\n\n[**Watch this video**](https://youtu.be/rsjbXdOouHU) to learn how to create an event source to track changes to documents in a Fauna collection and build a Pipedream workflow to run on every change.\n\n<!--ts-->\n\n- [FaunaDB Event Sources](#faunadb-event-sources)\n  - [Sources](#sources)\n    - [Changes to Documents in a Collection](#changes-to-documents-in-a-collection)\n  - [Workflows](#workflows)\n\n<!--te-->\n\n## Sources\n\n### Changes to Documents in a Collection\n\n[**Click here to create this source**](https://pipedream.com/sources?action=create&key=faunadb-changes-to-collection&app=faunadb)\n\nThe [`changes-to-collection.mjs`](changes-to-collection.mjs) source tracks [`add` and `remove` events](https://docs.fauna.com/fauna/current/api/fql/functions/events) to documents in a specific collection. Each time you add or remove a document from this collection, this event source emits an event of the following shape:\n\n<details>\n  <summary>Click to expand</summary>\n\n```json\n{\n  \"ts\": 1588738648630000,\n  \"action\": \"add\",\n  \"document\": {\n    \"@ref\": {\n      \"id\": \"264744257335591434\",\n      \"collection\": {\n        \"@ref\": {\n          \"id\": \"test\",\n          \"collection\": { \"@ref\": { \"id\": \"collections\" } }\n        }\n      }\n    }\n  }\n}\n```\n\n</details>\n\nIf you set the **Emit changes as a single event** property to `true`, Pipedream will emit a single event with all the changes since the last time the source ran. That event has the following shape:\n\n<details>\n  <summary>Click to expand</summary>\n\n```json\n[\n  {\n    \"ts\": 1588738648630000,\n    \"action\": \"add\",\n    \"document\": {\n      \"@ref\": {\n        \"id\": \"264744257335591434\",\n        \"collection\": {\n          \"@ref\": {\n            \"id\": \"test\",\n            \"collection\": { \"@ref\": { \"id\": \"collections\" } }\n          }\n        }\n      }\n    }\n  },\n  {\n    \"ts\": 1588739721810000,\n    \"action\": \"remove\",\n    \"document\": {\n      \"@ref\": {\n        \"id\": \"264744257335591434\",\n        \"collection\": {\n          \"@ref\": {\n            \"id\": \"test\",\n            \"collection\": { \"@ref\": { \"id\": \"collections\" } }\n          }\n        }\n      }\n    }\n  }\n]\n```\n\n</details>\n\n## Workflows\n\nHere are a few example workflows you can copy and modify in any way:\n\n- [Trigger an AWS Lambda script every time a document in a collection is added or removed](https://pipedream.com/@dylburger/changes-to-faunadb-documents-to-aws-lambda-p_RRC9NL/readme)\n- [Every time a document in a collection is added or removed, send the event to Amazon SQS](https://pipedream.com/@dylburger/changes-to-faunadb-documents-aws-sqs-p_PACGag/readme)\n- [Every time a document in a collection is added or removed, send the event to Amazon EventBridge](https://pipedream.com/@dylburger/changes-to-faunadb-documents-to-aws-eventbridge-event-bus-p_o7Cl3V/readme)\n","readmeFilename":"README.md"}