{"bugs":{"url":"https://github.com/sanity-io/sanity/issues"},"dist":{"shasum":"2433cf912156da4f09a2ce0b18ed384907ee288b","tarball":"https://registry.npmjs.org/@sanity/document-store/-/document-store-0.147.10-ts-client.1.tgz","fileCount":21,"integrity":"sha512-WwaFoV4bIcNzWU0UiEArCk0tdhU6dIG5dxz5S9IXljFm0kAVT2TsSrmd6S75HK/3QzBgNiJ2A1mFVd7rt2FgOw==","signatures":[{"sig":"MEUCIGewROe3AaC9XXWQe95U6cTIstepI5y7Flw2jXHP2cfyAiEAi+qcpQQWTRAn/Ejj+MOmPVN1u80KxaDXWNGyxCG7aIQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33518,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeH478CRA9TVsSAnZWagAAwdYP/2IoKkBQj/nlZy7YP2aD\nlrkfQ0iyBXXgrHDp+HIAjNq/WBDzGoR6lk7cq37Nw2NVkWexI5wWURJz2fOX\n3wTBAUPiIdE6nQ4vQtLWZy0y1zJPtySnYTazOmTE5iB3yPlZlYaQB/JgtLyq\n6JxtAPyvtT4jtoOD7vFXJ7d0n6u4Hvt9U4oFfva15r5TMZKmo5yoMEB05OC8\no7vM/EggtI+TLBKWowM0aIzJqGl9VbmXc1LtMmusiWh96baZgE1vWqXdAOXH\nREG4mpUPM1qRx3suLwSKOU9GCUpmil60nqJiUWmUDSMCYu4OgTImFZD4tCb9\n29nbxEvbW87O7n3UV2oJXkaoePAKg8azbdgrIW+AD/hoibtf9vEk8khwPhLr\ncRV/thaFf0zZjqxbwMIV+8eckILAh+yzJWiOJMdN9UDJZn1fz7Pd+HYWLc/L\n0qULIAUNNExni2k5egxlgXa59nMX+1e6v8jr4sy+XmVqxtyPg9iZGi6EkxFJ\nqxGM43I7Y9i7PpH2WCdS6eTSFI1DPhM4jDW2c2lBR0qKOk+5+5lATp5LysMc\nrKSjpAsjR4GSIhZ7cRcqGxWZthgtZEAB6tg7lgRXsrBuc2O6UFnjw76xrxph\nueA/xL4OvKHGj6mcmTFMoxYneBwhr4h4YTIOsMBKy0eHlpVbqCmNgmnjBfE9\nTH0U\r\n=yTcA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","name":"@sanity/document-store","author":{"name":"Sanity.io","email":"hello@sanity.io"},"readme":"# Document store\n\nSanity / gradient document store\n\n## Example\n```js\n// If you are interested in everything that happens with document `lol42`\nconst subscription = documents.byId(\"lol42\").subscribe(event => {\n  console.log('Something happened with document lol42!', event)\n})\n\n// After a while, when you are no longer interested in updates fom document `lol42`:\nsubscription.unsubscribe()\n```\n\n## How it works\nWhen you add a subscriber to a document the first thing that happens is that the subscriber function is called with a snapshot of the document's current state. This happens as soon as the snapshot is retrieved. If there is a cached version of it on the client, the snapshot is received immediately (synchronously).\n\nFrom that moment on, you will receive a new event every time something happens to the document, until you unsubscribe again.\n\n## API\n\n- `createDocumentStore({serverConnection: ServerConnection}) : DocumentStore`\n\nServerConnection must be an object with the following api:\n- `byId(id : string) : Observable<DocumentEvent>`\n- `query(query : string) : Observable<QueryResultEvent>`\n(todo, add more)\n\n### DocumentStore\n\n### Query methods\n- `byId(id : string) : Observable<DocumentEvent>`\n- `byIds(ids : Array<string>) : Observable<QueryResultEvent>`\n- `query(query : string) : Observable<QueryResultEvent>`\n\n### Mutation methods\n- `update(id : string, spec : UpdateSpec) : Observable<OperationEvent>`\n- `create(document : Document) : Observable<OperationEvent>`\n- `replace(documentId : string, document : Document) : Observable<OperationEvent>`\n- `createOrReplace(document : Document) : Observable<OperationEvent>`\n- `delete(documentId : string) :  : Observable<OperationEvent>`\n\n### Document\n- `_id : string`\n- `_type : string`\n\n### DocumentEventType\n\n### DocumentEvent\n- `type : string` either one of `snapshot`, `update`\n- `snapshot : Document`\n","gitHead":"5473a24ff3431de02eed65e8b70e3487fb03e2da","license":"MIT","scripts":{"clean":"rimraf lib","examples":"echo 'Running examples'; for i in examples/*.js; do echo '\n## '$i' ----\n' && node $i; done"},"_npmUser":{"name":"rexxars","email":"espen@hovlandsdal.com"},"homepage":"https://www.sanity.io/","keywords":["sanity","cms","headless","realtime","content","document-store"],"repository":{"url":"git+https://github.com/sanity-io/sanity.git","type":"git"},"_npmVersion":"lerna/3.16.4/node@v10.15.3+x64 (darwin)","description":"Sanity / gradient document store","directories":{},"maintainers":[{"name":"bjoerge","email":"bjoerge@gmail.com"},{"name":"evenw","email":"even@sanity.io"},{"name":"jemmima","email":"jemmimaknight@gmail.com"},{"name":"judofyr","email":"judofyr@gmail.com"},{"name":"kmelve","email":"knut.melvaer@gmail.com"},{"name":"kristofferj","email":"kristoffer@sanity.io"},{"name":"mariuslundgard","email":"studio@mariuslundgard.com"},{"name":"obliadp","email":"orjan@sanity.io"},{"name":"radhe_sanity","email":"radhe@sanity.io"},{"name":"rbotten","email":"rbotten@gmail.com"},{"name":"rexxars","email":"espen@hovlandsdal.com"},{"name":"saasen","email":"stensaasanders@gmail.com"},{"name":"sanity-io","email":"developers@sanity.io"},{"name":"simenss","email":"simen@bengler.no"},{"name":"skogsmaskin","email":"per.kristian.nordnes@gmail.com"},{"name":"thomax","email":"thomas@sanity.io"},{"name":"vicbergquist","email":"victoria.bergquist@gmail.com"}],"_nodeVersion":"10.15.3","dependencies":{"rxjs":"^6.5.3","lodash":"^4.17.15","nano-pubsub":"^1.0.2","@sanity/mutator":"0.147.10-ts-client.1+5473a24ff"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/document-store_0.147.10-ts-client.1_1579126524010_0.9150778145176925","host":"s3://npm-registry-packages"},"_id":"@sanity/document-store@0.147.10-ts-client.1","version":"0.147.10-ts-client.1"}